Procházet zdrojové kódy

Finished up to Part 7

Nathan Hall před 6 roky
rodič
revize
5ea9e40aa8

+ 249
- 211
.idea/workspace.xml Zobrazit soubor

@@ -2,22 +2,11 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="bb34a630-99d6-43f1-88af-777f3bc41c8e" name="Default Changelist" comment="">
5
-      <change afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
6
-      <change afterPath="$PROJECT_DIR$/.idea/encodings.xml" afterDir="false" />
7
-      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__junit_junit_4_12.xml" afterDir="false" />
8
-      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml" afterDir="false" />
9
-      <change afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
10
-      <change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
11
-      <change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
12
-      <change afterPath="$PROJECT_DIR$/interfaces-1.iml" afterDir="false" />
13
-      <change afterPath="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Instructor.java" afterDir="false" />
14
-      <change afterPath="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Learner.java" afterDir="false" />
15
-      <change afterPath="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Student.java" afterDir="false" />
16
-      <change afterPath="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Teacher.java" afterDir="false" />
17
-      <change afterPath="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/InstructorTest.java" afterDir="false" />
18
-      <change afterPath="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/StudentTest.java" afterDir="false" />
19
-      <change beforePath="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Person.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Person.java" afterDir="false" />
20
-      <change beforePath="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestPerson.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestPerson.java" afterDir="false" />
5
+      <change afterPath="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/People.java" afterDir="false" />
6
+      <change afterPath="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/PeopleTest.java" afterDir="false" />
7
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
8
+      <change beforePath="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Instructor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Instructor.java" afterDir="false" />
9
+      <change beforePath="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/InstructorTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/InstructorTest.java" afterDir="false" />
21 10
     </list>
22 11
     <ignored path="$PROJECT_DIR$/target/" />
23 12
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -30,133 +19,144 @@
30 19
     <session id="1702614893">
31 20
       <usages-collector id="statistics.lifecycle.project">
32 21
         <counts>
33
-          <entry key="project.open.time.2" value="1" />
34
-          <entry key="project.opened" value="1" />
22
+          <entry key="project.closed" value="2" />
23
+          <entry key="project.open.time.17" value="1" />
24
+          <entry key="project.open.time.2" value="2" />
25
+          <entry key="project.opened" value="3" />
35 26
         </counts>
36 27
       </usages-collector>
37 28
       <usages-collector id="statistics.file.extensions.open">
38 29
         <counts>
39
-          <entry key="java" value="10" />
30
+          <entry key="java" value="18" />
40 31
         </counts>
41 32
       </usages-collector>
42 33
       <usages-collector id="statistics.file.types.open">
43 34
         <counts>
44
-          <entry key="JAVA" value="10" />
35
+          <entry key="JAVA" value="18" />
45 36
         </counts>
46 37
       </usages-collector>
47 38
       <usages-collector id="statistics.file.extensions.edit">
48 39
         <counts>
49
-          <entry key="java" value="1602" />
40
+          <entry key="java" value="3334" />
50 41
         </counts>
51 42
       </usages-collector>
52 43
       <usages-collector id="statistics.file.types.edit">
53 44
         <counts>
54
-          <entry key="JAVA" value="1602" />
45
+          <entry key="JAVA" value="3334" />
55 46
         </counts>
56 47
       </usages-collector>
57 48
     </session>
58 49
   </component>
59 50
   <component name="FileEditorManager">
60
-    <leaf>
61
-      <file pinned="false" current-in-tab="false">
62
-        <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Person.java">
63
-          <provider selected="true" editor-type-id="text-editor">
64
-            <state relative-caret-position="75">
65
-              <caret line="5" column="18" selection-start-line="5" selection-start-column="18" selection-end-line="5" selection-end-column="18" />
66
-              <folding>
67
-                <element signature="e#103#104#0" expanded="true" />
68
-                <element signature="e#133#134#0" expanded="true" />
69
-                <element signature="e#164#165#0" expanded="true" />
70
-                <element signature="e#185#186#0" expanded="true" />
71
-                <element signature="e#261#262#0" expanded="true" />
72
-                <element signature="e#293#294#0" expanded="true" />
73
-              </folding>
74
-            </state>
75
-          </provider>
76
-        </entry>
77
-      </file>
78
-      <file pinned="false" current-in-tab="false">
79
-        <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Learner.java">
80
-          <provider selected="true" editor-type-id="text-editor">
81
-            <state relative-caret-position="105">
82
-              <caret line="7" lean-forward="true" selection-start-line="7" selection-end-line="7" />
83
-            </state>
84
-          </provider>
85
-        </entry>
86
-      </file>
87
-      <file pinned="false" current-in-tab="false">
88
-        <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Student.java">
89
-          <provider selected="true" editor-type-id="text-editor">
90
-            <state relative-caret-position="165">
91
-              <caret line="11" column="39" selection-start-line="11" selection-start-column="39" selection-end-line="11" selection-end-column="39" />
92
-              <folding>
93
-                <element signature="e#300#301#0" expanded="true" />
94
-              </folding>
95
-            </state>
96
-          </provider>
97
-        </entry>
98
-      </file>
99
-      <file pinned="false" current-in-tab="false">
100
-        <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Teacher.java">
101
-          <provider selected="true" editor-type-id="text-editor">
102
-            <state relative-caret-position="90">
103
-              <caret line="6" column="66" selection-start-line="6" selection-start-column="66" selection-end-line="6" selection-end-column="66" />
104
-            </state>
105
-          </provider>
106
-        </entry>
107
-      </file>
108
-      <file pinned="false" current-in-tab="true">
109
-        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/InstructorTest.java">
110
-          <provider selected="true" editor-type-id="text-editor">
111
-            <state relative-caret-position="180">
112
-              <caret line="12" column="8" selection-start-line="12" selection-start-column="8" selection-end-line="12" selection-end-column="8" />
113
-              <folding>
114
-                <element signature="imports" expanded="true" />
115
-              </folding>
116
-            </state>
117
-          </provider>
118
-        </entry>
119
-      </file>
120
-      <file pinned="false" current-in-tab="false">
121
-        <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Instructor.java">
122
-          <provider selected="true" editor-type-id="text-editor">
123
-            <state relative-caret-position="60">
124
-              <caret line="4" selection-start-line="4" selection-end-line="4" />
125
-            </state>
126
-          </provider>
127
-        </entry>
128
-      </file>
129
-      <file pinned="false" current-in-tab="false">
130
-        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/StudentTest.java">
131
-          <provider selected="true" editor-type-id="text-editor">
132
-            <state relative-caret-position="240">
133
-              <caret line="16" column="62" lean-forward="true" selection-start-line="14" selection-start-column="8" selection-end-line="16" selection-end-column="62" />
134
-              <folding>
135
-                <element signature="imports" expanded="true" />
136
-              </folding>
137
-            </state>
138
-          </provider>
139
-        </entry>
140
-      </file>
141
-      <file pinned="false" current-in-tab="false">
142
-        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestPerson.java">
143
-          <provider selected="true" editor-type-id="text-editor">
144
-            <state relative-caret-position="30">
145
-              <caret line="2" lean-forward="true" selection-start-line="2" selection-end-line="3" selection-end-column="24" />
146
-              <folding>
147
-                <element signature="imports" expanded="true" />
148
-              </folding>
149
-            </state>
150
-          </provider>
151
-        </entry>
152
-      </file>
153
-    </leaf>
51
+    <splitter split-orientation="horizontal" split-proportion="0.4901375">
52
+      <split-first>
53
+        <splitter split-orientation="horizontal" split-proportion="0.25885227">
54
+          <split-first>
55
+            <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
56
+              <file pinned="false" current-in-tab="true">
57
+                <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Person.java">
58
+                  <provider selected="true" editor-type-id="text-editor">
59
+                    <state relative-caret-position="150">
60
+                      <caret line="12" selection-start-line="12" selection-end-line="15" />
61
+                    </state>
62
+                  </provider>
63
+                </entry>
64
+              </file>
65
+            </leaf>
66
+          </split-first>
67
+          <split-second>
68
+            <leaf>
69
+              <file pinned="false" current-in-tab="true">
70
+                <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/People.java">
71
+                  <provider selected="true" editor-type-id="text-editor">
72
+                    <state relative-caret-position="255">
73
+                      <caret line="19" column="9" selection-start-line="19" selection-start-column="9" selection-end-line="19" selection-end-column="9" />
74
+                      <folding>
75
+                        <element signature="imports" expanded="true" />
76
+                        <element signature="e#571#572#0" expanded="true" />
77
+                        <element signature="e#612#613#0" expanded="true" />
78
+                        <element signature="e#646#647#0" expanded="true" />
79
+                        <element signature="e#693#694#0" expanded="true" />
80
+                        <element signature="e#749#750#0" expanded="true" />
81
+                        <element signature="e#789#790#0" expanded="true" />
82
+                        <element signature="e#821#822#0" expanded="true" />
83
+                        <element signature="e#874#875#0" expanded="true" />
84
+                        <element signature="e#904#905#0" expanded="true" />
85
+                        <element signature="e#952#953#0" expanded="true" />
86
+                      </folding>
87
+                    </state>
88
+                  </provider>
89
+                </entry>
90
+              </file>
91
+            </leaf>
92
+          </split-second>
93
+        </splitter>
94
+      </split-first>
95
+      <split-second>
96
+        <splitter split-orientation="horizontal" split-proportion="0.5">
97
+          <split-first>
98
+            <leaf>
99
+              <file pinned="false" current-in-tab="false">
100
+                <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/InstructorTest.java">
101
+                  <provider selected="true" editor-type-id="text-editor">
102
+                    <state relative-caret-position="252">
103
+                      <caret line="56" column="29" selection-start-line="56" selection-start-column="29" selection-end-line="56" selection-end-column="29" />
104
+                      <folding>
105
+                        <element signature="imports" expanded="true" />
106
+                      </folding>
107
+                    </state>
108
+                  </provider>
109
+                </entry>
110
+              </file>
111
+              <file pinned="false" current-in-tab="false">
112
+                <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/StudentTest.java">
113
+                  <provider selected="true" editor-type-id="text-editor">
114
+                    <state relative-caret-position="210">
115
+                      <caret line="16" column="62" selection-start-line="14" selection-start-column="8" selection-end-line="16" selection-end-column="62" />
116
+                      <folding>
117
+                        <element signature="imports" expanded="true" />
118
+                      </folding>
119
+                    </state>
120
+                  </provider>
121
+                </entry>
122
+              </file>
123
+              <file pinned="false" current-in-tab="true">
124
+                <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/PeopleTest.java">
125
+                  <provider selected="true" editor-type-id="text-editor">
126
+                    <state relative-caret-position="233">
127
+                      <caret line="47" column="27" selection-start-line="47" selection-start-column="27" selection-end-line="47" selection-end-column="27" />
128
+                    </state>
129
+                  </provider>
130
+                </entry>
131
+              </file>
132
+            </leaf>
133
+          </split-first>
134
+          <split-second>
135
+            <leaf>
136
+              <file pinned="false" current-in-tab="true">
137
+                <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/StudentTest.java">
138
+                  <provider selected="true" editor-type-id="text-editor">
139
+                    <state relative-caret-position="240">
140
+                      <caret line="16" column="62" selection-start-line="14" selection-start-column="8" selection-end-line="16" selection-end-column="62" />
141
+                      <folding>
142
+                        <element signature="imports" expanded="true" />
143
+                      </folding>
144
+                    </state>
145
+                  </provider>
146
+                </entry>
147
+              </file>
148
+            </leaf>
149
+          </split-second>
150
+        </splitter>
151
+      </split-second>
152
+    </splitter>
154 153
   </component>
155 154
   <component name="FileTemplateManagerImpl">
156 155
     <option name="RECENT_TEMPLATES">
157 156
       <list>
158 157
         <option value="Interface" />
159 158
         <option value="Class" />
159
+        <option value="JUnit4 Test Class" />
160 160
       </list>
161 161
     </option>
162 162
   </component>
@@ -175,6 +175,8 @@
175 175
         <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Instructor.java" />
176 176
         <option value="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Instructor.java" />
177 177
         <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/InstructorTest.java" />
178
+        <option value="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/People.java" />
179
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/PeopleTest.java" />
178 180
       </list>
179 181
     </option>
180 182
   </component>
@@ -191,10 +193,11 @@
191 193
       </MavenImportingSettings>
192 194
     </option>
193 195
   </component>
194
-  <component name="ProjectFrameBounds" extendedState="1">
195
-    <option name="y" value="30" />
196
-    <option name="width" value="1280" />
197
-    <option name="height" value="731" />
196
+  <component name="ProjectFrameBounds">
197
+    <option name="x" value="-332" />
198
+    <option name="y" value="-968" />
199
+    <option name="width" value="1837" />
200
+    <option name="height" value="906" />
198 201
   </component>
199 202
   <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
200 203
   <component name="ProjectView">
@@ -203,7 +206,6 @@
203 206
     </navigator>
204 207
     <panes>
205 208
       <pane id="Scope" />
206
-      <pane id="PackagesPane" />
207 209
       <pane id="ProjectPane">
208 210
         <subPane>
209 211
           <expand>
@@ -262,17 +264,26 @@
262 264
           <select />
263 265
         </subPane>
264 266
       </pane>
267
+      <pane id="PackagesPane" />
265 268
     </panes>
266 269
   </component>
267 270
   <component name="PropertiesComponent">
268 271
     <property name="WebServerToolWindowFactoryState" value="false" />
269 272
     <property name="aspect.path.notification.shown" value="true" />
270
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1541930178148" />
273
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542222694583" />
274
+    <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
275
+    <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrarySuperClass.JUnit4" value="" />
271 276
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
272 277
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
273 278
     <property name="nodejs_npm_path_reset_for_default_project" value="true" />
274 279
   </component>
275 280
   <component name="RecentsManager">
281
+    <key name="CreateTestDialog.RecentsKey">
282
+      <recent name="io.zipcoder.interfaces" />
283
+    </key>
284
+    <key name="CreateTestDialog.Recents.Supers">
285
+      <recent name="" />
286
+    </key>
276 287
     <key name="CreateClassDialog.RecentsKey">
277 288
       <recent name="io.zipcoder.interfaces" />
278 289
     </key>
@@ -289,8 +300,8 @@
289 300
       </list>
290 301
     </option>
291 302
   </component>
292
-  <component name="RunManager" selected="JUnit.StudentTest.testLearn">
293
-    <configuration name="StudentTest.testImplementation" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
303
+  <component name="RunManager" selected="JUnit.PeopleTest.removeTest2">
304
+    <configuration name="InstructorTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
294 305
       <module name="interfaces-1" />
295 306
       <extension name="coverage">
296 307
         <pattern>
@@ -299,14 +310,12 @@
299 310
         </pattern>
300 311
       </extension>
301 312
       <option name="PACKAGE_NAME" value="io.zipcoder.interfaces" />
302
-      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.StudentTest" />
303
-      <option name="METHOD_NAME" value="testImplementation" />
304
-      <option name="TEST_OBJECT" value="method" />
313
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.InstructorTest" />
305 314
       <method v="2">
306 315
         <option name="Make" enabled="true" />
307 316
       </method>
308 317
     </configuration>
309
-    <configuration name="StudentTest.testInheritance" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
318
+    <configuration name="PeopleTest.addTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
310 319
       <module name="interfaces-1" />
311 320
       <extension name="coverage">
312 321
         <pattern>
@@ -315,14 +324,14 @@
315 324
         </pattern>
316 325
       </extension>
317 326
       <option name="PACKAGE_NAME" value="io.zipcoder.interfaces" />
318
-      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.StudentTest" />
319
-      <option name="METHOD_NAME" value="testInheritance" />
327
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.PeopleTest" />
328
+      <option name="METHOD_NAME" value="addTest" />
320 329
       <option name="TEST_OBJECT" value="method" />
321 330
       <method v="2">
322 331
         <option name="Make" enabled="true" />
323 332
       </method>
324 333
     </configuration>
325
-    <configuration name="StudentTest.testLearn" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
334
+    <configuration name="PeopleTest.findByIdTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
326 335
       <module name="interfaces-1" />
327 336
       <extension name="coverage">
328 337
         <pattern>
@@ -331,14 +340,14 @@
331 340
         </pattern>
332 341
       </extension>
333 342
       <option name="PACKAGE_NAME" value="io.zipcoder.interfaces" />
334
-      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.StudentTest" />
335
-      <option name="METHOD_NAME" value="testLearn" />
343
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.PeopleTest" />
344
+      <option name="METHOD_NAME" value="findByIdTest" />
336 345
       <option name="TEST_OBJECT" value="method" />
337 346
       <method v="2">
338 347
         <option name="Make" enabled="true" />
339 348
       </method>
340 349
     </configuration>
341
-    <configuration name="TestPerson" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
350
+    <configuration name="PeopleTest.removeTest2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
342 351
       <module name="interfaces-1" />
343 352
       <extension name="coverage">
344 353
         <pattern>
@@ -347,12 +356,14 @@
347 356
         </pattern>
348 357
       </extension>
349 358
       <option name="PACKAGE_NAME" value="io.zipcoder.interfaces" />
350
-      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.TestPerson" />
359
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.PeopleTest" />
360
+      <option name="METHOD_NAME" value="removeTest2" />
361
+      <option name="TEST_OBJECT" value="method" />
351 362
       <method v="2">
352 363
         <option name="Make" enabled="true" />
353 364
       </method>
354 365
     </configuration>
355
-    <configuration name="TestPerson.testSetAndGetName" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
366
+    <configuration name="PeopleTest.removeTestByPerson" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
356 367
       <module name="interfaces-1" />
357 368
       <extension name="coverage">
358 369
         <pattern>
@@ -361,27 +372,27 @@
361 372
         </pattern>
362 373
       </extension>
363 374
       <option name="PACKAGE_NAME" value="io.zipcoder.interfaces" />
364
-      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.TestPerson" />
365
-      <option name="METHOD_NAME" value="testSetAndGetName" />
375
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.PeopleTest" />
376
+      <option name="METHOD_NAME" value="removeTestByPerson" />
366 377
       <option name="TEST_OBJECT" value="method" />
367 378
       <method v="2">
368 379
         <option name="Make" enabled="true" />
369 380
       </method>
370 381
     </configuration>
371 382
     <list>
372
-      <item itemvalue="JUnit.TestPerson" />
373
-      <item itemvalue="JUnit.TestPerson.testSetAndGetName" />
374
-      <item itemvalue="JUnit.StudentTest.testImplementation" />
375
-      <item itemvalue="JUnit.StudentTest.testInheritance" />
376
-      <item itemvalue="JUnit.StudentTest.testLearn" />
383
+      <item itemvalue="JUnit.InstructorTest" />
384
+      <item itemvalue="JUnit.PeopleTest.addTest" />
385
+      <item itemvalue="JUnit.PeopleTest.findByIdTest" />
386
+      <item itemvalue="JUnit.PeopleTest.removeTestByPerson" />
387
+      <item itemvalue="JUnit.PeopleTest.removeTest2" />
377 388
     </list>
378 389
     <recent_temporary>
379 390
       <list>
380
-        <item itemvalue="JUnit.StudentTest.testLearn" />
381
-        <item itemvalue="JUnit.StudentTest.testInheritance" />
382
-        <item itemvalue="JUnit.StudentTest.testImplementation" />
383
-        <item itemvalue="JUnit.TestPerson.testSetAndGetName" />
384
-        <item itemvalue="JUnit.TestPerson" />
391
+        <item itemvalue="JUnit.PeopleTest.removeTest2" />
392
+        <item itemvalue="JUnit.PeopleTest.removeTestByPerson" />
393
+        <item itemvalue="JUnit.PeopleTest.findByIdTest" />
394
+        <item itemvalue="JUnit.PeopleTest.addTest" />
395
+        <item itemvalue="JUnit.InstructorTest" />
385 396
       </list>
386 397
     </recent_temporary>
387 398
   </component>
@@ -395,65 +406,79 @@
395 406
       <option name="number" value="Default" />
396 407
       <option name="presentableId" value="Default" />
397 408
       <updated>1541925109764</updated>
398
-      <workItem from="1541925113078" duration="4977000" />
409
+      <workItem from="1541925113078" duration="5099000" />
410
+      <workItem from="1541965822791" duration="598000" />
411
+      <workItem from="1542139054328" duration="10800000" />
399 412
     </task>
400 413
     <servers />
401 414
   </component>
402 415
   <component name="TestHistory">
403
-    <history-entry file="TestPerson - 2018.11.11 at 03h 39m 46s.xml">
404
-      <configuration name="TestPerson" configurationId="JUnit" />
416
+    <history-entry file="PeopleTest_addTest - 2018.11.14 at 13h 44m 37s.xml">
417
+      <configuration name="PeopleTest.addTest" configurationId="JUnit" />
418
+    </history-entry>
419
+    <history-entry file="PeopleTest_findByIdTest - 2018.11.14 at 13h 48m 10s.xml">
420
+      <configuration name="PeopleTest.findByIdTest" configurationId="JUnit" />
421
+    </history-entry>
422
+    <history-entry file="PeopleTest_findByIdTest - 2018.11.14 at 13h 52m 03s.xml">
423
+      <configuration name="PeopleTest.findByIdTest" configurationId="JUnit" />
424
+    </history-entry>
425
+    <history-entry file="PeopleTest_findByIdTest - 2018.11.14 at 13h 54m 02s.xml">
426
+      <configuration name="PeopleTest.findByIdTest" configurationId="JUnit" />
405 427
     </history-entry>
406
-    <history-entry file="TestPerson_testSetAndGetName - 2018.11.11 at 03h 46m 43s.xml">
407
-      <configuration name="TestPerson.testSetAndGetName" configurationId="JUnit" />
428
+    <history-entry file="PeopleTest_findByIdTest - 2018.11.14 at 13h 55m 05s.xml">
429
+      <configuration name="PeopleTest.findByIdTest" configurationId="JUnit" />
408 430
     </history-entry>
409
-    <history-entry file="StudentTest_testImplementation - 2018.11.11 at 04h 04m 46s.xml">
410
-      <configuration name="StudentTest.testImplementation" configurationId="JUnit" />
431
+    <history-entry file="PeopleTest_findByIdTest - 2018.11.14 at 13h 59m 24s.xml">
432
+      <configuration name="PeopleTest.findByIdTest" configurationId="JUnit" />
411 433
     </history-entry>
412
-    <history-entry file="StudentTest_testInheritance - 2018.11.11 at 04h 25m 19s.xml">
413
-      <configuration name="StudentTest.testInheritance" configurationId="JUnit" />
434
+    <history-entry file="PeopleTest_addTest - 2018.11.14 at 14h 03m 47s.xml">
435
+      <configuration name="PeopleTest.addTest" configurationId="JUnit" />
414 436
     </history-entry>
415
-    <history-entry file="StudentTest_testLearn - 2018.11.11 at 04h 40m 17s.xml">
416
-      <configuration name="StudentTest.testLearn" configurationId="JUnit" />
437
+    <history-entry file="PeopleTest_findByIdTest - 2018.11.14 at 14h 05m 48s.xml">
438
+      <configuration name="PeopleTest.findByIdTest" configurationId="JUnit" />
417 439
     </history-entry>
418
-    <history-entry file="StudentTest_testLearn - 2018.11.11 at 04h 41m 43s.xml">
419
-      <configuration name="StudentTest.testLearn" configurationId="JUnit" />
440
+    <history-entry file="PeopleTest_removeTestByPerson - 2018.11.14 at 14h 10m 44s.xml">
441
+      <configuration name="PeopleTest.removeTestByPerson" configurationId="JUnit" />
442
+    </history-entry>
443
+    <history-entry file="PeopleTest_removeTest2 - 2018.11.14 at 14h 11m 36s.xml">
444
+      <configuration name="PeopleTest.removeTest2" configurationId="JUnit" />
420 445
     </history-entry>
421 446
   </component>
422 447
   <component name="TimeTrackingManager">
423
-    <option name="totallyTimeSpent" value="4977000" />
448
+    <option name="totallyTimeSpent" value="16497000" />
424 449
   </component>
425 450
   <component name="ToolWindowManager">
426
-    <frame x="0" y="30" width="1280" height="731" extended-state="6" />
451
+    <frame x="-332" y="-968" width="1837" height="906" extended-state="0" />
427 452
     <editor active="true" />
428 453
     <layout>
429
-      <window_info id="Image Layers" />
430
-      <window_info id="Designer" />
431
-      <window_info id="UI Designer" />
432
-      <window_info id="Capture Tool" />
433
-      <window_info id="Favorites" side_tool="true" />
434
-      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24959612" />
454
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.06796657" />
435 455
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
436
-      <window_info anchor="bottom" id="Messages" weight="0.32954547" />
437
-      <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
438
-      <window_info anchor="bottom" id="Version Control" show_stripe_button="false" />
439
-      <window_info anchor="bottom" id="Terminal" />
440
-      <window_info anchor="bottom" id="Event Log" side_tool="true" />
456
+      <window_info id="Image Layers" order="2" />
457
+      <window_info id="Designer" order="3" />
458
+      <window_info id="UI Designer" order="4" />
459
+      <window_info id="Capture Tool" order="5" />
460
+      <window_info id="Favorites" order="6" side_tool="true" />
441 461
       <window_info anchor="bottom" id="Message" order="0" />
442 462
       <window_info anchor="bottom" id="Find" order="1" />
443
-      <window_info anchor="bottom" id="Run" order="2" weight="0.32954547" />
463
+      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.38053098" />
444 464
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
445 465
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
446 466
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
447 467
       <window_info anchor="bottom" id="TODO" order="6" />
448
-      <window_info anchor="right" id="Palette" />
449
-      <window_info anchor="right" id="Theme Preview" />
450
-      <window_info anchor="right" id="Capture Analysis" />
451
-      <window_info anchor="right" id="Palette&#9;" />
452
-      <window_info anchor="right" id="Database" />
453
-      <window_info anchor="right" id="Maven Projects" />
468
+      <window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" />
469
+      <window_info anchor="bottom" id="Database Changes" order="8" show_stripe_button="false" />
470
+      <window_info anchor="bottom" id="Terminal" order="9" weight="0.11419249" />
471
+      <window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
472
+      <window_info anchor="bottom" id="Messages" order="11" weight="0.32743362" />
454 473
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
455 474
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
456 475
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
476
+      <window_info anchor="right" id="Palette" order="3" />
477
+      <window_info anchor="right" id="Capture Analysis" order="4" />
478
+      <window_info anchor="right" id="Database" order="5" />
479
+      <window_info anchor="right" id="Theme Preview" order="6" />
480
+      <window_info anchor="right" id="Palette&#9;" order="7" />
481
+      <window_info anchor="right" id="Maven Projects" order="8" />
457 482
     </layout>
458 483
     <layout-to-restore>
459 484
       <window_info id="Image Layers" order="0" />
@@ -493,42 +518,35 @@
493 518
     <option name="myLimit" value="2678400000" />
494 519
   </component>
495 520
   <component name="editorHistoryManager">
521
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Instructor.java" />
496 522
     <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestPerson.java">
497 523
       <provider selected="true" editor-type-id="text-editor">
498 524
         <state relative-caret-position="30">
499
-          <caret line="2" lean-forward="true" selection-start-line="2" selection-end-line="3" selection-end-column="24" />
525
+          <caret line="2" selection-start-line="2" selection-end-line="3" selection-end-column="24" />
500 526
           <folding>
501 527
             <element signature="imports" expanded="true" />
502 528
           </folding>
503 529
         </state>
504 530
       </provider>
505 531
     </entry>
506
-    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Person.java">
532
+    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Instructor.java">
507 533
       <provider selected="true" editor-type-id="text-editor">
508
-        <state relative-caret-position="75">
509
-          <caret line="5" column="18" selection-start-line="5" selection-start-column="18" selection-end-line="5" selection-end-column="18" />
510
-          <folding>
511
-            <element signature="e#103#104#0" expanded="true" />
512
-            <element signature="e#133#134#0" expanded="true" />
513
-            <element signature="e#164#165#0" expanded="true" />
514
-            <element signature="e#185#186#0" expanded="true" />
515
-            <element signature="e#261#262#0" expanded="true" />
516
-            <element signature="e#293#294#0" expanded="true" />
517
-          </folding>
534
+        <state relative-caret-position="240">
535
+          <caret line="16" column="5" lean-forward="true" selection-start-line="16" selection-start-column="5" selection-end-line="16" selection-end-column="5" />
518 536
         </state>
519 537
       </provider>
520 538
     </entry>
521
-    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Learner.java">
539
+    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Teacher.java">
522 540
       <provider selected="true" editor-type-id="text-editor">
523
-        <state relative-caret-position="105">
524
-          <caret line="7" lean-forward="true" selection-start-line="7" selection-end-line="7" />
541
+        <state relative-caret-position="90">
542
+          <caret line="6" column="66" selection-start-line="6" selection-start-column="66" selection-end-line="6" selection-end-column="66" />
525 543
         </state>
526 544
       </provider>
527 545
     </entry>
528
-    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Instructor.java">
546
+    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Learner.java">
529 547
       <provider selected="true" editor-type-id="text-editor">
530
-        <state relative-caret-position="15">
531
-          <caret line="1" lean-forward="true" selection-start-line="1" selection-end-line="1" />
548
+        <state relative-caret-position="105">
549
+          <caret line="7" selection-start-line="7" selection-end-line="7" />
532 550
         </state>
533 551
       </provider>
534 552
     </entry>
@@ -542,39 +560,59 @@
542 560
         </state>
543 561
       </provider>
544 562
     </entry>
545
-    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/StudentTest.java">
563
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/InstructorTest.java">
546 564
       <provider selected="true" editor-type-id="text-editor">
547
-        <state relative-caret-position="240">
548
-          <caret line="16" column="62" lean-forward="true" selection-start-line="14" selection-start-column="8" selection-end-line="16" selection-end-column="62" />
565
+        <state relative-caret-position="252">
566
+          <caret line="56" column="29" selection-start-line="56" selection-start-column="29" selection-end-line="56" selection-end-column="29" />
549 567
           <folding>
550 568
             <element signature="imports" expanded="true" />
551 569
           </folding>
552 570
         </state>
553 571
       </provider>
554 572
     </entry>
555
-    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Teacher.java">
573
+    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Person.java">
556 574
       <provider selected="true" editor-type-id="text-editor">
557
-        <state relative-caret-position="90">
558
-          <caret line="6" column="66" selection-start-line="6" selection-start-column="66" selection-end-line="6" selection-end-column="66" />
575
+        <state relative-caret-position="150">
576
+          <caret line="12" selection-start-line="12" selection-end-line="15" />
559 577
         </state>
560 578
       </provider>
561 579
     </entry>
562
-    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Instructor.java">
580
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/StudentTest.java">
563 581
       <provider selected="true" editor-type-id="text-editor">
564
-        <state relative-caret-position="60">
565
-          <caret line="4" selection-start-line="4" selection-end-line="4" />
582
+        <state relative-caret-position="210">
583
+          <caret line="16" column="62" selection-start-line="14" selection-start-column="8" selection-end-line="16" selection-end-column="62" />
584
+          <folding>
585
+            <element signature="imports" expanded="true" />
586
+          </folding>
566 587
         </state>
567 588
       </provider>
568 589
     </entry>
569
-    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/InstructorTest.java">
590
+    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/People.java">
570 591
       <provider selected="true" editor-type-id="text-editor">
571
-        <state relative-caret-position="180">
572
-          <caret line="12" column="8" selection-start-line="12" selection-start-column="8" selection-end-line="12" selection-end-column="8" />
592
+        <state relative-caret-position="255">
593
+          <caret line="19" column="9" selection-start-line="19" selection-start-column="9" selection-end-line="19" selection-end-column="9" />
573 594
           <folding>
574 595
             <element signature="imports" expanded="true" />
596
+            <element signature="e#571#572#0" expanded="true" />
597
+            <element signature="e#612#613#0" expanded="true" />
598
+            <element signature="e#646#647#0" expanded="true" />
599
+            <element signature="e#693#694#0" expanded="true" />
600
+            <element signature="e#749#750#0" expanded="true" />
601
+            <element signature="e#789#790#0" expanded="true" />
602
+            <element signature="e#821#822#0" expanded="true" />
603
+            <element signature="e#874#875#0" expanded="true" />
604
+            <element signature="e#904#905#0" expanded="true" />
605
+            <element signature="e#952#953#0" expanded="true" />
575 606
           </folding>
576 607
         </state>
577 608
       </provider>
578 609
     </entry>
610
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/PeopleTest.java">
611
+      <provider selected="true" editor-type-id="text-editor">
612
+        <state relative-caret-position="233">
613
+          <caret line="47" column="27" selection-start-line="47" selection-start-column="27" selection-end-line="47" selection-end-column="27" />
614
+        </state>
615
+      </provider>
616
+    </entry>
579 617
   </component>
580 618
 </project>

+ 8
- 1
src/main/java/io/zipcoder/interfaces/Instructor.java Zobrazit soubor

@@ -1,11 +1,18 @@
1 1
 package io.zipcoder.interfaces;
2 2
 
3
-public class Instructor implements Teacher {
3
+public class Instructor extends Person implements Teacher {
4 4
     public void teach(Learner learner, double numberOfHours) {
5 5
 
6
+        learner.learn(numberOfHours);
7
+
6 8
     }
7 9
 
8 10
     public void lecture(Learner[] learners, double numberOfHours) {
9 11
 
12
+        double numberOfHoursPerLearner = numberOfHours / learners.length;
13
+
14
+        for (int i = 0; i < learners.length; i++) {
15
+            teach(learners[i], numberOfHoursPerLearner);
16
+        }
10 17
     }
11 18
 }

+ 44
- 0
src/main/java/io/zipcoder/interfaces/People.java Zobrazit soubor

@@ -0,0 +1,44 @@
1
+package io.zipcoder.interfaces;
2
+
3
+import java.lang.reflect.Array;
4
+import java.util.ArrayList;
5
+
6
+public class People {
7
+
8
+    ArrayList<Person> personList = new ArrayList<Person>();
9
+
10
+    public void add(Person person) {
11
+        personList.add(person);
12
+    }
13
+
14
+    public Person findById(long id) {
15
+
16
+        for (Person p : personList){
17
+            if ( p.getId() == id){
18
+                return p;
19
+            }
20
+        }
21
+        return null;
22
+    }
23
+
24
+    public void remove(Person person){
25
+        personList.remove(person);
26
+    }
27
+
28
+    public void remove(long id){
29
+        personList.remove(findById(id));
30
+    }
31
+
32
+    public int getCount(ArrayList<Person> personList){
33
+        return personList.size();
34
+    }
35
+
36
+    public Array[] getArray(){
37
+        return (Array[]) personList.toArray();
38
+    }
39
+
40
+    public void removeAll(){
41
+        personList.removeAll(personList);
42
+    }
43
+
44
+}

+ 51
- 5
src/test/java/io/zipcoder/interfaces/InstructorTest.java Zobrazit soubor

@@ -5,14 +5,60 @@ import org.junit.Test;
5 5
 import org.junit.Assert;
6 6
 import sun.jvm.hotspot.oops.Instance;
7 7
 
8
-public class InstructorTest implements Teacher {
8
+public class InstructorTest {
9 9
 
10
-    public void testImplementation(){
11
-        Teacher teacher = new Instructor();
10
+    @Test
11
+    public void testImplementation() {
12
+        Instructor instructor = new Instructor();
12 13
 
13
-        
14
+        boolean expected = true;
15
+        boolean actual = (instructor instanceof Teacher);
14 16
 
15
-        Assert.assertEquals(true, Instructor instanceof teacher);
17
+
18
+        Assert.assertEquals(true, actual);
19
+    }
20
+
21
+    @Test
22
+    public void testInheritance() {
23
+        Instructor instructor = new Instructor();
24
+        Person person = new Person();
25
+
26
+        boolean expected = true;
27
+        boolean actual = (instructor instanceof Person);
28
+
29
+
30
+        Assert.assertEquals(true, actual);
31
+    }
32
+
33
+    @Test
34
+    public void testTeach() {
35
+        Instructor instructor = new Instructor();
36
+        Student student = new Student();
37
+
38
+        double numHours = 5;
39
+        instructor.teach(student, numHours);
40
+
41
+        double expected = 10;
42
+        double actual = student.totalStudyTime;
43
+
44
+
45
+        Assert.assertEquals(expected, actual, .001);
46
+    }
47
+
48
+    @Test
49
+    public void testLecture() {
50
+        Instructor instructor = new Instructor();
51
+        Student student = new Student();
52
+        Student student2 = new Student();
53
+        Learner[] learners = { student, student2 };
54
+
55
+        instructor.lecture(learners, 100);
56
+
57
+        double expected = 55;
58
+        double actual = student.totalStudyTime;
59
+
60
+
61
+        Assert.assertEquals(expected, actual, .001);
16 62
     }
17 63
 
18 64
 

+ 56
- 0
src/test/java/io/zipcoder/interfaces/PeopleTest.java Zobrazit soubor

@@ -0,0 +1,56 @@
1
+package io.zipcoder.interfaces;
2
+
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
6
+import java.util.ArrayList;
7
+
8
+import static org.junit.Assert.*;
9
+
10
+public class PeopleTest {
11
+    ArrayList<Person> persons = new ArrayList();
12
+    Person person = new Person();
13
+    People people = new People();
14
+
15
+
16
+    @Test
17
+    public void addTest() {
18
+        persons.add(person);
19
+
20
+        int expected = 1;
21
+
22
+        Assert.assertEquals(expected, persons.size());
23
+    }
24
+
25
+    @Test
26
+    public void findByIdTest() {
27
+        people.add(person);
28
+
29
+        Person expected = person;
30
+        Person actual = people.findById(person.getId());
31
+
32
+        Assert.assertEquals(expected, actual);
33
+    }
34
+
35
+    @Test
36
+    public void removeTestByPerson() {
37
+        people.remove(person);
38
+
39
+        int expected = 0;
40
+        int actual = (int) people.getCount(persons);
41
+
42
+        Assert.assertEquals(expected, actual);
43
+
44
+    }
45
+
46
+    @Test
47
+    public void removeTest2() {
48
+        people.add(person);
49
+        people.remove(person.getId());
50
+
51
+        int expected = 0;
52
+        int actual = (int) people.getCount(persons);
53
+
54
+        Assert.assertEquals(expected, actual);
55
+    }
56
+}