Przeglądaj źródła

Refactored for use with MockDao

Nick Satinover 6 lat temu
rodzic
commit
e5b5c181e4

+ 13
- 0
.idea/libraries/Maven__junit_junit_4_12.xml Wyświetl plik

@@ -0,0 +1,13 @@
1
+<component name="libraryTable">
2
+  <library name="Maven: junit:junit:4.12">
3
+    <CLASSES>
4
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" />
5
+    </CLASSES>
6
+    <JAVADOC>
7
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-javadoc.jar!/" />
8
+    </JAVADOC>
9
+    <SOURCES>
10
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-sources.jar!/" />
11
+    </SOURCES>
12
+  </library>
13
+</component>

+ 13
- 0
.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml Wyświetl plik

@@ -0,0 +1,13 @@
1
+<component name="libraryTable">
2
+  <library name="Maven: org.hamcrest:hamcrest-core:1.3">
3
+    <CLASSES>
4
+      <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
5
+    </CLASSES>
6
+    <JAVADOC>
7
+      <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar!/" />
8
+    </JAVADOC>
9
+    <SOURCES>
10
+      <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar!/" />
11
+    </SOURCES>
12
+  </library>
13
+</component>

+ 0
- 124
.idea/uiDesigner.xml Wyświetl plik

@@ -1,124 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="Palette2">
4
-    <group name="Swing">
5
-      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
6
-        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
7
-      </item>
8
-      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
9
-        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
10
-      </item>
11
-      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
12
-        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
13
-      </item>
14
-      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
15
-        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
16
-      </item>
17
-      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
18
-        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
19
-        <initial-values>
20
-          <property name="text" value="Button" />
21
-        </initial-values>
22
-      </item>
23
-      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
24
-        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
25
-        <initial-values>
26
-          <property name="text" value="RadioButton" />
27
-        </initial-values>
28
-      </item>
29
-      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
30
-        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
31
-        <initial-values>
32
-          <property name="text" value="CheckBox" />
33
-        </initial-values>
34
-      </item>
35
-      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
36
-        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
37
-        <initial-values>
38
-          <property name="text" value="Label" />
39
-        </initial-values>
40
-      </item>
41
-      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
42
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
43
-          <preferred-size width="150" height="-1" />
44
-        </default-constraints>
45
-      </item>
46
-      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
47
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
48
-          <preferred-size width="150" height="-1" />
49
-        </default-constraints>
50
-      </item>
51
-      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
52
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
53
-          <preferred-size width="150" height="-1" />
54
-        </default-constraints>
55
-      </item>
56
-      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
57
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
58
-          <preferred-size width="150" height="50" />
59
-        </default-constraints>
60
-      </item>
61
-      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
62
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
63
-          <preferred-size width="150" height="50" />
64
-        </default-constraints>
65
-      </item>
66
-      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
67
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
68
-          <preferred-size width="150" height="50" />
69
-        </default-constraints>
70
-      </item>
71
-      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
72
-        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
73
-      </item>
74
-      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
75
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
76
-          <preferred-size width="150" height="50" />
77
-        </default-constraints>
78
-      </item>
79
-      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
80
-        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
81
-          <preferred-size width="150" height="50" />
82
-        </default-constraints>
83
-      </item>
84
-      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
85
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
86
-          <preferred-size width="150" height="50" />
87
-        </default-constraints>
88
-      </item>
89
-      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
90
-        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
91
-          <preferred-size width="200" height="200" />
92
-        </default-constraints>
93
-      </item>
94
-      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
95
-        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
96
-          <preferred-size width="200" height="200" />
97
-        </default-constraints>
98
-      </item>
99
-      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
100
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
101
-      </item>
102
-      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
103
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
104
-      </item>
105
-      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
106
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
107
-      </item>
108
-      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
109
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
110
-      </item>
111
-      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
112
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
113
-          <preferred-size width="-1" height="20" />
114
-        </default-constraints>
115
-      </item>
116
-      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
117
-        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
118
-      </item>
119
-      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
120
-        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
121
-      </item>
122
-    </group>
123
-  </component>
124
-</project>

+ 99
- 221
.idea/workspace.xml Wyświetl plik

@@ -1,16 +1,15 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4
-    <list default="true" id="d1ec87cb-9759-4969-a24e-e9514d9423f6" name="Default Changelist" comment="">
5
-      <change afterPath="$PROJECT_DIR$/.idea/uiDesigner.xml" afterDir="false" />
4
+    <list default="true" id="a5077242-19cb-4de8-ab86-b2f20184190b" name="Default Changelist" comment="">
5
+      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__junit_junit_4_12.xml" afterDir="false" />
6
+      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml" afterDir="false" />
7
+      <change beforePath="$PROJECT_DIR$/.idea/uiDesigner.xml" beforeDir="false" />
6 8
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
7
-      <change beforePath="$PROJECT_DIR$/ZCW-ORM-SimpleAccount.iml" beforeDir="false" afterPath="$PROJECT_DIR$/ZCW-ORM-SimpleAccount.iml" afterDir="false" />
8
-      <change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
9 9
       <change beforePath="$PROJECT_DIR$/src/main/java/AccountApp.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/AccountApp.java" afterDir="false" />
10 10
       <change beforePath="$PROJECT_DIR$/src/main/java/AccountService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/AccountService.java" afterDir="false" />
11 11
       <change beforePath="$PROJECT_DIR$/src/main/java/MockDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/MockDao.java" afterDir="false" />
12
-      <change beforePath="$PROJECT_DIR$/src/test/java/MockDaoTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/AccountServiceTest.java" afterDir="false" />
13
-      <change beforePath="$PROJECT_DIR$/target/classes/AccountApp.class" beforeDir="false" />
12
+      <change beforePath="$PROJECT_DIR$/src/test/java/AccountServiceTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/AccountServiceTest.java" afterDir="false" />
14 13
     </list>
15 14
     <ignored path="$PROJECT_DIR$/target/" />
16 15
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -23,122 +22,85 @@
23 22
     <session id="-448911281">
24 23
       <usages-collector id="statistics.lifecycle.project">
25 24
         <counts>
26
-          <entry key="project.closed" value="1" />
27 25
           <entry key="project.open.time.0" value="1" />
28
-          <entry key="project.open.time.12" value="1" />
29
-          <entry key="project.opened" value="2" />
26
+          <entry key="project.opened" value="1" />
30 27
         </counts>
31 28
       </usages-collector>
32 29
       <usages-collector id="statistics.file.extensions.open">
33 30
         <counts>
34
-          <entry key="class" value="1" />
35
-          <entry key="java" value="12" />
36
-          <entry key="xml" value="1" />
31
+          <entry key="class" value="2" />
32
+          <entry key="java" value="11" />
37 33
         </counts>
38 34
       </usages-collector>
39 35
       <usages-collector id="statistics.file.types.open">
40 36
         <counts>
41
-          <entry key="CLASS" value="1" />
42
-          <entry key="JAVA" value="12" />
43
-          <entry key="XML" value="1" />
37
+          <entry key="CLASS" value="2" />
38
+          <entry key="JAVA" value="11" />
44 39
         </counts>
45 40
       </usages-collector>
46 41
       <usages-collector id="statistics.file.extensions.edit">
47 42
         <counts>
48
-          <entry key="dummy" value="18" />
49
-          <entry key="java" value="965" />
50
-          <entry key="txt" value="34" />
43
+          <entry key="java" value="188" />
51 44
         </counts>
52 45
       </usages-collector>
53 46
       <usages-collector id="statistics.file.types.edit">
54 47
         <counts>
55
-          <entry key="JAVA" value="965" />
56
-          <entry key="PLAIN_TEXT" value="52" />
48
+          <entry key="JAVA" value="188" />
57 49
         </counts>
58 50
       </usages-collector>
59 51
     </session>
60 52
   </component>
61 53
   <component name="FileEditorManager">
62
-    <splitter split-orientation="horizontal" split-proportion="0.44994676">
54
+    <splitter split-orientation="horizontal" split-proportion="0.4789984">
63 55
       <split-first>
64
-        <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
56
+        <leaf>
65 57
           <file pinned="false" current-in-tab="true">
66
-            <entry file="file://$PROJECT_DIR$/src/main/java/AccountService.java">
58
+            <entry file="file://$PROJECT_DIR$/src/main/java/AccountApp.java">
67 59
               <provider selected="true" editor-type-id="text-editor">
68
-                <state relative-caret-position="120">
69
-                  <caret line="18" column="7" lean-forward="true" selection-start-line="18" selection-start-column="7" selection-end-line="18" selection-end-column="7" />
60
+                <state relative-caret-position="1290">
61
+                  <caret line="93" column="8" selection-start-line="93" selection-start-column="8" selection-end-line="93" selection-end-column="8" />
62
+                  <folding>
63
+                    <element signature="e#761#762#0" expanded="true" />
64
+                    <element signature="e#800#801#0" expanded="true" />
65
+                    <element signature="e#809#810#0" expanded="true" />
66
+                    <element signature="e#842#843#0" expanded="true" />
67
+                  </folding>
70 68
                 </state>
71 69
               </provider>
72 70
             </entry>
73 71
           </file>
74 72
           <file pinned="false" current-in-tab="false">
75
-            <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
73
+            <entry file="file://$PROJECT_DIR$/src/test/java/AccountServiceTest.java">
76 74
               <provider selected="true" editor-type-id="text-editor">
77
-                <state relative-caret-position="420">
78
-                  <caret line="31" selection-start-line="31" selection-end-line="31" />
75
+                <state relative-caret-position="165">
76
+                  <caret line="12" lean-forward="true" selection-start-line="12" selection-end-line="12" />
79 77
                 </state>
80 78
               </provider>
81 79
             </entry>
82 80
           </file>
83 81
           <file pinned="false" current-in-tab="false">
84
-            <entry file="file://$PROJECT_DIR$/src/main/java/Console.java">
82
+            <entry file="file://$PROJECT_DIR$/src/main/java/MockDao.java">
85 83
               <provider selected="true" editor-type-id="text-editor">
86
-                <state relative-caret-position="225">
87
-                  <caret line="16" selection-start-line="16" selection-end-line="16" />
84
+                <state relative-caret-position="90">
85
+                  <caret line="19" lean-forward="true" selection-start-line="19" selection-end-line="19" />
88 86
                 </state>
89 87
               </provider>
90 88
             </entry>
91 89
           </file>
92 90
           <file pinned="false" current-in-tab="false">
93
-            <entry file="file://$PROJECT_DIR$/src/main/java/MockDao.java">
91
+            <entry file="file://$PROJECT_DIR$/src/main/java/AccountService.java">
94 92
               <provider selected="true" editor-type-id="text-editor">
95
-                <state relative-caret-position="225">
96
-                  <caret line="15" column="31" selection-start-line="15" selection-start-column="31" selection-end-line="15" selection-end-column="31" />
97
-                  <folding>
98
-                    <element signature="imports" expanded="true" />
99
-                    <element signature="e#1218#1219#0" expanded="true" />
100
-                    <element signature="e#1245#1246#0" expanded="true" />
101
-                    <element signature="e#1289#1290#0" expanded="true" />
102
-                    <element signature="e#1316#1317#0" expanded="true" />
103
-                    <element signature="e#1360#1361#0" expanded="true" />
104
-                    <element signature="e#1387#1388#0" expanded="true" />
105
-                    <element signature="e#2613#2614#0" expanded="true" />
106
-                    <element signature="e#2640#2641#0" expanded="true" />
107
-                    <element signature="e#2688#2689#0" expanded="true" />
108
-                    <element signature="e#2715#2716#0" expanded="true" />
109
-                    <element signature="e#3016#3017#0" expanded="true" />
110
-                    <element signature="e#3043#3044#0" expanded="true" />
111
-                    <element signature="e#3130#3131#0" expanded="true" />
112
-                    <element signature="e#3157#3158#0" expanded="true" />
113
-                    <element signature="e#3943#3944#0" expanded="true" />
114
-                    <element signature="e#3970#3971#0" expanded="true" />
115
-                    <element signature="e#4197#4198#0" expanded="true" />
116
-                    <element signature="e#4224#4225#0" expanded="true" />
117
-                    <element signature="e#4260#4261#0" expanded="true" />
118
-                    <element signature="e#4288#4289#0" expanded="true" />
119
-                    <element signature="e#4843#4844#0" expanded="true" />
120
-                    <element signature="e#4870#4871#0" expanded="true" />
121
-                    <element signature="e#5181#5182#0" expanded="true" />
122
-                    <element signature="e#5208#5209#0" expanded="true" />
123
-                    <element signature="e#6133#6134#0" expanded="true" />
124
-                    <element signature="e#6160#6161#0" expanded="true" />
125
-                    <element signature="e#6406#6407#0" expanded="true" />
126
-                    <element signature="e#6433#6434#0" expanded="true" />
127
-                    <element signature="e#7100#7101#0" expanded="true" />
128
-                    <element signature="e#7127#7128#0" expanded="true" />
129
-                  </folding>
93
+                <state relative-caret-position="30">
94
+                  <caret line="12" column="28" selection-start-line="12" selection-start-column="28" selection-end-line="12" selection-end-column="28" />
130 95
                 </state>
131 96
               </provider>
132 97
             </entry>
133 98
           </file>
134 99
           <file pinned="false" current-in-tab="false">
135
-            <entry file="file://$PROJECT_DIR$/src/main/java/Printer.java">
100
+            <entry file="file://$PROJECT_DIR$/src/main/java/Console.java">
136 101
               <provider selected="true" editor-type-id="text-editor">
137
-                <state relative-caret-position="60">
138
-                  <caret line="4" selection-start-line="4" selection-end-line="4" />
139
-                  <folding>
140
-                    <element signature="e#75#76#0" expanded="true" />
141
-                  </folding>
102
+                <state relative-caret-position="-312">
103
+                  <caret line="3" column="13" selection-start-line="3" selection-start-column="13" selection-end-line="3" selection-end-column="13" />
142 104
                 </state>
143 105
               </provider>
144 106
             </entry>
@@ -146,29 +108,12 @@
146 108
         </leaf>
147 109
       </split-first>
148 110
       <split-second>
149
-        <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
111
+        <leaf>
150 112
           <file pinned="false" current-in-tab="true">
151
-            <entry file="file://$PROJECT_DIR$/src/main/java/AccountApp.java">
152
-              <provider selected="true" editor-type-id="text-editor">
153
-                <state relative-caret-position="1020">
154
-                  <caret line="68" column="40" lean-forward="true" selection-start-line="68" selection-start-column="40" selection-end-line="68" selection-end-column="40" />
155
-                  <folding>
156
-                    <element signature="imports" expanded="true" />
157
-                    <element signature="e#809#810#0" expanded="true" />
158
-                    <element signature="e#842#843#0" expanded="true" />
159
-                  </folding>
160
-                </state>
161
-              </provider>
162
-            </entry>
163
-          </file>
164
-          <file pinned="false" current-in-tab="false">
165
-            <entry file="file://$PROJECT_DIR$/src/test/java/AccountServiceTest.java">
113
+            <entry file="file://$PROJECT_DIR$/src/main/java/AccountService.java">
166 114
               <provider selected="true" editor-type-id="text-editor">
167
-                <state relative-caret-position="180">
168
-                  <caret line="12" column="11" selection-start-line="12" selection-start-column="11" selection-end-line="12" selection-end-column="11" />
169
-                  <folding>
170
-                    <element signature="imports" expanded="true" />
171
-                  </folding>
115
+                <state relative-caret-position="765">
116
+                  <caret line="61" column="42" selection-start-line="61" selection-start-column="42" selection-end-line="61" selection-end-column="42" />
172 117
                 </state>
173 118
               </provider>
174 119
             </entry>
@@ -177,26 +122,16 @@
177 122
       </split-second>
178 123
     </splitter>
179 124
   </component>
180
-  <component name="FileTemplateManagerImpl">
181
-    <option name="RECENT_TEMPLATES">
182
-      <list>
183
-        <option value="Class" />
184
-      </list>
185
-    </option>
186
-  </component>
187 125
   <component name="Git.Settings">
188 126
     <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
189 127
   </component>
190 128
   <component name="IdeDocumentHistory">
191 129
     <option name="CHANGED_PATHS">
192 130
       <list>
193
-        <option value="$PROJECT_DIR$/src/test/java/MockDaoTest.java" />
194
-        <option value="$PROJECT_DIR$/src/main/java/Console.java" />
195
-        <option value="$PROJECT_DIR$/src/main/java/Printer.java" />
196 131
         <option value="$PROJECT_DIR$/src/main/java/MockDao.java" />
132
+        <option value="$PROJECT_DIR$/src/test/java/AccountServiceTest.java" />
197 133
         <option value="$PROJECT_DIR$/src/main/java/AccountApp.java" />
198 134
         <option value="$PROJECT_DIR$/src/main/java/AccountService.java" />
199
-        <option value="$PROJECT_DIR$/src/test/java/AccountServiceTest.java" />
200 135
       </list>
201 136
     </option>
202 137
   </component>
@@ -206,7 +141,7 @@
206 141
     <detection-done>true</detection-done>
207 142
     <sorting>DEFINITION_ORDER</sorting>
208 143
   </component>
209
-  <component name="ProjectFrameBounds">
144
+  <component name="ProjectFrameBounds" extendedState="6">
210 145
     <option name="x" value="-309" />
211 146
     <option name="y" value="-1057" />
212 147
     <option name="width" value="1920" />
@@ -218,7 +153,6 @@
218 153
       <foldersAlwaysOnTop value="true" />
219 154
     </navigator>
220 155
     <panes>
221
-      <pane id="PackagesPane" />
222 156
       <pane id="ProjectPane">
223 157
         <subPane>
224 158
           <expand>
@@ -261,13 +195,14 @@
261 195
           <select />
262 196
         </subPane>
263 197
       </pane>
198
+      <pane id="PackagesPane" />
264 199
       <pane id="Scope" />
265 200
     </panes>
266 201
   </component>
267 202
   <component name="PropertiesComponent">
268 203
     <property name="WebServerToolWindowFactoryState" value="false" />
269 204
     <property name="aspect.path.notification.shown" value="true" />
270
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542506723623" />
205
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542817574542" />
271 206
     <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
272 207
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
273 208
     <property name="nodejs_npm_path_reset_for_default_project" value="true" />
@@ -306,66 +241,50 @@
306 241
   </component>
307 242
   <component name="TaskManager">
308 243
     <task active="true" id="Default" summary="Default task">
309
-      <changelist id="d1ec87cb-9759-4969-a24e-e9514d9423f6" name="Default Changelist" comment="" />
310
-      <created>1542498089232</created>
244
+      <changelist id="a5077242-19cb-4de8-ab86-b2f20184190b" name="Default Changelist" comment="" />
245
+      <created>1542746487090</created>
311 246
       <option name="number" value="Default" />
312 247
       <option name="presentableId" value="Default" />
313
-      <updated>1542498089232</updated>
314
-      <workItem from="1542498090592" duration="5252000" />
315
-      <workItem from="1542504828624" duration="1765000" />
316
-    </task>
317
-    <task id="LOCAL-00001" summary="working">
318
-      <created>1542502281430</created>
319
-      <option name="number" value="00001" />
320
-      <option name="presentableId" value="LOCAL-00001" />
321
-      <option name="project" value="LOCAL" />
322
-      <updated>1542502281430</updated>
248
+      <updated>1542746487090</updated>
249
+      <workItem from="1542746488527" duration="5829000" />
323 250
     </task>
324
-    <task id="LOCAL-00002" summary="Testing and Refactor needed">
325
-      <created>1542503894204</created>
326
-      <option name="number" value="00002" />
327
-      <option name="presentableId" value="LOCAL-00002" />
328
-      <option name="project" value="LOCAL" />
329
-      <updated>1542503894204</updated>
330
-    </task>
331
-    <option name="localTasksCounter" value="3" />
332 251
     <servers />
333 252
   </component>
334 253
   <component name="TimeTrackingManager">
335
-    <option name="totallyTimeSpent" value="7017000" />
254
+    <option name="totallyTimeSpent" value="5829000" />
336 255
   </component>
337 256
   <component name="ToolWindowManager">
338
-    <frame x="-309" y="-1057" width="1920" height="1057" extended-state="0" />
257
+    <frame x="-309" y="-1057" width="1920" height="1057" extended-state="6" />
339 258
     <editor active="true" />
340 259
     <layout>
341
-      <window_info content_ui="combo" id="Project" order="0" weight="0.07241747" />
260
+      <window_info id="Image Layers" />
261
+      <window_info id="Designer" />
262
+      <window_info id="UI Designer" />
263
+      <window_info id="Capture Tool" />
264
+      <window_info id="Favorites" side_tool="true" />
265
+      <window_info content_ui="combo" id="Project" order="0" weight="0.24959612" />
342 266
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
343
-      <window_info id="Image Layers" order="2" />
344
-      <window_info id="Designer" order="3" />
345
-      <window_info id="UI Designer" order="4" />
346
-      <window_info id="Capture Tool" order="5" />
347
-      <window_info id="Favorites" order="6" side_tool="true" />
267
+      <window_info anchor="bottom" id="Messages" weight="0.3284974" />
268
+      <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
269
+      <window_info anchor="bottom" id="Version Control" show_stripe_button="false" />
270
+      <window_info anchor="bottom" id="Terminal" />
271
+      <window_info anchor="bottom" id="Event Log" side_tool="true" />
348 272
       <window_info anchor="bottom" id="Message" order="0" />
349 273
       <window_info anchor="bottom" id="Find" order="1" />
350
-      <window_info anchor="bottom" id="Run" order="2" weight="0.32953367" />
351
-      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
274
+      <window_info anchor="bottom" id="Run" order="2" weight="0.21036269" />
275
+      <window_info active="true" anchor="bottom" id="Debug" order="3" visible="true" weight="0.17823835" />
352 276
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
353 277
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
354 278
       <window_info anchor="bottom" id="TODO" order="6" />
355
-      <window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" />
356
-      <window_info anchor="bottom" id="Database Changes" order="8" show_stripe_button="false" />
357
-      <window_info anchor="bottom" id="Terminal" order="9" />
358
-      <window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
359
-      <window_info active="true" anchor="bottom" id="Messages" order="11" visible="true" weight="0.32953367" />
279
+      <window_info anchor="right" id="Palette" />
280
+      <window_info anchor="right" id="Theme Preview" />
281
+      <window_info anchor="right" id="Capture Analysis" />
282
+      <window_info anchor="right" id="Palette&#9;" />
283
+      <window_info anchor="right" id="Database" />
284
+      <window_info anchor="right" id="Maven Projects" />
360 285
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
361 286
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
362 287
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
363
-      <window_info anchor="right" id="Palette" order="3" />
364
-      <window_info anchor="right" id="Capture Analysis" order="4" />
365
-      <window_info anchor="right" id="Database" order="5" />
366
-      <window_info anchor="right" id="Theme Preview" order="6" />
367
-      <window_info anchor="right" id="Palette&#9;" order="7" />
368
-      <window_info anchor="right" id="Maven Projects" order="8" />
369 288
     </layout>
370 289
   </component>
371 290
   <component name="TypeScriptGeneratedFilesManager">
@@ -374,109 +293,68 @@
374 293
   <component name="VcsContentAnnotationSettings">
375 294
     <option name="myLimit" value="2678400000" />
376 295
   </component>
377
-  <component name="VcsManagerConfiguration">
378
-    <MESSAGE value="working" />
379
-    <MESSAGE value="Testing and Refactor needed" />
380
-    <option name="LAST_COMMIT_MESSAGE" value="Testing and Refactor needed" />
296
+  <component name="XDebuggerManager">
297
+    <breakpoint-manager>
298
+      <breakpoints>
299
+        <line-breakpoint enabled="true" type="java-line">
300
+          <url>file://$PROJECT_DIR$/src/main/java/AccountApp.java</url>
301
+          <line>67</line>
302
+          <properties />
303
+          <option name="timeStamp" value="2" />
304
+        </line-breakpoint>
305
+      </breakpoints>
306
+    </breakpoint-manager>
381 307
   </component>
382 308
   <component name="editorHistoryManager">
383
-    <entry file="file://$PROJECT_DIR$/pom.xml">
384
-      <provider selected="true" editor-type-id="text-editor" />
385
-    </entry>
386
-    <entry file="file://$PROJECT_DIR$/src/main/java/MockDao.java">
387
-      <provider selected="true" editor-type-id="text-editor">
388
-        <state relative-caret-position="225">
389
-          <caret line="15" column="31" selection-start-line="15" selection-start-column="31" selection-end-line="15" selection-end-column="31" />
390
-          <folding>
391
-            <element signature="imports" expanded="true" />
392
-            <element signature="e#1218#1219#0" expanded="true" />
393
-            <element signature="e#1245#1246#0" expanded="true" />
394
-            <element signature="e#1289#1290#0" expanded="true" />
395
-            <element signature="e#1316#1317#0" expanded="true" />
396
-            <element signature="e#1360#1361#0" expanded="true" />
397
-            <element signature="e#1387#1388#0" expanded="true" />
398
-            <element signature="e#2613#2614#0" expanded="true" />
399
-            <element signature="e#2640#2641#0" expanded="true" />
400
-            <element signature="e#2688#2689#0" expanded="true" />
401
-            <element signature="e#2715#2716#0" expanded="true" />
402
-            <element signature="e#3016#3017#0" expanded="true" />
403
-            <element signature="e#3043#3044#0" expanded="true" />
404
-            <element signature="e#3130#3131#0" expanded="true" />
405
-            <element signature="e#3157#3158#0" expanded="true" />
406
-            <element signature="e#3943#3944#0" expanded="true" />
407
-            <element signature="e#3970#3971#0" expanded="true" />
408
-            <element signature="e#4197#4198#0" expanded="true" />
409
-            <element signature="e#4224#4225#0" expanded="true" />
410
-            <element signature="e#4260#4261#0" expanded="true" />
411
-            <element signature="e#4288#4289#0" expanded="true" />
412
-            <element signature="e#4843#4844#0" expanded="true" />
413
-            <element signature="e#4870#4871#0" expanded="true" />
414
-            <element signature="e#5181#5182#0" expanded="true" />
415
-            <element signature="e#5208#5209#0" expanded="true" />
416
-            <element signature="e#6133#6134#0" expanded="true" />
417
-            <element signature="e#6160#6161#0" expanded="true" />
418
-            <element signature="e#6406#6407#0" expanded="true" />
419
-            <element signature="e#6433#6434#0" expanded="true" />
420
-            <element signature="e#7100#7101#0" expanded="true" />
421
-            <element signature="e#7127#7128#0" expanded="true" />
422
-          </folding>
423
-        </state>
424
-      </provider>
425
-    </entry>
426
-    <entry file="file://$PROJECT_DIR$/src/main/java/Printer.java">
309
+    <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
427 310
       <provider selected="true" editor-type-id="text-editor">
428
-        <state relative-caret-position="60">
429
-          <caret line="4" selection-start-line="4" selection-end-line="4" />
430
-          <folding>
431
-            <element signature="e#75#76#0" expanded="true" />
432
-          </folding>
311
+        <state relative-caret-position="75">
312
+          <caret line="6" column="13" selection-start-line="6" selection-start-column="13" selection-end-line="6" selection-end-column="13" />
433 313
         </state>
434 314
       </provider>
435 315
     </entry>
436 316
     <entry file="file://$PROJECT_DIR$/src/main/java/Console.java">
437 317
       <provider selected="true" editor-type-id="text-editor">
438
-        <state relative-caret-position="225">
439
-          <caret line="16" selection-start-line="16" selection-end-line="16" />
318
+        <state relative-caret-position="-312">
319
+          <caret line="3" column="13" selection-start-line="3" selection-start-column="13" selection-end-line="3" selection-end-column="13" />
440 320
         </state>
441 321
       </provider>
442 322
     </entry>
443
-    <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
323
+    <entry file="file://$PROJECT_DIR$/src/main/java/MockDao.java">
444 324
       <provider selected="true" editor-type-id="text-editor">
445
-        <state relative-caret-position="420">
446
-          <caret line="31" selection-start-line="31" selection-end-line="31" />
325
+        <state relative-caret-position="90">
326
+          <caret line="19" lean-forward="true" selection-start-line="19" selection-end-line="19" />
447 327
         </state>
448 328
       </provider>
449 329
     </entry>
450 330
     <entry file="jar://$MAVEN_REPOSITORY$/com/j256/ormlite/ormlite-jdbc/4.48/ormlite-jdbc-4.48.jar!/com/j256/ormlite/jdbc/JdbcConnectionSource.class">
451 331
       <provider selected="true" editor-type-id="text-editor">
452
-        <state relative-caret-position="184">
453
-          <caret line="71" selection-start-line="71" selection-end-line="71" />
332
+        <state relative-caret-position="163">
333
+          <caret line="81" selection-start-line="81" selection-end-line="81" />
454 334
         </state>
455 335
       </provider>
456 336
     </entry>
457
-    <entry file="file://$PROJECT_DIR$/src/main/java/AccountService.java">
337
+    <entry file="file://$PROJECT_DIR$/src/test/java/AccountServiceTest.java">
458 338
       <provider selected="true" editor-type-id="text-editor">
459
-        <state relative-caret-position="120">
460
-          <caret line="18" column="7" lean-forward="true" selection-start-line="18" selection-start-column="7" selection-end-line="18" selection-end-column="7" />
339
+        <state relative-caret-position="165">
340
+          <caret line="12" lean-forward="true" selection-start-line="12" selection-end-line="12" />
461 341
         </state>
462 342
       </provider>
463 343
     </entry>
464
-    <entry file="file://$PROJECT_DIR$/src/test/java/AccountServiceTest.java">
344
+    <entry file="file://$PROJECT_DIR$/src/main/java/AccountService.java">
465 345
       <provider selected="true" editor-type-id="text-editor">
466
-        <state relative-caret-position="180">
467
-          <caret line="12" column="11" selection-start-line="12" selection-start-column="11" selection-end-line="12" selection-end-column="11" />
468
-          <folding>
469
-            <element signature="imports" expanded="true" />
470
-          </folding>
346
+        <state relative-caret-position="30">
347
+          <caret line="12" column="28" selection-start-line="12" selection-start-column="28" selection-end-line="12" selection-end-column="28" />
471 348
         </state>
472 349
       </provider>
473 350
     </entry>
474 351
     <entry file="file://$PROJECT_DIR$/src/main/java/AccountApp.java">
475 352
       <provider selected="true" editor-type-id="text-editor">
476
-        <state relative-caret-position="1020">
477
-          <caret line="68" column="40" lean-forward="true" selection-start-line="68" selection-start-column="40" selection-end-line="68" selection-end-column="40" />
353
+        <state relative-caret-position="1290">
354
+          <caret line="93" column="8" selection-start-line="93" selection-start-column="8" selection-end-line="93" selection-end-column="8" />
478 355
           <folding>
479
-            <element signature="imports" expanded="true" />
356
+            <element signature="e#761#762#0" expanded="true" />
357
+            <element signature="e#800#801#0" expanded="true" />
480 358
             <element signature="e#809#810#0" expanded="true" />
481 359
             <element signature="e#842#843#0" expanded="true" />
482 360
           </folding>

+ 14
- 5
src/main/java/AccountApp.java Wyświetl plik

@@ -9,7 +9,7 @@ import java.sql.SQLException;
9 9
 
10 10
 public class AccountApp {
11 11
 
12
-    Console console = new Console();
12
+    Console console;
13 13
     AccountService accountService = new AccountService();
14 14
     private final static String DATABASE_URL = "jdbc:mysql://localhost:3306/orm_lab?useUnicode=true";
15 15
     private final static String YOURUSERNAME = "root";
@@ -18,8 +18,17 @@ public class AccountApp {
18 18
     private Dao<Account, Integer> accountDao;
19 19
     private RuntimeExceptionDao<Account, Integer> accountRuntimeDao = null;
20 20
 
21
+    AccountApp(){
22
+        console = new Console();
23
+    }
24
+
25
+    AccountApp(Dao dao){
26
+        console = new Console();
27
+        this.accountDao = dao;
28
+    }
29
+
21 30
     public Dao<Account, Integer> getAccountDao() {
22
-        return accountDao;
31
+        return this.accountDao;
23 32
     }
24 33
 
25 34
     public static void main(String[] args) throws Exception {
@@ -58,13 +67,13 @@ public class AccountApp {
58 67
 
59 68
             switch (userSelection){
60 69
                 case 1 : //new record
61
-                    accountService.create(getAccountDao());
70
+                    accountService.create(accountDao);
62 71
                     break;
63 72
                 case 2 : //view record
64
-                    accountService.read(getAccountDao());
73
+                    accountService.read(accountDao);
65 74
                     break;
66 75
                 case 3 : //update record
67
-                    accountService.update(getAccountDao());
76
+                    accountService.update(accountDao);
68 77
                     break;
69 78
                 case 4 : //delete record
70 79
                     int idToDelete = console.getIdToDelete();

+ 4
- 8
src/main/java/AccountService.java Wyświetl plik

@@ -12,13 +12,9 @@ import com.j256.ormlite.support.ConnectionSource;
12 12
 
13 13
 public class AccountService {
14 14
     // private Dao<Account, Integer> accountDao;
15
-    Console console = new Console();
15
+     private Console console = new Console();
16 16
 
17
-/*    AccountService(Dao<Account, Integer> dao){
18
-        this.accountDao = dao;
19
-    }*/
20
-
21
-    public void create(Dao accountDao){
17
+    public void create(Dao<Account, Integer> accountDao){
22 18
         try {
23 19
             String name = console.getCMDFromUser("Enter name: ");
24 20
             String password = console.getCMDFromUser("Set password: ");
@@ -31,7 +27,7 @@ public class AccountService {
31 27
         }
32 28
     }
33 29
 
34
-    public void read(Dao accountDao) {
30
+    public void read(Dao<Account, Integer> accountDao) {
35 31
         try {
36 32
             List<Account> accountList = accountDao.queryForAll();
37 33
             for (Account e: accountList) {
@@ -43,7 +39,7 @@ public class AccountService {
43 39
         }
44 40
     }
45 41
 
46
-    public void update(Dao accountDao) {
42
+    public void update(Dao<Account, Integer> accountDao) {
47 43
         boolean updateAccountMenuOpen = true;
48 44
 
49 45
         while (updateAccountMenuOpen){

+ 1
- 1
src/main/java/MockDao.java Wyświetl plik

@@ -13,7 +13,7 @@ import java.util.List;
13 13
 import java.util.Map;
14 14
 import java.util.concurrent.Callable;
15 15
 
16
-public class MockDao implements Dao {
16
+public class MockDao<Account, Integer> implements Dao {
17 17
     public Object queryForId(Object o) throws SQLException {
18 18
         return null;
19 19
     }