瀏覽代碼

blean bode

Ahmad Rusdi 6 年之前
當前提交
e186022f64

+ 13
- 0
.idea/compiler.xml 查看文件

@@ -0,0 +1,13 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="CompilerConfiguration">
4
+    <annotationProcessing>
5
+      <profile name="Maven default annotation processors profile" enabled="true">
6
+        <sourceOutputDir name="target/generated-sources/annotations" />
7
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
8
+        <outputRelativeToContentRoot value="true" />
9
+        <module name="gkd" />
10
+      </profile>
11
+    </annotationProcessing>
12
+  </component>
13
+</project>

+ 6
- 0
.idea/encodings.xml 查看文件

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="Encoding">
4
+    <file url="file://$PROJECT_DIR$" charset="UTF-8" />
5
+  </component>
6
+</project>

+ 14
- 0
.idea/misc.xml 查看文件

@@ -0,0 +1,14 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
4
+  <component name="MavenProjectsManager">
5
+    <option name="originalFiles">
6
+      <list>
7
+        <option value="$PROJECT_DIR$/pom.xml" />
8
+      </list>
9
+    </option>
10
+  </component>
11
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
12
+    <output url="file://$PROJECT_DIR$/out" />
13
+  </component>
14
+</project>

+ 124
- 0
.idea/uiDesigner.xml 查看文件

@@ -0,0 +1,124 @@
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>

+ 410
- 0
.idea/workspace.xml 查看文件

@@ -0,0 +1,410 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="4a95b8d6-9c77-4832-be5e-9d0035f77dd8" name="Default" comment="" />
5
+    <ignored path="$PROJECT_DIR$/out/" />
6
+    <ignored path="$PROJECT_DIR$/target/" />
7
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
8
+    <option name="TRACKING_ENABLED" value="true" />
9
+    <option name="SHOW_DIALOG" value="false" />
10
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
11
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
12
+    <option name="LAST_RESOLUTION" value="IGNORE" />
13
+  </component>
14
+  <component name="FileEditorManager">
15
+    <splitter split-orientation="horizontal" split-proportion="0.5">
16
+      <split-first>
17
+        <leaf>
18
+          <file leaf-file-name="Inventory.java" pinned="false" current-in-tab="true">
19
+            <entry file="file://$PROJECT_DIR$/src/main/java/kleankode/Inventory.java">
20
+              <provider selected="true" editor-type-id="text-editor">
21
+                <state relative-caret-position="416">
22
+                  <caret line="34" column="43" selection-start-line="34" selection-start-column="43" selection-end-line="34" selection-end-column="43" />
23
+                </state>
24
+              </provider>
25
+            </entry>
26
+          </file>
27
+        </leaf>
28
+      </split-first>
29
+      <split-second>
30
+        <leaf>
31
+          <file leaf-file-name="InventoryTest.java" pinned="false" current-in-tab="true">
32
+            <entry file="file://$PROJECT_DIR$/src/test/java/kleankode/InventoryTest.java">
33
+              <provider selected="true" editor-type-id="text-editor">
34
+                <state relative-caret-position="-1296">
35
+                  <caret line="7" column="1" selection-start-line="7" selection-start-column="1" selection-end-line="7" selection-end-column="1" />
36
+                  <folding>
37
+                    <element signature="imports" expanded="true" />
38
+                  </folding>
39
+                </state>
40
+              </provider>
41
+            </entry>
42
+          </file>
43
+        </leaf>
44
+      </split-second>
45
+    </splitter>
46
+  </component>
47
+  <component name="IdeDocumentHistory">
48
+    <option name="CHANGED_PATHS">
49
+      <list>
50
+        <option value="$PROJECT_DIR$/src/main/java/kleankode/Item.java" />
51
+        <option value="$PROJECT_DIR$/src/main/java/kleankode/Inventory.java" />
52
+      </list>
53
+    </option>
54
+  </component>
55
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
56
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
57
+  <component name="JsGulpfileManager">
58
+    <detection-done>true</detection-done>
59
+    <sorting>DEFINITION_ORDER</sorting>
60
+  </component>
61
+  <component name="MavenImportPreferences">
62
+    <option name="importingSettings">
63
+      <MavenImportingSettings>
64
+        <option name="importAutomatically" value="true" />
65
+      </MavenImportingSettings>
66
+    </option>
67
+  </component>
68
+  <component name="NodePackageJsonFileManager">
69
+    <packageJsonPaths />
70
+  </component>
71
+  <component name="ProjectFrameBounds" extendedState="6">
72
+    <option name="x" value="4" />
73
+    <option name="y" value="4" />
74
+    <option name="width" value="1272" />
75
+    <option name="height" value="792" />
76
+  </component>
77
+  <component name="ProjectView">
78
+    <navigator proportions="" version="1">
79
+      <foldersAlwaysOnTop value="true" />
80
+    </navigator>
81
+    <panes>
82
+      <pane id="Scope" />
83
+      <pane id="PackagesPane" />
84
+      <pane id="AndroidView" />
85
+      <pane id="ProjectPane">
86
+        <subPane>
87
+          <expand>
88
+            <path>
89
+              <item name="gkd" type="b2602c69:ProjectViewProjectNode" />
90
+              <item name="gkd" type="462c0819:PsiDirectoryNode" />
91
+            </path>
92
+            <path>
93
+              <item name="gkd" type="b2602c69:ProjectViewProjectNode" />
94
+              <item name="gkd" type="462c0819:PsiDirectoryNode" />
95
+              <item name="src" type="462c0819:PsiDirectoryNode" />
96
+            </path>
97
+            <path>
98
+              <item name="gkd" type="b2602c69:ProjectViewProjectNode" />
99
+              <item name="gkd" type="462c0819:PsiDirectoryNode" />
100
+              <item name="src" type="462c0819:PsiDirectoryNode" />
101
+              <item name="main" type="462c0819:PsiDirectoryNode" />
102
+            </path>
103
+            <path>
104
+              <item name="gkd" type="b2602c69:ProjectViewProjectNode" />
105
+              <item name="gkd" type="462c0819:PsiDirectoryNode" />
106
+              <item name="src" type="462c0819:PsiDirectoryNode" />
107
+              <item name="main" type="462c0819:PsiDirectoryNode" />
108
+              <item name="java" type="462c0819:PsiDirectoryNode" />
109
+            </path>
110
+            <path>
111
+              <item name="gkd" type="b2602c69:ProjectViewProjectNode" />
112
+              <item name="gkd" type="462c0819:PsiDirectoryNode" />
113
+              <item name="src" type="462c0819:PsiDirectoryNode" />
114
+              <item name="main" type="462c0819:PsiDirectoryNode" />
115
+              <item name="java" type="462c0819:PsiDirectoryNode" />
116
+              <item name="kleankode" type="462c0819:PsiDirectoryNode" />
117
+            </path>
118
+            <path>
119
+              <item name="gkd" type="b2602c69:ProjectViewProjectNode" />
120
+              <item name="gkd" type="462c0819:PsiDirectoryNode" />
121
+              <item name="src" type="462c0819:PsiDirectoryNode" />
122
+              <item name="test" type="462c0819:PsiDirectoryNode" />
123
+            </path>
124
+            <path>
125
+              <item name="gkd" type="b2602c69:ProjectViewProjectNode" />
126
+              <item name="gkd" type="462c0819:PsiDirectoryNode" />
127
+              <item name="src" type="462c0819:PsiDirectoryNode" />
128
+              <item name="test" type="462c0819:PsiDirectoryNode" />
129
+              <item name="java" type="462c0819:PsiDirectoryNode" />
130
+            </path>
131
+            <path>
132
+              <item name="gkd" type="b2602c69:ProjectViewProjectNode" />
133
+              <item name="gkd" type="462c0819:PsiDirectoryNode" />
134
+              <item name="src" type="462c0819:PsiDirectoryNode" />
135
+              <item name="test" type="462c0819:PsiDirectoryNode" />
136
+              <item name="java" type="462c0819:PsiDirectoryNode" />
137
+              <item name="kleankode" type="462c0819:PsiDirectoryNode" />
138
+            </path>
139
+          </expand>
140
+          <select />
141
+        </subPane>
142
+      </pane>
143
+    </panes>
144
+  </component>
145
+  <component name="PropertiesComponent">
146
+    <property name="WebServerToolWindowFactoryState" value="false" />
147
+    <property name="aspect.path.notification.shown" value="true" />
148
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
149
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
150
+  </component>
151
+  <component name="RecentsManager">
152
+    <key name="MoveClassesOrPackagesDialog.RECENTS_KEY">
153
+      <recent name="kleankode" />
154
+    </key>
155
+    <key name="MoveFile.RECENT_KEYS">
156
+      <recent name="$PROJECT_DIR$/src/main/java/kleankode" />
157
+    </key>
158
+  </component>
159
+  <component name="RunDashboard">
160
+    <option name="ruleStates">
161
+      <list>
162
+        <RuleState>
163
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
164
+        </RuleState>
165
+        <RuleState>
166
+          <option name="name" value="StatusDashboardGroupingRule" />
167
+        </RuleState>
168
+      </list>
169
+    </option>
170
+  </component>
171
+  <component name="RunManager" selected="JUnit.InventoryTest">
172
+    <configuration default="true" type="Application" factoryName="Application">
173
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
174
+    </configuration>
175
+    <configuration name="InventoryTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
176
+      <module name="gkd" />
177
+      <extension name="coverage">
178
+        <pattern>
179
+          <option name="PATTERN" value="kleankode.*" />
180
+          <option name="ENABLED" value="true" />
181
+        </pattern>
182
+      </extension>
183
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
184
+      <option name="ALTERNATIVE_JRE_PATH" />
185
+      <option name="PACKAGE_NAME" value="kleankode" />
186
+      <option name="MAIN_CLASS_NAME" value="kleankode.InventoryTest" />
187
+      <option name="METHOD_NAME" />
188
+      <option name="TEST_OBJECT" value="class" />
189
+      <option name="VM_PARAMETERS" value="-ea" />
190
+      <option name="PARAMETERS" />
191
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
192
+      <option name="PASS_PARENT_ENVS" value="true" />
193
+      <option name="TEST_SEARCH_SCOPE">
194
+        <value defaultName="singleModule" />
195
+      </option>
196
+      <patterns />
197
+    </configuration>
198
+    <configuration default="true" type="JUnit" factoryName="JUnit">
199
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
200
+      <option name="ALTERNATIVE_JRE_PATH" />
201
+      <option name="PACKAGE_NAME" />
202
+      <option name="MAIN_CLASS_NAME" />
203
+      <option name="METHOD_NAME" />
204
+      <option name="TEST_OBJECT" value="class" />
205
+      <option name="VM_PARAMETERS" value="-ea" />
206
+      <option name="PARAMETERS" />
207
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
208
+      <option name="PASS_PARENT_ENVS" value="true" />
209
+      <option name="TEST_SEARCH_SCOPE">
210
+        <value defaultName="singleModule" />
211
+      </option>
212
+      <patterns />
213
+    </configuration>
214
+    <configuration name="kleankode in gkd" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
215
+      <module name="gkd" />
216
+      <extension name="coverage">
217
+        <pattern>
218
+          <option name="PATTERN" value="kleankode.*" />
219
+          <option name="ENABLED" value="true" />
220
+        </pattern>
221
+      </extension>
222
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
223
+      <option name="ALTERNATIVE_JRE_PATH" />
224
+      <option name="PACKAGE_NAME" value="kleankode" />
225
+      <option name="MAIN_CLASS_NAME" />
226
+      <option name="METHOD_NAME" />
227
+      <option name="TEST_OBJECT" value="package" />
228
+      <option name="VM_PARAMETERS" value="-ea" />
229
+      <option name="PARAMETERS" />
230
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
231
+      <option name="PASS_PARENT_ENVS" value="true" />
232
+      <option name="TEST_SEARCH_SCOPE">
233
+        <value defaultName="singleModule" />
234
+      </option>
235
+      <patterns />
236
+    </configuration>
237
+    <configuration default="true" type="TestNG" factoryName="TestNG">
238
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
239
+      <option name="ALTERNATIVE_JRE_PATH" />
240
+      <option name="SUITE_NAME" />
241
+      <option name="PACKAGE_NAME" />
242
+      <option name="MAIN_CLASS_NAME" />
243
+      <option name="METHOD_NAME" />
244
+      <option name="GROUP_NAME" />
245
+      <option name="TEST_OBJECT" value="CLASS" />
246
+      <option name="VM_PARAMETERS" value="-ea" />
247
+      <option name="PARAMETERS" />
248
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
249
+      <option name="OUTPUT_DIRECTORY" />
250
+      <option name="PASS_PARENT_ENVS" value="true" />
251
+      <option name="TEST_SEARCH_SCOPE">
252
+        <value defaultName="singleModule" />
253
+      </option>
254
+      <option name="USE_DEFAULT_REPORTERS" value="false" />
255
+      <option name="PROPERTIES_FILE" />
256
+      <properties />
257
+      <listeners />
258
+    </configuration>
259
+    <list>
260
+      <item itemvalue="JUnit.kleankode in gkd" />
261
+      <item itemvalue="JUnit.InventoryTest" />
262
+    </list>
263
+    <recent_temporary>
264
+      <list>
265
+        <item itemvalue="JUnit.InventoryTest" />
266
+        <item itemvalue="JUnit.kleankode in gkd" />
267
+      </list>
268
+    </recent_temporary>
269
+  </component>
270
+  <component name="SvnConfiguration">
271
+    <configuration />
272
+  </component>
273
+  <component name="TaskManager">
274
+    <task active="true" id="Default" summary="Default task">
275
+      <changelist id="4a95b8d6-9c77-4832-be5e-9d0035f77dd8" name="Default" comment="" />
276
+      <created>1529518171660</created>
277
+      <option name="number" value="Default" />
278
+      <option name="presentableId" value="Default" />
279
+      <updated>1529518171660</updated>
280
+      <workItem from="1529518173174" duration="2988000" />
281
+    </task>
282
+    <servers />
283
+  </component>
284
+  <component name="TestHistory">
285
+    <history-entry file="InventoryTest - 2018.06.20 at 14h 49m 40s.xml">
286
+      <configuration name="InventoryTest" configurationId="JUnit" />
287
+    </history-entry>
288
+    <history-entry file="InventoryTest - 2018.06.20 at 14h 50m 13s.xml">
289
+      <configuration name="InventoryTest" configurationId="JUnit" />
290
+    </history-entry>
291
+    <history-entry file="InventoryTest - 2018.06.20 at 14h 50m 49s.xml">
292
+      <configuration name="InventoryTest" configurationId="JUnit" />
293
+    </history-entry>
294
+    <history-entry file="InventoryTest - 2018.06.20 at 14h 51m 00s.xml">
295
+      <configuration name="InventoryTest" configurationId="JUnit" />
296
+    </history-entry>
297
+    <history-entry file="InventoryTest - 2018.06.20 at 14h 51m 20s.xml">
298
+      <configuration name="InventoryTest" configurationId="JUnit" />
299
+    </history-entry>
300
+    <history-entry file="InventoryTest - 2018.06.20 at 14h 53m 05s.xml">
301
+      <configuration name="InventoryTest" configurationId="JUnit" />
302
+    </history-entry>
303
+    <history-entry file="InventoryTest - 2018.06.20 at 14h 54m 21s.xml">
304
+      <configuration name="InventoryTest" configurationId="JUnit" />
305
+    </history-entry>
306
+    <history-entry file="InventoryTest - 2018.06.20 at 14h 55m 30s.xml">
307
+      <configuration name="InventoryTest" configurationId="JUnit" />
308
+    </history-entry>
309
+    <history-entry file="InventoryTest - 2018.06.20 at 14h 56m 20s.xml">
310
+      <configuration name="InventoryTest" configurationId="JUnit" />
311
+    </history-entry>
312
+    <history-entry file="InventoryTest - 2018.06.20 at 14h 56m 34s.xml">
313
+      <configuration name="InventoryTest" configurationId="JUnit" />
314
+    </history-entry>
315
+  </component>
316
+  <component name="TimeTrackingManager">
317
+    <option name="totallyTimeSpent" value="2988000" />
318
+  </component>
319
+  <component name="ToolWindowManager">
320
+    <frame x="4" y="4" width="1272" height="792" extended-state="6" />
321
+    <editor active="true" />
322
+    <layout>
323
+      <window_info anchor="right" id="Key Promoter X" />
324
+      <window_info anchor="right" id="Palette" />
325
+      <window_info anchor="bottom" id="TODO" order="6" />
326
+      <window_info anchor="bottom" id="Messages" weight="0.3294964" />
327
+      <window_info anchor="right" id="Palette&#9;" />
328
+      <window_info id="Image Layers" />
329
+      <window_info anchor="right" id="Capture Analysis" />
330
+      <window_info anchor="bottom" id="Event Log" side_tool="true" />
331
+      <window_info anchor="right" id="Maven Projects" />
332
+      <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
333
+      <window_info anchor="bottom" id="Run" order="2" weight="0.3294964" />
334
+      <window_info anchor="bottom" id="Version Control" show_stripe_button="false" />
335
+      <window_info anchor="bottom" id="Terminal" weight="0.3294964" />
336
+      <window_info id="Capture Tool" />
337
+      <window_info id="Designer" />
338
+      <window_info content_ui="combo" id="Project" order="0" weight="0.2495935" />
339
+      <window_info anchor="right" id="Database" />
340
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
341
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
342
+      <window_info id="UI Designer" />
343
+      <window_info anchor="right" id="Theme Preview" />
344
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
345
+      <window_info id="Favorites" side_tool="true" />
346
+      <window_info anchor="bottom" id="Find" order="1" />
347
+      <window_info anchor="right" id="Commander" order="0" weight="0.4" />
348
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
349
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
350
+      <window_info anchor="bottom" id="Message" order="0" />
351
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
352
+    </layout>
353
+  </component>
354
+  <component name="TypeScriptGeneratedFilesManager">
355
+    <option name="version" value="1" />
356
+  </component>
357
+  <component name="VcsContentAnnotationSettings">
358
+    <option name="myLimit" value="2678400000" />
359
+  </component>
360
+  <component name="XDebuggerManager">
361
+    <breakpoint-manager>
362
+      <option name="time" value="1" />
363
+    </breakpoint-manager>
364
+  </component>
365
+  <component name="editorHistoryManager">
366
+    <entry file="file://$PROJECT_DIR$/pom.xml">
367
+      <provider selected="true" editor-type-id="text-editor" />
368
+    </entry>
369
+    <entry file="file://$PROJECT_DIR$/src/main/java/kleankode/Item.java">
370
+      <provider selected="true" editor-type-id="text-editor">
371
+        <state relative-caret-position="176">
372
+          <caret line="12" column="4" selection-start-line="12" selection-start-column="4" selection-end-line="12" selection-end-column="4" />
373
+        </state>
374
+      </provider>
375
+    </entry>
376
+    <entry file="file://$PROJECT_DIR$/src/test/java/kleankode/InventoryTest.java">
377
+      <provider selected="true" editor-type-id="text-editor">
378
+        <state relative-caret-position="-1296">
379
+          <caret line="7" column="1" selection-start-line="7" selection-start-column="1" selection-end-line="7" selection-end-column="1" />
380
+          <folding>
381
+            <element signature="imports" expanded="true" />
382
+          </folding>
383
+        </state>
384
+      </provider>
385
+    </entry>
386
+    <entry file="file://$PROJECT_DIR$/src/main/java/kleankode/Inventory.java">
387
+      <provider selected="true" editor-type-id="text-editor">
388
+        <state relative-caret-position="416">
389
+          <caret line="34" column="43" selection-start-line="34" selection-start-column="43" selection-end-line="34" selection-end-column="43" />
390
+        </state>
391
+      </provider>
392
+    </entry>
393
+  </component>
394
+  <component name="masterDetails">
395
+    <states>
396
+      <state key="ProjectJDKs.UI">
397
+        <settings>
398
+          <last-edited>1.8</last-edited>
399
+          <splitter-proportions>
400
+            <option name="proportions">
401
+              <list>
402
+                <option value="0.2" />
403
+              </list>
404
+            </option>
405
+          </splitter-proportions>
406
+        </settings>
407
+      </state>
408
+    </states>
409
+  </component>
410
+</project>

+ 73
- 0
README.MD 查看文件

@@ -0,0 +1,73 @@
1
+# Clean Code
2
+
3
+### **Objective:**
4
+* Refactor (aka clean up) the code in the `Inventory` class to make it more maintainable and readable.
5
+
6
+### **Purpose:**
7
+* To understand why writing test matter
8
+* To understand why writing readable code matter
9
+
10
+### **Instructions:**
11
+
12
+1. Fork this Repository
13
+    * [fork](https://help.github.com/articles/fork-a-repo/) this repository to your personal github account
14
+    * [clone](https://help.github.com/articles/cloning-a-repository/) **your** `forked` repository to your local machine.
15
+    * clean up the code in the `Inventory` class
16
+    * commit your changes
17
+    * submit a `pull request` which compares Zipcoder `master` to your `master`.
18
+3. DO NOT CHANGE THE TEST OR THE ITEM CLASS
19
+
20
+# Levels
21
+This lab is divided into two levels. Level two has more code and is more difficult. If you are 90% done with your labs or if you want to challenge yourself, get level2 with `git checkout level2` after you clone the repository. Otherwise, work on the master branch.
22
+
23
+# Part 1 - Original Description of the Gilded Rose
24
+
25
+Hi and welcome to team Gilded Rose. As you know, we are a small inn
26
+with a prime location in a prominent city run by a friendly innkeeper
27
+named Allison. We also buy and sell only the finest
28
+goods. Unfortunately, our goods are constantly degrading in quality as
29
+they approach their sell by date. We have a system in place that
30
+updates our inventory for us. It was developed by a no-nonsense type
31
+named Leeroy, who has moved on to new adventures. Your task is to add
32
+the new feature to our system so that we can begin selling a new
33
+category of items. First an introduction to our system:
34
+
35
+- All items have a SellIn value which denotes the number of days we
36
+  have to sell the item
37
+- All items have a Quality value which denotes how valuable the item
38
+  is
39
+- At the end of each day our system lowers both values for every item
40
+
41
+Pretty simple, right? Well this is where it gets interesting:
42
+
43
+  - Once the sell by date has passed, Quality degrades twice as fast
44
+  - The Quality of an item is never negative
45
+  - "Aged Brie" actually increases in Quality the older it gets
46
+  - The Quality of an item is never more than 50
47
+  - "Sulfuras", being a legendary item, never has to be sold or
48
+    decreases in Quality
49
+
50
+Just for clarification, an item can never have its Quality increase
51
+above 50, however "Sulfuras" is a legendary item and as such its
52
+Quality is 80 and it never alters.
53
+
54
+DO NOT alter the Item class or Items property as those belong to the goblin
55
+in the corner who will insta-rage and one-shot you as he doesn't
56
+believe in shared code ownership (you can make the UpdateQuality
57
+method and Items property static if you like, we'll cover for
58
+you).
59
+
60
+## Part 2 - Add a new item
61
+
62
+We have recently signed a supplier of conjured items. This requires an update to our system:
63
+
64
+- "Conjured" items degrade in Quality twice as fast as normal items
65
+
66
+Feel free to make any changes to the UpdateQuality method and add any
67
+new code as long as everything still works correctly.
68
+
69
+## Rules
70
+* No more than two nested if statement in a method
71
+* Don't use the `!` for your if statement
72
+
73
+This was "borrowed" from [alexaitken](https://github.com/alexaitken/GildedRose_java) which originated from [Bobby Johnson's Blog](https://iamnotmyself.com/2011/02/13/refactor-this-the-gilded-rose-kata/).

+ 2
- 0
gkd.iml 查看文件

@@ -0,0 +1,2 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module type="JAVA_MODULE" version="4" />

+ 65
- 0
pom.xml 查看文件

@@ -0,0 +1,65 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+
3
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+  <modelVersion>4.0.0</modelVersion>
6
+
7
+  <groupId>kleankode</groupId>
8
+  <artifactId>gkd</artifactId>
9
+  <version>1.0-SNAPSHOT</version>
10
+
11
+  <name>gkd</name>
12
+  <!-- FIXME change it to the project's website -->
13
+  <url>http://www.example.com</url>
14
+
15
+  <properties>
16
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17
+    <maven.compiler.source>1.7</maven.compiler.source>
18
+    <maven.compiler.target>1.7</maven.compiler.target>
19
+  </properties>
20
+
21
+  <dependencies>
22
+    <dependency>
23
+      <groupId>junit</groupId>
24
+      <artifactId>junit</artifactId>
25
+      <version>4.11</version>
26
+      <scope>test</scope>
27
+    </dependency>
28
+  </dependencies>
29
+
30
+  <build>
31
+    <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
32
+      <plugins>
33
+        <plugin>
34
+          <artifactId>maven-clean-plugin</artifactId>
35
+          <version>3.0.0</version>
36
+        </plugin>
37
+        <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
38
+        <plugin>
39
+          <artifactId>maven-resources-plugin</artifactId>
40
+          <version>3.0.2</version>
41
+        </plugin>
42
+        <plugin>
43
+          <artifactId>maven-compiler-plugin</artifactId>
44
+          <version>3.7.0</version>
45
+        </plugin>
46
+        <plugin>
47
+          <artifactId>maven-surefire-plugin</artifactId>
48
+          <version>2.20.1</version>
49
+        </plugin>
50
+        <plugin>
51
+          <artifactId>maven-jar-plugin</artifactId>
52
+          <version>3.0.2</version>
53
+        </plugin>
54
+        <plugin>
55
+          <artifactId>maven-install-plugin</artifactId>
56
+          <version>2.5.2</version>
57
+        </plugin>
58
+        <plugin>
59
+          <artifactId>maven-deploy-plugin</artifactId>
60
+          <version>2.8.2</version>
61
+        </plugin>
62
+      </plugins>
63
+    </pluginManagement>
64
+  </build>
65
+</project>

+ 44
- 0
src/main/java/kleankode/Inventory.java 查看文件

@@ -0,0 +1,44 @@
1
+package kleankode;
2
+
3
+public class Inventory {
4
+    private Item[] items;
5
+
6
+    public Inventory(Item[] items) {
7
+        super();
8
+        this.items = items;
9
+    }
10
+
11
+    public void updateQuality() {
12
+        for (Item e : items) {
13
+            String name = e.getName();
14
+            int quality = e.getQuality();
15
+            int sellIn = e.getSellIn();
16
+
17
+            if (name.equals("Sulfuras, Hand of Ragnaros")) continue;
18
+
19
+            if (name.equals("Aged Brie")) {
20
+                sellIn -= 1;
21
+                e.setSellIn(sellIn);
22
+
23
+                quality = quality + 2 <= 50 && sellIn < 0
24
+                        ? e.getQuality() + 2
25
+                        : quality + 1 <= 50
26
+                        ? e.getQuality() + 1
27
+                        : quality;
28
+                e.setQuality(quality);
29
+            } else {
30
+                sellIn -= 1;
31
+                e.setSellIn(sellIn);
32
+
33
+                int reducer = name.equals("Conjured") ? 2 : 1;
34
+
35
+                quality = quality > 0 && sellIn < 0
36
+                        ? e.getQuality() - 2 * reducer
37
+                        : quality > 0
38
+                        ? e.getQuality() - reducer
39
+                        : quality;
40
+                e.setQuality(quality);
41
+            }
42
+        }
43
+    }
44
+}

+ 38
- 0
src/main/java/kleankode/Item.java 查看文件

@@ -0,0 +1,38 @@
1
+package kleankode;
2
+
3
+public class Item {
4
+    private String name;
5
+    private int sellIn;
6
+    private int quality;
7
+
8
+    public Item(String name, int sellIn, int quality) {
9
+        super();
10
+        this.name = name;
11
+        this.sellIn = sellIn;
12
+        this.quality = quality;
13
+    }
14
+
15
+    public String getName() {
16
+        return name;
17
+    }
18
+
19
+    public void setName(String name) {
20
+        this.name = name;
21
+    }
22
+
23
+    public int getSellIn() {
24
+        return sellIn;
25
+    }
26
+
27
+    public void setSellIn(int sellIn) {
28
+        this.sellIn = sellIn;
29
+    }
30
+
31
+    public int getQuality() {
32
+        return quality;
33
+    }
34
+
35
+    public void setQuality(int quality) {
36
+        this.quality = quality;
37
+    }
38
+}

+ 124
- 0
src/test/java/kleankode/InventoryTest.java 查看文件

@@ -0,0 +1,124 @@
1
+package kleankode;
2
+
3
+import static org.junit.Assert.*;
4
+import java.util.Arrays;
5
+import org.junit.Test;
6
+import org.junit.Before;
7
+
8
+public class InventoryTest {
9
+    private static final int MAX_QUALITY = 50;
10
+    private static final String AGED_BRIE_NAME = "Aged Brie";
11
+    private static final String BACKSTAGE_PASS_NAME = "Backstage passes to a TAFKAL80ETC concert";
12
+    private static final String NORMAL_ITEM_NAME = "+5 Dexterity Vest";
13
+
14
+    private Item sulfuras;
15
+    private Item normalItem;
16
+
17
+    @Before
18
+    public void setup(){
19
+        sulfuras = new Item("Sulfuras, Hand of Ragnaros", 0, 80);
20
+        normalItem = new Item(NORMAL_ITEM_NAME, 10, 20);
21
+    }
22
+
23
+    @Test
24
+    public void testUpdate_ForSulfurasQuality() throws Exception {
25
+        int expectedQuality = sulfuras.getQuality();
26
+        Item[] items = {sulfuras};
27
+        Inventory sut = new Inventory(items);
28
+
29
+        sut.updateQuality();
30
+
31
+        assertEquals(expectedQuality, sulfuras.getQuality());
32
+    }
33
+    @Test
34
+    public void testUpdate_ForSulfurasSellIn() throws Exception {
35
+        int expectedSellIn = sulfuras.getSellIn();
36
+        Item[] items = {sulfuras};
37
+        Inventory sut = new Inventory(items);
38
+
39
+        sut.updateQuality();
40
+
41
+        assertEquals(expectedSellIn, sulfuras.getSellIn());
42
+    }
43
+
44
+    @Test
45
+    public void testUpdate_ForNormalItemSellIn() throws Exception {
46
+        int expectedSellIn = normalItem.getSellIn() - 1;
47
+        Item[] items = {normalItem};
48
+        Inventory sut = new Inventory(items);
49
+
50
+        sut.updateQuality();
51
+
52
+        assertEquals(expectedSellIn, normalItem.getSellIn());
53
+    }
54
+
55
+    @Test
56
+    public void testUpdate_ForNormalItemQuantity() throws Exception {
57
+        int expectedQuality = normalItem.getQuality() - 1;
58
+        Item[] items = {normalItem};
59
+        Inventory sut = new Inventory(items);
60
+
61
+        sut.updateQuality();
62
+
63
+        assertEquals(expectedQuality, normalItem.getQuality());
64
+    }
65
+
66
+    @Test
67
+    public void testUpdate_ForSoldOutItem() throws Exception {
68
+        int minimumQuality = 0;
69
+        Item normalItemWithMinimumQuality = new Item(NORMAL_ITEM_NAME, 10, minimumQuality);
70
+        Item[] items = {normalItemWithMinimumQuality};
71
+        Inventory sut = new Inventory(items);
72
+
73
+        sut.updateQuality();
74
+
75
+        assertEquals(minimumQuality, normalItemWithMinimumQuality.getQuality());
76
+    }
77
+
78
+    @Test
79
+    public void testUpdate_ForNormalItemOnceTheSellInDatePassed() throws Exception {
80
+        Item normalItemWithPassedSellDate = new Item(NORMAL_ITEM_NAME, -1, 25);
81
+        int expectedQuality = normalItemWithPassedSellDate.getQuality() - 2;
82
+        Item[] items = {normalItemWithPassedSellDate};
83
+        Inventory sut = new Inventory(items);
84
+
85
+        sut.updateQuality();
86
+
87
+        assertEquals(expectedQuality, normalItemWithPassedSellDate.getQuality());
88
+    }
89
+
90
+    @Test
91
+    public void testUpdate_AgedBrie() throws Exception {
92
+        Item agedBrie = new Item(AGED_BRIE_NAME, 10, 25);
93
+        int expectedQuality = agedBrie.getQuality() + 1;
94
+        Item[] items = {agedBrie};
95
+        Inventory sut = new Inventory(items);
96
+
97
+        sut.updateQuality();
98
+
99
+        assertEquals(expectedQuality, agedBrie.getQuality());
100
+    }
101
+
102
+    @Test
103
+    public void testUpdate_WhenAgedBrieIsAtMaxQuality() throws Exception {
104
+        Item agedBrie = new Item(AGED_BRIE_NAME, 10, MAX_QUALITY);
105
+        Item[] items = {agedBrie};
106
+        Inventory sut = new Inventory(items);
107
+
108
+        sut.updateQuality();
109
+
110
+        assertEquals(MAX_QUALITY, agedBrie.getQuality());
111
+    }
112
+
113
+    @Test
114
+    public void testUpdate_WhenAgedBrieOnceTheSellInDatePassed() throws Exception {
115
+        Item agedBrie = new Item(AGED_BRIE_NAME, -1, 20);
116
+        int expectedQuality = agedBrie.getQuality() + 2;
117
+        Item[] items = {agedBrie};
118
+        Inventory sut = new Inventory(items);
119
+
120
+        sut.updateQuality();
121
+
122
+        assertEquals(expectedQuality, agedBrie.getQuality());
123
+    }
124
+}

二進制
target/classes/kleankode/Inventory.class 查看文件


二進制
target/classes/kleankode/Item.class 查看文件


二進制
target/test-classes/kleankode/InventoryTest.class 查看文件