Seth il y a 6 ans
Parent
révision
9021deba77

+ 91
- 98
.idea/workspace.xml Voir le fichier

@@ -2,11 +2,8 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="b71a0d05-772d-4338-8f47-61b6a36d5d57" name="Default Changelist" comment="">
5
-      <change beforePath="$PROJECT_DIR$/src/main/java/AccountApp.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/AccountApp.java" afterDir="false" />
6
-      <change beforePath="$PROJECT_DIR$/src/main/java/AccountServ.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/AccountServ.java" afterDir="false" />
7
-      <change beforePath="$PROJECT_DIR$/src/main/java/Console.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Console.java" afterDir="false" />
5
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
8 6
       <change beforePath="$PROJECT_DIR$/src/test/java/AccountServTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/AccountServTest.java" afterDir="false" />
9
-      <change beforePath="$PROJECT_DIR$/src/test/java/MockDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/MockDao.java" afterDir="false" />
10 7
     </list>
11 8
     <ignored path="$PROJECT_DIR$/target/" />
12 9
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -19,17 +16,17 @@
19 16
     <session id="-1691611680">
20 17
       <usages-collector id="statistics.lifecycle.project">
21 18
         <counts>
22
-          <entry key="project.closed" value="3" />
19
+          <entry key="project.closed" value="5" />
23 20
           <entry key="project.open.time.0" value="1" />
24
-          <entry key="project.open.time.1" value="1" />
21
+          <entry key="project.open.time.1" value="3" />
25 22
           <entry key="project.open.time.6" value="1" />
26 23
           <entry key="project.open.time.8" value="1" />
27
-          <entry key="project.opened" value="4" />
24
+          <entry key="project.opened" value="6" />
28 25
         </counts>
29 26
       </usages-collector>
30 27
       <usages-collector id="statistics.file.extensions.open">
31 28
         <counts>
32
-          <entry key="class" value="3" />
29
+          <entry key="class" value="4" />
33 30
           <entry key="iml" value="2" />
34 31
           <entry key="java" value="7" />
35 32
           <entry key="md" value="1" />
@@ -38,7 +35,7 @@
38 35
       </usages-collector>
39 36
       <usages-collector id="statistics.file.types.open">
40 37
         <counts>
41
-          <entry key="CLASS" value="3" />
38
+          <entry key="CLASS" value="4" />
42 39
           <entry key="IDEA_MODULE" value="2" />
43 40
           <entry key="JAVA" value="7" />
44 41
           <entry key="Markdown" value="1" />
@@ -47,12 +44,12 @@
47 44
       </usages-collector>
48 45
       <usages-collector id="statistics.file.extensions.edit">
49 46
         <counts>
50
-          <entry key="java" value="3791" />
47
+          <entry key="java" value="3913" />
51 48
         </counts>
52 49
       </usages-collector>
53 50
       <usages-collector id="statistics.file.types.edit">
54 51
         <counts>
55
-          <entry key="JAVA" value="3791" />
52
+          <entry key="JAVA" value="3913" />
56 53
         </counts>
57 54
       </usages-collector>
58 55
     </session>
@@ -62,7 +59,7 @@
62 59
       <file pinned="false" current-in-tab="false">
63 60
         <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
64 61
           <provider selected="true" editor-type-id="text-editor">
65
-            <state relative-caret-position="-288">
62
+            <state relative-caret-position="15">
66 63
               <caret line="5" column="13" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
67 64
             </state>
68 65
           </provider>
@@ -71,26 +68,17 @@
71 68
       <file pinned="false" current-in-tab="false">
72 69
         <entry file="file://$PROJECT_DIR$/src/test/java/MockDao.java">
73 70
           <provider selected="true" editor-type-id="text-editor">
74
-            <state relative-caret-position="240">
75
-              <caret line="32" selection-start-line="32" selection-end-line="32" />
76
-              <folding>
77
-                <element signature="imports" expanded="true" />
78
-                <element signature="e#1718#1719#0" expanded="true" />
79
-                <element signature="e#1745#1746#0" expanded="true" />
80
-                <element signature="e#1821#1822#0" expanded="true" />
81
-                <element signature="e#1848#1849#0" expanded="true" />
82
-                <element signature="e#1924#1925#0" expanded="true" />
83
-                <element signature="e#1951#1952#0" expanded="true" />
84
-              </folding>
71
+            <state>
72
+              <caret column="30" lean-forward="true" selection-start-column="30" selection-end-column="30" />
85 73
             </state>
86 74
           </provider>
87 75
         </entry>
88 76
       </file>
89
-      <file pinned="false" current-in-tab="false">
77
+      <file pinned="false" current-in-tab="true">
90 78
         <entry file="file://$PROJECT_DIR$/src/test/java/AccountServTest.java">
91 79
           <provider selected="true" editor-type-id="text-editor">
92
-            <state relative-caret-position="148">
93
-              <caret line="37" column="31" selection-start-line="37" selection-start-column="31" selection-end-line="37" selection-end-column="31" />
80
+            <state relative-caret-position="465">
81
+              <caret line="37" column="9" lean-forward="true" selection-start-line="37" selection-start-column="9" selection-end-line="38" selection-end-column="26" />
94 82
             </state>
95 83
           </provider>
96 84
         </entry>
@@ -107,15 +95,13 @@
107 95
           </provider>
108 96
         </entry>
109 97
       </file>
110
-      <file pinned="false" current-in-tab="true">
98
+      <file pinned="false" current-in-tab="false">
111 99
         <entry file="file://$PROJECT_DIR$/src/main/java/AccountServ.java">
112 100
           <provider selected="true" editor-type-id="text-editor">
113
-            <state relative-caret-position="225">
114
-              <caret line="35" column="40" selection-start-line="35" selection-start-column="40" selection-end-line="35" selection-end-column="40" />
101
+            <state relative-caret-position="930">
102
+              <caret line="64" column="42" selection-start-line="64" selection-start-column="42" selection-end-line="64" selection-end-column="42" />
115 103
               <folding>
116 104
                 <element signature="imports" expanded="true" />
117
-                <element signature="e#175#176#0" expanded="true" />
118
-                <element signature="e#203#204#0" expanded="true" />
119 105
               </folding>
120 106
             </state>
121 107
           </provider>
@@ -124,19 +110,11 @@
124 110
       <file pinned="false" current-in-tab="false">
125 111
         <entry file="file://$PROJECT_DIR$/src/main/java/Console.java">
126 112
           <provider selected="true" editor-type-id="text-editor">
127
-            <state relative-caret-position="307">
128
-              <caret line="47" column="1" lean-forward="true" selection-start-line="47" selection-start-column="1" selection-end-line="47" selection-end-column="1" />
113
+            <state relative-caret-position="585">
114
+              <caret line="47" column="1" selection-start-line="47" selection-start-column="1" selection-end-line="47" selection-end-column="1" />
129 115
               <folding>
130 116
                 <element signature="e#317#318#0" expanded="true" />
131
-                <element signature="e#345#346#0" expanded="true" />
132
-                <element signature="e#135#136#0" expanded="true" />
133
-                <element signature="e#169#170#0" expanded="true" />
134
-                <element signature="e#213#214#0" expanded="true" />
135
-                <element signature="e#241#242#0" expanded="true" />
136
-                <element signature="e#273#274#0" expanded="true" />
137
-                <element signature="e#286#287#0" expanded="true" />
138
-                <element signature="e#331#332#0" expanded="true" />
139
-                <element signature="e#353#354#0" expanded="true" />
117
+                <element signature="e#378#379#0" expanded="true" />
140 118
               </folding>
141 119
             </state>
142 120
           </provider>
@@ -172,10 +150,10 @@
172 150
     <option name="CHANGED_PATHS">
173 151
       <list>
174 152
         <option value="$PROJECT_DIR$/src/test/java/MockDao.java" />
175
-        <option value="$PROJECT_DIR$/src/test/java/AccountServTest.java" />
176 153
         <option value="$PROJECT_DIR$/src/main/java/AccountApp.java" />
177 154
         <option value="$PROJECT_DIR$/src/main/java/Console.java" />
178 155
         <option value="$PROJECT_DIR$/src/main/java/AccountServ.java" />
156
+        <option value="$PROJECT_DIR$/src/test/java/AccountServTest.java" />
179 157
       </list>
180 158
     </option>
181 159
   </component>
@@ -185,6 +163,13 @@
185 163
     <detection-done>true</detection-done>
186 164
     <sorting>DEFINITION_ORDER</sorting>
187 165
   </component>
166
+  <component name="MavenImportPreferences">
167
+    <option name="importingSettings">
168
+      <MavenImportingSettings>
169
+        <option name="importAutomatically" value="true" />
170
+      </MavenImportingSettings>
171
+    </option>
172
+  </component>
188 173
   <component name="ProjectFrameBounds">
189 174
     <option name="y" value="23" />
190 175
     <option name="width" value="1440" />
@@ -196,8 +181,6 @@
196 181
       <foldersAlwaysOnTop value="true" />
197 182
     </navigator>
198 183
     <panes>
199
-      <pane id="PackagesPane" />
200
-      <pane id="Scope" />
201 184
       <pane id="ProjectPane">
202 185
         <subPane>
203 186
           <expand>
@@ -240,12 +223,14 @@
240 223
           <select />
241 224
         </subPane>
242 225
       </pane>
226
+      <pane id="PackagesPane" />
227
+      <pane id="Scope" />
243 228
     </panes>
244 229
   </component>
245 230
   <component name="PropertiesComponent">
246 231
     <property name="WebServerToolWindowFactoryState" value="false" />
247 232
     <property name="aspect.path.notification.shown" value="true" />
248
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542570976587" />
233
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542663570903" />
249 234
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
250 235
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
251 236
     <property name="nodejs_npm_path_reset_for_default_project" value="true" />
@@ -266,7 +251,7 @@
266 251
       </list>
267 252
     </option>
268 253
   </component>
269
-  <component name="RunManager" selected="Application.AccountApp">
254
+  <component name="RunManager" selected="JUnit.AccountServTest">
270 255
     <configuration name="AccountApp" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
271 256
       <option name="MAIN_CLASS_NAME" value="AccountApp" />
272 257
       <module name="SimpleAccount" />
@@ -274,6 +259,14 @@
274 259
         <option name="Make" enabled="true" />
275 260
       </method>
276 261
     </configuration>
262
+    <configuration name="AccountServTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
263
+      <module name="SimpleAccount" />
264
+      <option name="PACKAGE_NAME" value="" />
265
+      <option name="MAIN_CLASS_NAME" value="AccountServTest" />
266
+      <method v="2">
267
+        <option name="Make" enabled="true" />
268
+      </method>
269
+    </configuration>
277 270
     <configuration name="AccountServTest.createTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
278 271
       <module name="SimpleAccount" />
279 272
       <option name="PACKAGE_NAME" value="" />
@@ -294,16 +287,30 @@
294 287
         <option name="Make" enabled="true" />
295 288
       </method>
296 289
     </configuration>
290
+    <configuration name="AccountServTest.updateTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
291
+      <module name="SimpleAccount" />
292
+      <option name="PACKAGE_NAME" value="" />
293
+      <option name="MAIN_CLASS_NAME" value="AccountServTest" />
294
+      <option name="METHOD_NAME" value="updateTest" />
295
+      <option name="TEST_OBJECT" value="method" />
296
+      <method v="2">
297
+        <option name="Make" enabled="true" />
298
+      </method>
299
+    </configuration>
297 300
     <list>
298 301
       <item itemvalue="Application.AccountApp" />
299 302
       <item itemvalue="JUnit.AccountServTest.createTest" />
300 303
       <item itemvalue="JUnit.AccountServTest.readTest" />
304
+      <item itemvalue="JUnit.AccountServTest.updateTest" />
305
+      <item itemvalue="JUnit.AccountServTest" />
301 306
     </list>
302 307
     <recent_temporary>
303 308
       <list>
309
+        <item itemvalue="JUnit.AccountServTest" />
310
+        <item itemvalue="JUnit.AccountServTest.updateTest" />
311
+        <item itemvalue="JUnit.AccountServTest.createTest" />
304 312
         <item itemvalue="Application.AccountApp" />
305 313
         <item itemvalue="JUnit.AccountServTest.readTest" />
306
-        <item itemvalue="JUnit.AccountServTest.createTest" />
307 314
       </list>
308 315
     </recent_temporary>
309 316
   </component>
@@ -320,7 +327,9 @@
320 327
       <workItem from="1542239571129" duration="6414000" />
321 328
       <workItem from="1542402275147" duration="2006000" />
322 329
       <workItem from="1542420139392" duration="4000" />
323
-      <workItem from="1542475891339" duration="12147000" />
330
+      <workItem from="1542475891339" duration="12377000" />
331
+      <workItem from="1542632651713" duration="1192000" />
332
+      <workItem from="1542659874807" duration="1187000" />
324 333
     </task>
325 334
     <servers />
326 335
   </component>
@@ -340,15 +349,18 @@
340 349
     <history-entry file="AccountServTest_readTest - 2018.11.18 at 13h 57m 20s.xml">
341 350
       <configuration name="AccountServTest.readTest" configurationId="JUnit" />
342 351
     </history-entry>
352
+    <history-entry file="AccountServTest_createTest - 2018.11.19 at 15h 40m 25s.xml">
353
+      <configuration name="AccountServTest.createTest" configurationId="JUnit" />
354
+    </history-entry>
343 355
   </component>
344 356
   <component name="TimeTrackingManager">
345
-    <option name="totallyTimeSpent" value="20571000" />
357
+    <option name="totallyTimeSpent" value="23180000" />
346 358
   </component>
347 359
   <component name="ToolWindowManager">
348 360
     <frame x="0" y="23" width="1440" height="807" extended-state="0" />
349 361
     <editor active="true" />
350 362
     <layout>
351
-      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.26037195" />
363
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.26752505" />
352 364
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
353 365
       <window_info id="Image Layers" order="2" />
354 366
       <window_info id="Designer" order="3" />
@@ -357,7 +369,7 @@
357 369
       <window_info id="Favorites" order="6" side_tool="true" />
358 370
       <window_info anchor="bottom" id="Message" order="0" />
359 371
       <window_info anchor="bottom" id="Find" order="1" />
360
-      <window_info active="true" anchor="bottom" id="Run" order="2" sideWeight="0.49928468" visible="true" weight="0.4797203" />
372
+      <window_info anchor="bottom" id="Run" order="2" sideWeight="0.49928468" weight="0.4797203" />
361 373
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
362 374
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
363 375
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
@@ -410,40 +422,31 @@
410 422
         </state>
411 423
       </provider>
412 424
     </entry>
413
-    <entry file="jar://$MAVEN_REPOSITORY$/com/j256/ormlite/ormlite-core/4.48/ormlite-core-4.48.jar!/com/j256/ormlite/dao/Dao.class">
414
-      <provider selected="true" editor-type-id="text-editor">
415
-        <state relative-caret-position="675">
416
-          <caret line="65" column="44" lean-forward="true" selection-start-line="65" selection-start-column="44" selection-end-line="65" selection-end-column="44" />
417
-        </state>
418
-      </provider>
419
-    </entry>
420
-    <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
425
+    <entry file="file://$PROJECT_DIR$/src/main/java/AccountServ.java">
421 426
       <provider selected="true" editor-type-id="text-editor">
422
-        <state relative-caret-position="-288">
423
-          <caret line="5" column="13" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
427
+        <state relative-caret-position="930">
428
+          <caret line="64" column="42" selection-start-line="64" selection-start-column="42" selection-end-line="64" selection-end-column="42" />
429
+          <folding>
430
+            <element signature="imports" expanded="true" />
431
+          </folding>
424 432
         </state>
425 433
       </provider>
426 434
     </entry>
427
-    <entry file="file://$PROJECT_DIR$/src/test/java/MockDao.java">
435
+    <entry file="file://$PROJECT_DIR$/src/main/java/Console.java">
428 436
       <provider selected="true" editor-type-id="text-editor">
429
-        <state relative-caret-position="240">
430
-          <caret line="32" selection-start-line="32" selection-end-line="32" />
437
+        <state relative-caret-position="585">
438
+          <caret line="47" column="1" selection-start-line="47" selection-start-column="1" selection-end-line="47" selection-end-column="1" />
431 439
           <folding>
432
-            <element signature="imports" expanded="true" />
433
-            <element signature="e#1718#1719#0" expanded="true" />
434
-            <element signature="e#1745#1746#0" expanded="true" />
435
-            <element signature="e#1821#1822#0" expanded="true" />
436
-            <element signature="e#1848#1849#0" expanded="true" />
437
-            <element signature="e#1924#1925#0" expanded="true" />
438
-            <element signature="e#1951#1952#0" expanded="true" />
440
+            <element signature="e#317#318#0" expanded="true" />
441
+            <element signature="e#378#379#0" expanded="true" />
439 442
           </folding>
440 443
         </state>
441 444
       </provider>
442 445
     </entry>
443
-    <entry file="file://$PROJECT_DIR$/src/test/java/AccountServTest.java">
446
+    <entry file="jar://$MAVEN_REPOSITORY$/com/j256/ormlite/ormlite-core/4.48/ormlite-core-4.48.jar!/com/j256/ormlite/dao/Dao.class">
444 447
       <provider selected="true" editor-type-id="text-editor">
445
-        <state relative-caret-position="148">
446
-          <caret line="37" column="31" selection-start-line="37" selection-start-column="31" selection-end-line="37" selection-end-column="31" />
448
+        <state relative-caret-position="495">
449
+          <caret line="53" column="8" selection-start-line="53" selection-start-column="8" selection-end-line="53" selection-end-column="8" />
447 450
         </state>
448 451
       </provider>
449 452
     </entry>
@@ -457,34 +460,24 @@
457 460
         </state>
458 461
       </provider>
459 462
     </entry>
460
-    <entry file="file://$PROJECT_DIR$/src/main/java/Console.java">
463
+    <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
461 464
       <provider selected="true" editor-type-id="text-editor">
462
-        <state relative-caret-position="307">
463
-          <caret line="47" column="1" lean-forward="true" selection-start-line="47" selection-start-column="1" selection-end-line="47" selection-end-column="1" />
464
-          <folding>
465
-            <element signature="e#317#318#0" expanded="true" />
466
-            <element signature="e#345#346#0" expanded="true" />
467
-            <element signature="e#135#136#0" expanded="true" />
468
-            <element signature="e#169#170#0" expanded="true" />
469
-            <element signature="e#213#214#0" expanded="true" />
470
-            <element signature="e#241#242#0" expanded="true" />
471
-            <element signature="e#273#274#0" expanded="true" />
472
-            <element signature="e#286#287#0" expanded="true" />
473
-            <element signature="e#331#332#0" expanded="true" />
474
-            <element signature="e#353#354#0" expanded="true" />
475
-          </folding>
465
+        <state relative-caret-position="15">
466
+          <caret line="5" column="13" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
476 467
         </state>
477 468
       </provider>
478 469
     </entry>
479
-    <entry file="file://$PROJECT_DIR$/src/main/java/AccountServ.java">
470
+    <entry file="file://$PROJECT_DIR$/src/test/java/MockDao.java">
480 471
       <provider selected="true" editor-type-id="text-editor">
481
-        <state relative-caret-position="225">
482
-          <caret line="35" column="40" selection-start-line="35" selection-start-column="40" selection-end-line="35" selection-end-column="40" />
483
-          <folding>
484
-            <element signature="imports" expanded="true" />
485
-            <element signature="e#175#176#0" expanded="true" />
486
-            <element signature="e#203#204#0" expanded="true" />
487
-          </folding>
472
+        <state>
473
+          <caret column="30" lean-forward="true" selection-start-column="30" selection-end-column="30" />
474
+        </state>
475
+      </provider>
476
+    </entry>
477
+    <entry file="file://$PROJECT_DIR$/src/test/java/AccountServTest.java">
478
+      <provider selected="true" editor-type-id="text-editor">
479
+        <state relative-caret-position="465">
480
+          <caret line="37" column="9" lean-forward="true" selection-start-line="37" selection-start-column="9" selection-end-line="38" selection-end-column="26" />
488 481
         </state>
489 482
       </provider>
490 483
     </entry>

+ 8
- 4
src/test/java/AccountServTest.java Voir le fichier

@@ -28,9 +28,11 @@ public class AccountServTest {
28 28
     }
29 29
 
30 30
     @Test
31
-    public void updateTest() {
32
-
31
+    public void updateTest() throws SQLException {
32
+        int expected = 300;
33
+        int actual = dao.update(account);
33 34
 
35
+        Assert.assertEquals(expected, actual);
34 36
     }
35 37
 
36 38
     @Test
@@ -42,9 +44,11 @@ public class AccountServTest {
42 44
     }
43 45
 
44 46
     @Test
45
-    public void destroyTest() {
46
-
47
+    public void destroyTest() throws SQLException{
48
+        int expected = 200;
49
+        int actual = dao.delete(account);
47 50
 
51
+        Assert.assertEquals(expected, actual);
48 52
     }
49 53
 
50 54
 }

BIN
target/classes/AccountServ.class Voir le fichier


BIN
target/test-classes/AccountServTest.class Voir le fichier