Leon 7 år sedan
förälder
incheckning
b28085c97c

+ 38
- 43
.idea/workspace.xml Visa fil

@@ -2,13 +2,8 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="30b7e4a0-b899-49c3-865c-0311dfadae62" name="Default" comment="">
5
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/anthropoid/TestPersonWarehouse.java" />
6
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/classes/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.class" afterPath="$PROJECT_DIR$/target/classes/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.class" />
7
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
8 5
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonFactory.java" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonFactory.java" />
9
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java" />
10
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/PersonWarehouse.leonlog" afterPath="$PROJECT_DIR$/target/PersonWarehouse.leonlog" />
11
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/global.leonlog" afterPath="$PROJECT_DIR$/target/global.leonlog" />
6
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/anthropoid/TestPersonWarehouse.java" afterPath="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/anthropoid/TestPersonWarehouse.java" />
12 7
     </list>
13 8
     <ignored path="$PROJECT_DIR$/out/" />
14 9
     <ignored path="$PROJECT_DIR$/target/" />
@@ -27,8 +22,8 @@
27 22
             <file leaf-file-name="TestPersonWarehouse.java" pinned="false" current-in-tab="true">
28 23
               <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/anthropoid/TestPersonWarehouse.java">
29 24
                 <provider selected="true" editor-type-id="text-editor">
30
-                  <state relative-caret-position="485">
31
-                    <caret line="51" column="53" lean-forward="true" selection-start-line="51" selection-start-column="53" selection-end-line="51" selection-end-column="53" />
25
+                  <state relative-caret-position="313">
26
+                    <caret line="51" column="26" lean-forward="false" selection-start-line="51" selection-start-column="26" selection-end-line="51" selection-end-column="26" />
32 27
                     <folding>
33 28
                       <element signature="imports" expanded="true" />
34 29
                     </folding>
@@ -112,21 +107,21 @@
112 107
           </provider>
113 108
         </entry>
114 109
       </file>
115
-      <file leaf-file-name="PersonFactory.java" pinned="false" current-in-tab="true">
110
+      <file leaf-file-name="PersonFactory.java" pinned="false" current-in-tab="false">
116 111
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonFactory.java">
117 112
           <provider selected="true" editor-type-id="text-editor">
118
-            <state relative-caret-position="250">
119
-              <caret line="23" column="90" lean-forward="false" selection-start-line="23" selection-start-column="90" selection-end-line="23" selection-end-column="90" />
113
+            <state relative-caret-position="777">
114
+              <caret line="60" column="84" lean-forward="true" selection-start-line="60" selection-start-column="84" selection-end-line="60" selection-end-column="84" />
120 115
               <folding />
121 116
             </state>
122 117
           </provider>
123 118
         </entry>
124 119
       </file>
125
-      <file leaf-file-name="PersonWarehouse.java" pinned="false" current-in-tab="false">
120
+      <file leaf-file-name="PersonWarehouse.java" pinned="false" current-in-tab="true">
126 121
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java">
127 122
           <provider selected="true" editor-type-id="text-editor">
128
-            <state relative-caret-position="203">
129
-              <caret line="51" column="33" lean-forward="false" selection-start-line="51" selection-start-column="33" selection-end-line="51" selection-end-column="33" />
123
+            <state relative-caret-position="360">
124
+              <caret line="68" column="63" lean-forward="false" selection-start-line="68" selection-start-column="63" selection-end-line="68" selection-end-column="63" />
130 125
               <folding>
131 126
                 <element signature="e#2007#2008#0" expanded="true" />
132 127
                 <element signature="e#2063#2064#0" expanded="true" />
@@ -253,8 +248,8 @@
253 248
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ConversionAgent.java" />
254 249
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/DateUtils.java" />
255 250
         <option value="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/conversions/TestConversionAgent.java" />
256
-        <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java" />
257 251
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonFactory.java" />
252
+        <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java" />
258 253
         <option value="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/anthropoid/TestPersonWarehouse.java" />
259 254
       </list>
260 255
     </option>
@@ -857,34 +852,34 @@
857 852
     <servers />
858 853
   </component>
859 854
   <component name="TestHistory">
860
-    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 52m 42s.xml">
855
+    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 54m 04s.xml">
861 856
       <configuration name="TestPersonWarehouse" configurationId="JUnit" />
862 857
     </history-entry>
863
-    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 52m 47s.xml">
858
+    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 54m 05s.xml">
864 859
       <configuration name="TestPersonWarehouse" configurationId="JUnit" />
865 860
     </history-entry>
866
-    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 53m 51s.xml">
861
+    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 54m 07s.xml">
867 862
       <configuration name="TestPersonWarehouse" configurationId="JUnit" />
868 863
     </history-entry>
869
-    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 53m 59s.xml">
864
+    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 54m 23s.xml">
870 865
       <configuration name="TestPersonWarehouse" configurationId="JUnit" />
871 866
     </history-entry>
872
-    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 54m 04s.xml">
867
+    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 54m 51s.xml">
873 868
       <configuration name="TestPersonWarehouse" configurationId="JUnit" />
874 869
     </history-entry>
875
-    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 54m 05s.xml">
870
+    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 55m 34s.xml">
876 871
       <configuration name="TestPersonWarehouse" configurationId="JUnit" />
877 872
     </history-entry>
878
-    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 54m 07s.xml">
873
+    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 56m 30s.xml">
879 874
       <configuration name="TestPersonWarehouse" configurationId="JUnit" />
880 875
     </history-entry>
881
-    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 54m 23s.xml">
876
+    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 58m 01s.xml">
882 877
       <configuration name="TestPersonWarehouse" configurationId="JUnit" />
883 878
     </history-entry>
884
-    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 54m 51s.xml">
879
+    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 58m 16s.xml">
885 880
       <configuration name="TestPersonWarehouse" configurationId="JUnit" />
886 881
     </history-entry>
887
-    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 55m 34s.xml">
882
+    <history-entry file="TestPersonWarehouse - 2017.05.31 at 15h 58m 34s.xml">
888 883
       <configuration name="TestPersonWarehouse" configurationId="JUnit" />
889 884
     </history-entry>
890 885
   </component>
@@ -911,7 +906,7 @@
911 906
       <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
912 907
       <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
913 908
       <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
914
-      <window_info id="Run" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.31425598" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
909
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.31425598" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
915 910
       <window_info id="Properties" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
916 911
       <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25078043" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
917 912
       <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
@@ -1308,19 +1303,6 @@
1308 1303
         </state>
1309 1304
       </provider>
1310 1305
     </entry>
1311
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java">
1312
-      <provider selected="true" editor-type-id="text-editor">
1313
-        <state relative-caret-position="203">
1314
-          <caret line="51" column="33" lean-forward="false" selection-start-line="51" selection-start-column="33" selection-end-line="51" selection-end-column="33" />
1315
-          <folding>
1316
-            <element signature="e#2007#2008#0" expanded="true" />
1317
-            <element signature="e#2063#2064#0" expanded="true" />
1318
-            <element signature="e#3120#3121#0" expanded="true" />
1319
-            <element signature="e#3149#3150#0" expanded="true" />
1320
-          </folding>
1321
-        </state>
1322
-      </provider>
1323
-    </entry>
1324 1306
     <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/anthropoid/TestPersonFactory.java">
1325 1307
       <provider selected="true" editor-type-id="text-editor">
1326 1308
         <state relative-caret-position="315">
@@ -1331,22 +1313,35 @@
1331 1313
     </entry>
1332 1314
     <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonFactory.java">
1333 1315
       <provider selected="true" editor-type-id="text-editor">
1334
-        <state relative-caret-position="250">
1335
-          <caret line="23" column="90" lean-forward="false" selection-start-line="23" selection-start-column="90" selection-end-line="23" selection-end-column="90" />
1316
+        <state relative-caret-position="777">
1317
+          <caret line="60" column="84" lean-forward="true" selection-start-line="60" selection-start-column="84" selection-end-line="60" selection-end-column="84" />
1336 1318
           <folding />
1337 1319
         </state>
1338 1320
       </provider>
1339 1321
     </entry>
1340 1322
     <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/anthropoid/TestPersonWarehouse.java">
1341 1323
       <provider selected="true" editor-type-id="text-editor">
1342
-        <state relative-caret-position="485">
1343
-          <caret line="51" column="53" lean-forward="true" selection-start-line="51" selection-start-column="53" selection-end-line="51" selection-end-column="53" />
1324
+        <state relative-caret-position="313">
1325
+          <caret line="51" column="26" lean-forward="false" selection-start-line="51" selection-start-column="26" selection-end-line="51" selection-end-column="26" />
1344 1326
           <folding>
1345 1327
             <element signature="imports" expanded="true" />
1346 1328
           </folding>
1347 1329
         </state>
1348 1330
       </provider>
1349 1331
     </entry>
1332
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java">
1333
+      <provider selected="true" editor-type-id="text-editor">
1334
+        <state relative-caret-position="360">
1335
+          <caret line="68" column="63" lean-forward="false" selection-start-line="68" selection-start-column="63" selection-end-line="68" selection-end-column="63" />
1336
+          <folding>
1337
+            <element signature="e#2007#2008#0" expanded="true" />
1338
+            <element signature="e#2063#2064#0" expanded="true" />
1339
+            <element signature="e#3120#3121#0" expanded="true" />
1340
+            <element signature="e#3149#3150#0" expanded="true" />
1341
+          </folding>
1342
+        </state>
1343
+      </provider>
1344
+    </entry>
1350 1345
   </component>
1351 1346
   <component name="masterDetails">
1352 1347
     <states>

+ 9
- 9
src/main/java/com/zipcodewilmington/streams/anthropoid/PersonFactory.java Visa fil

@@ -35,29 +35,29 @@ public final class PersonFactory {
35 35
 
36 36
     /**
37 37
      * Section 8.8
38
-     * @param personCount - number of Person objects to create
38
+     * @param listSize - number of Person objects to create
39 39
      * @return - ArrayList of Person objects
40 40
      */ // TODO
41
-    public static List<Person> createPersonList(int personCount) {
42
-        return createPersonStream(personCount).collect(Collectors.toList());
41
+    public static List<Person> createPersonList(int listSize) {
42
+        return createPersonStream(listSize).collect(Collectors.toList());
43 43
     }
44 44
 
45 45
 
46 46
     /**
47
-     * @param personCount - number of Person objects to create
47
+     * @param arrayLength - number of Person objects to create
48 48
      * @return - Array of Person objects
49 49
      */ // TODO
50
-    public static Person[] createPersonArray(int personCount) {
51
-        return createPersonStream(personCount).toArray(Person[]::new);
50
+    public static Person[] createPersonArray(int arrayLength) {
51
+        return createPersonStream(arrayLength).toArray(Person[]::new);
52 52
     }
53 53
 
54 54
 
55 55
     /**
56 56
      * Section 8.2
57
-     * @param personCount - number of Person objects to create
57
+     * @param streamCount - number of Person objects to create
58 58
      * @return - Stream representation of collection of Person objects
59 59
      */ // TODO
60
-    public static Stream<Person> createPersonStream(int personCount) {
61
-        return Stream.generate(PersonFactory::createRandomPerson).limit(personCount);
60
+    public static Stream<Person> createPersonStream(int streamCount) {
61
+        return Stream.generate(PersonFactory::createRandomPerson).limit(streamCount);
62 62
     }
63 63
 }

+ 2
- 2
src/test/java/com/zipcodewilmington/streams/anthropoid/TestPersonWarehouse.java Visa fil

@@ -47,8 +47,8 @@ public class TestPersonWarehouse {
47 47
 
48 48
     @Test
49 49
     public void testGetFirstNUniquelyNamedPeople() {
50
-        int expectedSize = RandomUtils.createInteger(1, 2);
51
-        int actualSize = PersonWarehouse.getFirstNUniquelyNamedPeople(expectedSize).collect(Collectors.toList()).size();
50
+        int expectedSize = RandomUtils.createInteger(1, 3);
51
+        int actualSize = (int)PersonWarehouse.getFirstNUniquelyNamedPeople(expectedSize).count();
52 52
         Assert.assertTrue(expectedSize > actualSize);
53 53
     }
54 54
 

+ 7
- 7
target/PersonWarehouse.leonlog Visa fil

@@ -1,19 +1,19 @@
1
-May 31, 2017 3:56:30 PM com.zipcodewilmington.streams.tools.logging.LoggerHandler log
1
+May 31, 2017 3:59:25 PM com.zipcodewilmington.streams.tools.logging.LoggerHandler log
2 2
 INFO: Registering a new person object to the person warehouse...
3
-May 31, 2017 3:56:30 PM com.zipcodewilmington.streams.tools.logging.LoggerHandler log
3
+May 31, 2017 3:59:25 PM com.zipcodewilmington.streams.tools.logging.LoggerHandler log
4 4
 INFO: 
5 5
 ------------------------------------------------------------------------------------------------------------------------------------------------------
6 6
 Entry number:                              0
7 7
 Key: public final java.lang.String com.zipcodewilmington.streams.anthropoid.Person.name
8
-Value:                           Eqom
8
+Value:                           Vyhb
9 9
 ------------------------------------------------------------------------------------------------------------------------------------------------------
10 10
 Entry number:                              1
11 11
 Key: public final java.util.Date com.zipcodewilmington.streams.anthropoid.Person.birthDate
12
-Value:   Wed Apr 06 15:56:30 EST 1983
12
+Value:   Fri Nov 05 15:59:25 EST 1993
13 13
 ------------------------------------------------------------------------------------------------------------------------------------------------------
14 14
 Entry number:                              2
15 15
 Key: public final int com.zipcodewilmington.streams.anthropoid.Person.age
16
-Value:                             34
16
+Value:                             23
17 17
 ------------------------------------------------------------------------------------------------------------------------------------------------------
18 18
 Entry number:                              3
19 19
 Key: public final boolean com.zipcodewilmington.streams.anthropoid.Person.isMale
@@ -21,8 +21,8 @@ Value:                          false
21 21
 ------------------------------------------------------------------------------------------------------------------------------------------------------
22 22
 Entry number:                              4
23 23
 Key: public final long com.zipcodewilmington.streams.anthropoid.Person.personalId
24
-Value:                745398755630572
24
+Value:                745573729624334
25 25
 ------------------------------------------------------------------------------------------------------------------------------------------------------
26 26
 Entry number:                              5
27 27
 Key: public final java.lang.String[] com.zipcodewilmington.streams.anthropoid.Person.aliases
28
-Value:   [Ljava.lang.String;@16b4a017
28
+Value:   [Ljava.lang.String;@3ada9e37

Binär
target/classes/com/zipcodewilmington/streams/anthropoid/PersonFactory.class Visa fil


+ 1
- 1
target/global.leonlog Visa fil

@@ -1,2 +1,2 @@
1
-May 31, 2017 3:56:30 PM com.zipcodewilmington.streams.tools.logging.LoggerHandler log
1
+May 31, 2017 3:59:25 PM com.zipcodewilmington.streams.tools.logging.LoggerHandler log
2 2
 INFO: Instantiating logger for [ com.zipcodewilmington.streams.anthropoid.PersonWarehouse ] ...