瀏覽代碼

control loop completed

Michelle DiMarino 6 年之前
父節點
當前提交
3486b1e0f0

+ 103
- 109
ormLab/.idea/workspace.xml 查看文件

@@ -5,9 +5,11 @@
5 5
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6 6
       <change beforePath="$PROJECT_DIR$/src/main/java/AccountApp.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/AccountApp.java" afterDir="false" />
7 7
       <change beforePath="$PROJECT_DIR$/src/main/java/Console.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Console.java" afterDir="false" />
8
-      <change beforePath="$PROJECT_DIR$/src/main/java/DatabaseConnection.java" beforeDir="false" />
8
+      <change beforePath="$PROJECT_DIR$/src/main/java/MockDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/MockDao.java" afterDir="false" />
9 9
       <change beforePath="$PROJECT_DIR$/src/main/java/Service.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Service.java" afterDir="false" />
10 10
       <change beforePath="$PROJECT_DIR$/src/test/java/ServiceTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/ServiceTest.java" afterDir="false" />
11
+      <change beforePath="$PROJECT_DIR$/target/classes/Console.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/Console.class" afterDir="false" />
12
+      <change beforePath="$PROJECT_DIR$/target/classes/MockDao.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/MockDao.class" afterDir="false" />
11 13
     </list>
12 14
     <ignored path="$PROJECT_DIR$/out/" />
13 15
     <ignored path="$PROJECT_DIR$/target/" />
@@ -51,32 +53,33 @@
51 53
     <session id="589865822">
52 54
       <usages-collector id="statistics.lifecycle.project">
53 55
         <counts>
54
-          <entry key="project.closed" value="1" />
56
+          <entry key="project.closed" value="2" />
55 57
           <entry key="project.open.time.10" value="1" />
58
+          <entry key="project.open.time.13" value="1" />
56 59
           <entry key="project.open.time.7" value="1" />
57
-          <entry key="project.opened" value="2" />
60
+          <entry key="project.opened" value="3" />
58 61
         </counts>
59 62
       </usages-collector>
60 63
       <usages-collector id="statistics.file.extensions.edit">
61 64
         <counts>
62
-          <entry key="java" value="1909" />
65
+          <entry key="java" value="3713" />
63 66
           <entry key="xml" value="8" />
64 67
         </counts>
65 68
       </usages-collector>
66 69
       <usages-collector id="statistics.file.types.edit">
67 70
         <counts>
68
-          <entry key="JAVA" value="1909" />
71
+          <entry key="JAVA" value="3713" />
69 72
           <entry key="XML" value="8" />
70 73
         </counts>
71 74
       </usages-collector>
72 75
       <usages-collector id="statistics.file.extensions.open">
73 76
         <counts>
74
-          <entry key="java" value="9" />
77
+          <entry key="java" value="12" />
75 78
         </counts>
76 79
       </usages-collector>
77 80
       <usages-collector id="statistics.file.types.open">
78 81
         <counts>
79
-          <entry key="JAVA" value="9" />
82
+          <entry key="JAVA" value="12" />
80 83
         </counts>
81 84
       </usages-collector>
82 85
     </session>
@@ -86,7 +89,7 @@
86 89
       <file pinned="false" current-in-tab="false">
87 90
         <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
88 91
           <provider selected="true" editor-type-id="text-editor">
89
-            <state relative-caret-position="765">
92
+            <state relative-caret-position="539">
90 93
               <caret line="65" selection-start-line="65" selection-end-line="65" />
91 94
               <folding>
92 95
                 <element signature="imports" expanded="true" />
@@ -95,11 +98,11 @@
95 98
           </provider>
96 99
         </entry>
97 100
       </file>
98
-      <file pinned="false" current-in-tab="false">
101
+      <file pinned="false" current-in-tab="true">
99 102
         <entry file="file://$PROJECT_DIR$/src/main/java/AccountApp.java">
100 103
           <provider selected="true" editor-type-id="text-editor">
101
-            <state relative-caret-position="104">
102
-              <caret line="44" column="12" lean-forward="true" selection-start-line="44" selection-start-column="12" selection-end-line="44" selection-end-column="12" />
104
+            <state relative-caret-position="130">
105
+              <caret line="54" column="54" selection-start-line="54" selection-start-column="54" selection-end-line="54" selection-end-column="54" />
103 106
               <folding>
104 107
                 <element signature="imports" expanded="true" />
105 108
               </folding>
@@ -110,17 +113,17 @@
110 113
       <file pinned="false" current-in-tab="false">
111 114
         <entry file="file://$PROJECT_DIR$/src/main/java/Console.java">
112 115
           <provider selected="true" editor-type-id="text-editor">
113
-            <state relative-caret-position="15">
114
-              <caret line="1" selection-start-line="1" selection-end-line="1" />
116
+            <state relative-caret-position="468">
117
+              <caret line="53" selection-start-line="53" selection-end-line="53" />
115 118
             </state>
116 119
           </provider>
117 120
         </entry>
118 121
       </file>
119
-      <file pinned="false" current-in-tab="true">
122
+      <file pinned="false" current-in-tab="false">
120 123
         <entry file="file://$PROJECT_DIR$/src/main/java/Service.java">
121 124
           <provider selected="true" editor-type-id="text-editor">
122
-            <state relative-caret-position="408">
123
-              <caret line="32" column="4" selection-start-line="32" selection-start-column="4" selection-end-line="32" selection-end-column="4" />
125
+            <state relative-caret-position="134">
126
+              <caret line="11" column="30" lean-forward="true" selection-start-line="11" selection-start-column="30" selection-end-line="11" selection-end-column="30" />
124 127
               <folding>
125 128
                 <element signature="imports" expanded="true" />
126 129
               </folding>
@@ -131,40 +134,16 @@
131 134
       <file pinned="false" current-in-tab="false">
132 135
         <entry file="file://$PROJECT_DIR$/src/main/java/MockDao.java">
133 136
           <provider selected="true" editor-type-id="text-editor">
134
-            <state relative-caret-position="172">
135
-              <caret line="94" column="58" lean-forward="true" selection-start-line="94" selection-start-column="58" selection-end-line="94" selection-end-column="58" />
137
+            <state relative-caret-position="225">
138
+              <caret line="15" column="55" lean-forward="true" selection-start-line="15" selection-start-column="55" selection-end-line="15" selection-end-column="55" />
136 139
               <folding>
137 140
                 <element signature="imports" expanded="true" />
138
-                <element signature="e#1221#1222#0" expanded="true" />
139 141
                 <element signature="e#1248#1249#0" expanded="true" />
140
-                <element signature="e#1292#1293#0" expanded="true" />
142
+                <element signature="e#1275#1276#0" expanded="true" />
141 143
                 <element signature="e#1319#1320#0" expanded="true" />
142
-                <element signature="e#1363#1364#0" expanded="true" />
144
+                <element signature="e#1346#1347#0" expanded="true" />
143 145
                 <element signature="e#1390#1391#0" expanded="true" />
144
-                <element signature="e#2616#2617#0" expanded="true" />
145
-                <element signature="e#2643#2644#0" expanded="true" />
146
-                <element signature="e#2691#2692#0" expanded="true" />
147
-                <element signature="e#2718#2719#0" expanded="true" />
148
-                <element signature="e#3019#3020#0" expanded="true" />
149
-                <element signature="e#3046#3047#0" expanded="true" />
150
-                <element signature="e#3133#3134#0" expanded="true" />
151
-                <element signature="e#3160#3161#0" expanded="true" />
152
-                <element signature="e#3946#3947#0" expanded="true" />
153
-                <element signature="e#3973#3974#0" expanded="true" />
154
-                <element signature="e#4200#4201#0" expanded="true" />
155
-                <element signature="e#4227#4228#0" expanded="true" />
156
-                <element signature="e#4263#4264#0" expanded="true" />
157
-                <element signature="e#4291#4292#0" expanded="true" />
158
-                <element signature="e#4846#4847#0" expanded="true" />
159
-                <element signature="e#4873#4874#0" expanded="true" />
160
-                <element signature="e#5184#5185#0" expanded="true" />
161
-                <element signature="e#5211#5212#0" expanded="true" />
162
-                <element signature="e#6136#6137#0" expanded="true" />
163
-                <element signature="e#6163#6164#0" expanded="true" />
164
-                <element signature="e#6409#6410#0" expanded="true" />
165
-                <element signature="e#6436#6437#0" expanded="true" />
166
-                <element signature="e#7103#7104#0" expanded="true" />
167
-                <element signature="e#7130#7131#0" expanded="true" />
146
+                <element signature="e#1417#1418#0" expanded="true" />
168 147
               </folding>
169 148
             </state>
170 149
           </provider>
@@ -173,8 +152,8 @@
173 152
       <file pinned="false" current-in-tab="false">
174 153
         <entry file="file://$PROJECT_DIR$/src/test/java/ServiceTest.java">
175 154
           <provider selected="true" editor-type-id="text-editor">
176
-            <state relative-caret-position="458">
177
-              <caret line="48" lean-forward="true" selection-start-line="48" selection-end-line="48" />
155
+            <state relative-caret-position="467">
156
+              <caret line="45" column="5" selection-start-line="45" selection-start-column="5" selection-end-line="45" selection-end-column="5" />
178 157
               <folding>
179 158
                 <element signature="imports" expanded="true" />
180 159
               </folding>
@@ -201,11 +180,11 @@
201 180
         <option value="$PROJECT_DIR$/src/main/java/Account.java" />
202 181
         <option value="$PROJECT_DIR$/pom.xml" />
203 182
         <option value="$PROJECT_DIR$/src/main/java/DatabaseConnection.java" />
204
-        <option value="$PROJECT_DIR$/src/main/java/AccountApp.java" />
183
+        <option value="$PROJECT_DIR$/src/test/java/ServiceTest.java" />
205 184
         <option value="$PROJECT_DIR$/src/main/java/Console.java" />
206
-        <option value="$PROJECT_DIR$/src/main/java/Service.java" />
207 185
         <option value="$PROJECT_DIR$/src/main/java/MockDao.java" />
208
-        <option value="$PROJECT_DIR$/src/test/java/ServiceTest.java" />
186
+        <option value="$PROJECT_DIR$/src/main/java/Service.java" />
187
+        <option value="$PROJECT_DIR$/src/main/java/AccountApp.java" />
209 188
       </list>
210 189
     </option>
211 190
   </component>
@@ -286,14 +265,14 @@
286 265
           <select />
287 266
         </subPane>
288 267
       </pane>
289
-      <pane id="Scope" />
290 268
       <pane id="PackagesPane" />
269
+      <pane id="Scope" />
291 270
     </panes>
292 271
   </component>
293 272
   <component name="PropertiesComponent">
294 273
     <property name="WebServerToolWindowFactoryState" value="false" />
295 274
     <property name="aspect.path.notification.shown" value="true" />
296
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542405706723" />
275
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542469814728" />
297 276
     <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
298 277
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
299 278
     <property name="nodejs_npm_path_reset_for_default_project" value="true" />
@@ -313,7 +292,7 @@
313 292
       </list>
314 293
     </option>
315 294
   </component>
316
-  <component name="RunManager" selected="JUnit.ServiceTest.createTest">
295
+  <component name="RunManager" selected="Application.AccountApp">
317 296
     <configuration name="AccountApp" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
318 297
       <option name="MAIN_CLASS_NAME" value="AccountApp" />
319 298
       <module name="ormLab" />
@@ -337,8 +316,8 @@
337 316
     </list>
338 317
     <recent_temporary>
339 318
       <list>
340
-        <item itemvalue="JUnit.ServiceTest.createTest" />
341 319
         <item itemvalue="Application.AccountApp" />
320
+        <item itemvalue="JUnit.ServiceTest.createTest" />
342 321
       </list>
343 322
     </recent_temporary>
344 323
   </component>
@@ -355,17 +334,17 @@
355 334
       <workItem from="1542305477578" duration="1737000" />
356 335
       <workItem from="1542308857229" duration="4726000" />
357 336
       <workItem from="1542400944135" duration="4324000" />
337
+      <workItem from="1542465230710" duration="4214000" />
358 338
     </task>
359 339
     <servers />
360 340
   </component>
361 341
   <component name="TimeTrackingManager">
362
-    <option name="totallyTimeSpent" value="10787000" />
342
+    <option name="totallyTimeSpent" value="15001000" />
363 343
   </component>
364 344
   <component name="ToolWindowManager">
365 345
     <frame x="0" y="24" width="1260" height="708" extended-state="0" />
366
-    <editor active="true" />
367 346
     <layout>
368
-      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.25779969" />
347
+      <window_info content_ui="combo" id="Project" order="0" weight="0.26190478" />
369 348
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
370 349
       <window_info id="Image Layers" order="2" />
371 350
       <window_info id="Designer" order="3" />
@@ -374,7 +353,7 @@
374 353
       <window_info id="Favorites" order="6" side_tool="true" />
375 354
       <window_info anchor="bottom" id="Message" order="0" />
376 355
       <window_info anchor="bottom" id="Find" order="1" />
377
-      <window_info anchor="bottom" id="Run" order="2" weight="0.32954547" />
356
+      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.32954547" />
378 357
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
379 358
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
380 359
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
@@ -383,7 +362,7 @@
383 362
       <window_info anchor="bottom" id="Database Changes" order="8" show_stripe_button="false" />
384 363
       <window_info anchor="bottom" id="Terminal" order="9" />
385 364
       <window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
386
-      <window_info active="true" anchor="bottom" id="Messages" order="11" visible="true" weight="0.32954547" />
365
+      <window_info anchor="bottom" id="Messages" order="11" weight="0.32954547" />
387 366
       <window_info anchor="bottom" id="Thumbnails" order="12" weight="0.32954547" />
388 367
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
389 368
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
@@ -395,6 +374,37 @@
395 374
       <window_info anchor="right" id="Palette&#9;" order="7" />
396 375
       <window_info anchor="right" id="Maven Projects" order="8" weight="0.32922825" />
397 376
     </layout>
377
+    <layout-to-restore>
378
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.26190478" />
379
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
380
+      <window_info id="Image Layers" order="2" />
381
+      <window_info id="Designer" order="3" />
382
+      <window_info id="UI Designer" order="4" />
383
+      <window_info id="Capture Tool" order="5" />
384
+      <window_info id="Favorites" order="6" side_tool="true" />
385
+      <window_info anchor="bottom" id="Message" order="0" />
386
+      <window_info anchor="bottom" id="Find" order="1" />
387
+      <window_info anchor="bottom" id="Run" order="2" weight="0.32954547" />
388
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
389
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
390
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
391
+      <window_info anchor="bottom" id="TODO" order="6" />
392
+      <window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" />
393
+      <window_info anchor="bottom" id="Database Changes" order="8" show_stripe_button="false" />
394
+      <window_info anchor="bottom" id="Terminal" order="9" />
395
+      <window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
396
+      <window_info anchor="bottom" id="Messages" order="11" weight="0.32954547" />
397
+      <window_info anchor="bottom" id="Thumbnails" order="12" weight="0.32954547" />
398
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
399
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
400
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
401
+      <window_info anchor="right" id="Palette" order="3" />
402
+      <window_info anchor="right" id="Capture Analysis" order="4" />
403
+      <window_info anchor="right" id="Database" order="5" />
404
+      <window_info anchor="right" id="Theme Preview" order="6" />
405
+      <window_info anchor="right" id="Palette&#9;" order="7" />
406
+      <window_info anchor="right" id="Maven Projects" order="8" weight="0.32922825" />
407
+    </layout-to-restore>
398 408
   </component>
399 409
   <component name="TypeScriptGeneratedFilesManager">
400 410
     <option name="version" value="1" />
@@ -410,94 +420,78 @@
410 420
         </state>
411 421
       </provider>
412 422
     </entry>
413
-    <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
423
+    <entry file="file://$PROJECT_DIR$/src/main/java/DatabaseConnection.java" />
424
+    <entry file="file://$PROJECT_DIR$/../../Week 4/Casino/src/main/java/io/zipcoder/casino/Console.java">
414 425
       <provider selected="true" editor-type-id="text-editor">
415
-        <state relative-caret-position="765">
416
-          <caret line="65" selection-start-line="65" selection-end-line="65" />
417
-          <folding>
418
-            <element signature="imports" expanded="true" />
419
-          </folding>
426
+        <state relative-caret-position="465">
427
+          <caret line="39" column="5" lean-forward="true" selection-start-line="15" selection-end-line="39" selection-end-column="5" />
420 428
         </state>
421 429
       </provider>
422 430
     </entry>
423
-    <entry file="file://$PROJECT_DIR$/src/main/java/DatabaseConnection.java">
431
+    <entry file="file://$PROJECT_DIR$/../../Week5/ZCW-OOP-Casino/src/main/java/io/zipcoder/casino/blackjack.java">
424 432
       <provider selected="true" editor-type-id="text-editor">
425
-        <state relative-caret-position="120">
426
-          <caret line="8" selection-start-line="8" selection-end-line="8" />
433
+        <state relative-caret-position="-207">
434
+          <caret line="80" column="29" lean-forward="true" selection-start-line="80" selection-start-column="29" selection-end-line="80" selection-end-column="29" />
427 435
         </state>
428 436
       </provider>
429 437
     </entry>
430
-    <entry file="file://$PROJECT_DIR$/src/main/java/AccountApp.java">
438
+    <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
431 439
       <provider selected="true" editor-type-id="text-editor">
432
-        <state relative-caret-position="104">
433
-          <caret line="44" column="12" lean-forward="true" selection-start-line="44" selection-start-column="12" selection-end-line="44" selection-end-column="12" />
440
+        <state relative-caret-position="539">
441
+          <caret line="65" selection-start-line="65" selection-end-line="65" />
434 442
           <folding>
435 443
             <element signature="imports" expanded="true" />
436 444
           </folding>
437 445
         </state>
438 446
       </provider>
439 447
     </entry>
440
-    <entry file="file://$PROJECT_DIR$/src/main/java/Console.java">
448
+    <entry file="file://$PROJECT_DIR$/src/test/java/ServiceTest.java">
441 449
       <provider selected="true" editor-type-id="text-editor">
442
-        <state relative-caret-position="15">
443
-          <caret line="1" selection-start-line="1" selection-end-line="1" />
450
+        <state relative-caret-position="467">
451
+          <caret line="45" column="5" selection-start-line="45" selection-start-column="5" selection-end-line="45" selection-end-column="5" />
452
+          <folding>
453
+            <element signature="imports" expanded="true" />
454
+          </folding>
444 455
         </state>
445 456
       </provider>
446 457
     </entry>
447 458
     <entry file="file://$PROJECT_DIR$/src/main/java/MockDao.java">
448 459
       <provider selected="true" editor-type-id="text-editor">
449
-        <state relative-caret-position="172">
450
-          <caret line="94" column="58" lean-forward="true" selection-start-line="94" selection-start-column="58" selection-end-line="94" selection-end-column="58" />
460
+        <state relative-caret-position="225">
461
+          <caret line="15" column="55" lean-forward="true" selection-start-line="15" selection-start-column="55" selection-end-line="15" selection-end-column="55" />
451 462
           <folding>
452 463
             <element signature="imports" expanded="true" />
453
-            <element signature="e#1221#1222#0" expanded="true" />
454 464
             <element signature="e#1248#1249#0" expanded="true" />
455
-            <element signature="e#1292#1293#0" expanded="true" />
465
+            <element signature="e#1275#1276#0" expanded="true" />
456 466
             <element signature="e#1319#1320#0" expanded="true" />
457
-            <element signature="e#1363#1364#0" expanded="true" />
467
+            <element signature="e#1346#1347#0" expanded="true" />
458 468
             <element signature="e#1390#1391#0" expanded="true" />
459
-            <element signature="e#2616#2617#0" expanded="true" />
460
-            <element signature="e#2643#2644#0" expanded="true" />
461
-            <element signature="e#2691#2692#0" expanded="true" />
462
-            <element signature="e#2718#2719#0" expanded="true" />
463
-            <element signature="e#3019#3020#0" expanded="true" />
464
-            <element signature="e#3046#3047#0" expanded="true" />
465
-            <element signature="e#3133#3134#0" expanded="true" />
466
-            <element signature="e#3160#3161#0" expanded="true" />
467
-            <element signature="e#3946#3947#0" expanded="true" />
468
-            <element signature="e#3973#3974#0" expanded="true" />
469
-            <element signature="e#4200#4201#0" expanded="true" />
470
-            <element signature="e#4227#4228#0" expanded="true" />
471
-            <element signature="e#4263#4264#0" expanded="true" />
472
-            <element signature="e#4291#4292#0" expanded="true" />
473
-            <element signature="e#4846#4847#0" expanded="true" />
474
-            <element signature="e#4873#4874#0" expanded="true" />
475
-            <element signature="e#5184#5185#0" expanded="true" />
476
-            <element signature="e#5211#5212#0" expanded="true" />
477
-            <element signature="e#6136#6137#0" expanded="true" />
478
-            <element signature="e#6163#6164#0" expanded="true" />
479
-            <element signature="e#6409#6410#0" expanded="true" />
480
-            <element signature="e#6436#6437#0" expanded="true" />
481
-            <element signature="e#7103#7104#0" expanded="true" />
482
-            <element signature="e#7130#7131#0" expanded="true" />
469
+            <element signature="e#1417#1418#0" expanded="true" />
483 470
           </folding>
484 471
         </state>
485 472
       </provider>
486 473
     </entry>
487
-    <entry file="file://$PROJECT_DIR$/src/test/java/ServiceTest.java">
474
+    <entry file="file://$PROJECT_DIR$/src/main/java/Service.java">
488 475
       <provider selected="true" editor-type-id="text-editor">
489
-        <state relative-caret-position="458">
490
-          <caret line="48" lean-forward="true" selection-start-line="48" selection-end-line="48" />
476
+        <state relative-caret-position="134">
477
+          <caret line="11" column="30" lean-forward="true" selection-start-line="11" selection-start-column="30" selection-end-line="11" selection-end-column="30" />
491 478
           <folding>
492 479
             <element signature="imports" expanded="true" />
493 480
           </folding>
494 481
         </state>
495 482
       </provider>
496 483
     </entry>
497
-    <entry file="file://$PROJECT_DIR$/src/main/java/Service.java">
484
+    <entry file="file://$PROJECT_DIR$/src/main/java/Console.java">
485
+      <provider selected="true" editor-type-id="text-editor">
486
+        <state relative-caret-position="468">
487
+          <caret line="53" selection-start-line="53" selection-end-line="53" />
488
+        </state>
489
+      </provider>
490
+    </entry>
491
+    <entry file="file://$PROJECT_DIR$/src/main/java/AccountApp.java">
498 492
       <provider selected="true" editor-type-id="text-editor">
499
-        <state relative-caret-position="408">
500
-          <caret line="32" column="4" selection-start-line="32" selection-start-column="4" selection-end-line="32" selection-end-column="4" />
493
+        <state relative-caret-position="130">
494
+          <caret line="54" column="54" selection-start-line="54" selection-start-column="54" selection-end-line="54" selection-end-column="54" />
501 495
           <folding>
502 496
             <element signature="imports" expanded="true" />
503 497
           </folding>

+ 23
- 14
ormLab/src/main/java/AccountApp.java 查看文件

@@ -38,24 +38,33 @@ public class AccountApp {
38 38
      * Read and write some example data.
39 39
      */
40 40
     private void processData() throws Exception {
41
-
42
-        System.out.print("Welcome to the database");
41
+        Console console1 = new Console();
42
+        Service service1 = new Service(accountDao);
43 43
         boolean continueLoop = true;
44 44
 
45
+        System.out.println("Welcome to the database");
46
+
47
+
45 48
         //while loop to control user input
46 49
         while(continueLoop) {
47
-            Account account = new Account(name);
48
-
49
-            // persist the account object to the database
50
-            accountDao.create(account);
51
-            int id = account.getId();
52
-            System.out.println(id);
53
-            // assign a password
54
-            account.setPassword("_secret");
55
-            // update the database after changing the object
56
-            accountDao.update(account);
57
-            // delete the account
58
-            //accountDao.deleteById(id);
50
+            int userInput = console1.getIntegerInput(console1.printMenu());
51
+
52
+            switch (userInput) {
53
+                case 1: service1.create(new Account(console1.inputAccountName(), console1.inputPassword()));
54
+                        break;
55
+                case 2: service1.read(console1.getID());
56
+                        break;
57
+                case 3: service1.updateID(new Account(console1.inputAccountName(), console1.inputPassword()), console1.getID());
58
+                        break;
59
+                case 4: service1.delete(console1.getID());
60
+                        break;
61
+                case 5: continueLoop = false;
62
+                        break;
63
+
64
+            }
65
+
66
+
67
+
59 68
         }
60 69
     }
61 70
 

+ 53
- 0
ormLab/src/main/java/Console.java 查看文件

@@ -1,3 +1,56 @@
1
+import java.util.Scanner;
2
+
1 3
 public class Console {
2 4
 
5
+    private Scanner scanner = new Scanner(System.in);
6
+    private Account account1 = new Account();
7
+
8
+    public Console(){
9
+
10
+
11
+    }
12
+
13
+    public String printMenu(){
14
+        return ("Please select one of the following options:" + "\n"+
15
+                "1: Create new entry" + "\n" + "2: Print database entries" + "\n"+
16
+                "3: Update an entry" + "\n" + "4: Delete an entry" + "\n" + "5: Exit");
17
+
18
+
19
+    }
20
+
21
+    public int getID(){
22
+        int userInput1 = getIntegerInput("Please enter the ID number:");
23
+        return userInput1;
24
+    }
25
+
26
+    public String inputAccountName(){
27
+        String userInput1 = getStringInput("Please enter your name:");
28
+        return userInput1;
29
+    }
30
+
31
+    public String inputPassword(){
32
+        String userInput1 = getStringInput("Please enter your password:");
33
+        return userInput1;
34
+    }
35
+
36
+    public void print(String str){
37
+        System.out.println(str);
38
+    }
39
+
40
+
41
+    public  String getStringInput(String prompt) {
42
+        print(prompt);
43
+        String input = scanner.nextLine();
44
+        return input;
45
+    }
46
+
47
+    public  Double getDoubleInput(String prompt) {
48
+        return Double.parseDouble(getStringInput(prompt));
49
+    }
50
+
51
+    public Integer getIntegerInput(String prompt) {
52
+        return getDoubleInput(prompt).intValue();
53
+    }
54
+
55
+
3 56
 }

+ 2
- 1
ormLab/src/main/java/MockDao.java 查看文件

@@ -25,6 +25,7 @@ public class MockDao implements Dao<Account, Integer> {
25 25
     }
26 26
 
27 27
     public List queryForAll() throws SQLException {
28
+
28 29
         return null;
29 30
     }
30 31
 
@@ -77,7 +78,7 @@ public class MockDao implements Dao<Account, Integer> {
77 78
     }
78 79
 
79 80
     public int updateId(Account o, Integer o2) throws SQLException {
80
-        return 0;
81
+        return 666666;
81 82
     }
82 83
 
83 84
     public int update(PreparedUpdate preparedUpdate) throws SQLException {

+ 5
- 6
ormLab/src/main/java/Service.java 查看文件

@@ -17,18 +17,17 @@ public class Service{
17 17
        return  daoAccount.create(newAccount);
18 18
     }
19 19
 
20
-    public List<Account> read() throws Exception {
21
-
22
-        return daoAccount.queryForAll();
20
+    public Account read(Integer id) throws Exception {
21
+        return daoAccount.queryForId(id);
23 22
     }
24 23
 
25
-    public void updateID(Account newAccount, Integer id) throws Exception{
26
-        daoAccount.updateId(newAccount, id);
24
+    public int updateID(Account newAccount, Integer id) throws Exception{
25
+        return daoAccount.updateId(newAccount, id);
27 26
 
28 27
     }
29 28
 
30 29
     public int delete(Integer id) throws Exception{
31
-        daoAccount.deleteById(id);
30
+        return daoAccount.deleteById(id);
32 31
 
33 32
     }
34 33
 }

+ 9
- 2
ormLab/src/test/java/ServiceTest.java 查看文件

@@ -34,13 +34,20 @@ public class ServiceTest {
34 34
     }
35 35
 
36 36
     @Test
37
-    public void updateTest(){
37
+    public void updateTest() throws Exception{
38
+        Account account2 = new Account();
39
+        int expectedOutput = 666666;
40
+
41
+        int actualOutput = service1.updateID(account2, 2);
42
+
43
+        Assert.assertEquals(expectedOutput, actualOutput);
44
+
38 45
 
39 46
     }
40 47
 
41 48
     @Test
42 49
     public void deleteTest() throws Exception{
43
-        Account account = new Account();
50
+        Account account3 = new Account();
44 51
         int expectedOutput = 55555;
45 52
 
46 53
         int actualOutput = service1.delete(4);

二進制
ormLab/target/classes/AccountApp.class 查看文件


二進制
ormLab/target/classes/Console.class 查看文件


二進制
ormLab/target/classes/MockDao.class 查看文件


二進制
ormLab/target/classes/Service.class 查看文件


二進制
ormLab/target/test-classes/ServiceTest.class 查看文件