Преглед изворни кода

remove method. 100% coverage

jasamuels пре 6 година
родитељ
комит
4fb53ccdb9
3 измењених фајлова са 55 додато и 27 уклоњено
  1. 45
    26
      .idea/workspace.xml
  2. 1
    1
      src/main/java/MyArrayList.java
  3. 9
    0
      src/test/java/MyArrayListTest.java

+ 45
- 26
.idea/workspace.xml Прегледај датотеку

@@ -2,9 +2,8 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="2eeaadab-5121-4f8c-9df4-6e07385b37e8" name="Default Changelist" comment="">
5
-      <change afterPath="$PROJECT_DIR$/src/main/java/MyArrayList.java" afterDir="false" />
6
-      <change afterPath="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" afterDir="false" />
7
-      <change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
5
+      <change beforePath="$PROJECT_DIR$/src/main/java/MyArrayList.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/MyArrayList.java" afterDir="false" />
6
+      <change beforePath="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" afterDir="false" />
8 7
     </list>
9 8
     <ignored path="$PROJECT_DIR$/target/" />
10 9
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -15,6 +14,7 @@
15 14
   </component>
16 15
   <component name="CoverageDataManager">
17 16
     <SUITE FILE_PATH="coverage/generics$MyArrayListTest_addTest.ic" NAME="MyArrayListTest.addTest Coverage Results" MODIFIED="1542750815105" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
17
+    <SUITE FILE_PATH="coverage/generics$MyArrayListTest_getTest.ic" NAME="MyArrayListTest.getTest Coverage Results" MODIFIED="1542751525168" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
18 18
   </component>
19 19
   <component name="DockManager">
20 20
     <window id="1">
@@ -24,8 +24,8 @@
24 24
             <file pinned="false" current-in-tab="true">
25 25
               <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
26 26
                 <provider selected="true" editor-type-id="text-editor">
27
-                  <state relative-caret-position="204">
28
-                    <caret line="15" column="8" lean-forward="true" selection-start-line="15" selection-start-column="8" selection-end-line="15" selection-end-column="8" />
27
+                  <state relative-caret-position="299">
28
+                    <caret line="20" column="32" selection-start-line="20" selection-start-column="32" selection-end-line="20" selection-end-column="32" />
29 29
                     <folding>
30 30
                       <element signature="e#120#121#0" expanded="true" />
31 31
                       <element signature="e#162#163#0" expanded="true" />
@@ -65,12 +65,12 @@
65 65
       </usages-collector>
66 66
       <usages-collector id="statistics.file.extensions.edit">
67 67
         <counts>
68
-          <entry key="java" value="1849" />
68
+          <entry key="java" value="1984" />
69 69
         </counts>
70 70
       </usages-collector>
71 71
       <usages-collector id="statistics.file.types.edit">
72 72
         <counts>
73
-          <entry key="JAVA" value="1849" />
73
+          <entry key="JAVA" value="1984" />
74 74
         </counts>
75 75
       </usages-collector>
76 76
     </session>
@@ -80,8 +80,8 @@
80 80
       <file pinned="false" current-in-tab="true">
81 81
         <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
82 82
           <provider selected="true" editor-type-id="text-editor">
83
-            <state relative-caret-position="465">
84
-              <caret line="31" lean-forward="true" selection-start-line="31" selection-end-line="31" />
83
+            <state relative-caret-position="540">
84
+              <caret line="36" column="5" lean-forward="true" selection-start-line="36" selection-start-column="5" selection-end-line="36" selection-end-column="5" />
85 85
               <folding>
86 86
                 <element signature="imports" expanded="true" />
87 87
               </folding>
@@ -106,8 +106,8 @@
106 106
       <list>
107 107
         <option value="$PROJECT_DIR$/src/main/java/Program.java" />
108 108
         <option value="$PROJECT_DIR$/src/test/java/ProgramTest.java" />
109
-        <option value="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" />
110 109
         <option value="$PROJECT_DIR$/src/main/java/MyArrayList.java" />
110
+        <option value="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" />
111 111
       </list>
112 112
     </option>
113 113
   </component>
@@ -187,7 +187,7 @@
187 187
   <component name="PropertiesComponent">
188 188
     <property name="WebServerToolWindowFactoryState" value="false" />
189 189
     <property name="aspect.path.notification.shown" value="true" />
190
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542750814879" />
190
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542751523139" />
191 191
     <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
192 192
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
193 193
     <property name="nodejs_npm_path_reset_for_default_project" value="true" />
@@ -204,7 +204,7 @@
204 204
       </list>
205 205
     </option>
206 206
   </component>
207
-  <component name="RunManager" selected="JUnit.MyArrayListTest.addTest">
207
+  <component name="RunManager" selected="JUnit.MyArrayListTest.getTest">
208 208
     <configuration name="MyArrayListTest.addTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
209 209
       <module name="generics" />
210 210
       <option name="PACKAGE_NAME" value="" />
@@ -215,6 +215,16 @@
215 215
         <option name="Make" enabled="true" />
216 216
       </method>
217 217
     </configuration>
218
+    <configuration name="MyArrayListTest.getTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
219
+      <module name="generics" />
220
+      <option name="PACKAGE_NAME" value="" />
221
+      <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
222
+      <option name="METHOD_NAME" value="getTest" />
223
+      <option name="TEST_OBJECT" value="method" />
224
+      <method v="2">
225
+        <option name="Make" enabled="true" />
226
+      </method>
227
+    </configuration>
218 228
     <configuration name="ProgramTest.TestCase4" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
219 229
       <module name="generics" />
220 230
       <option name="PACKAGE_NAME" value="" />
@@ -228,9 +238,11 @@
228 238
     <list>
229 239
       <item itemvalue="JUnit.ProgramTest.TestCase4" />
230 240
       <item itemvalue="JUnit.MyArrayListTest.addTest" />
241
+      <item itemvalue="JUnit.MyArrayListTest.getTest" />
231 242
     </list>
232 243
     <recent_temporary>
233 244
       <list>
245
+        <item itemvalue="JUnit.MyArrayListTest.getTest" />
234 246
         <item itemvalue="JUnit.MyArrayListTest.addTest" />
235 247
         <item itemvalue="JUnit.ProgramTest.TestCase4" />
236 248
       </list>
@@ -247,7 +259,7 @@
247 259
       <option name="presentableId" value="Default" />
248 260
       <updated>1542726854451</updated>
249 261
       <workItem from="1542726855981" duration="2759000" />
250
-      <workItem from="1542732517986" duration="5180000" />
262
+      <workItem from="1542732517986" duration="5710000" />
251 263
     </task>
252 264
     <servers />
253 265
   </component>
@@ -270,9 +282,15 @@
270 282
     <history-entry file="MyArrayListTest_addTest - 2018.11.20 at 16h 46m 30s.xml">
271 283
       <configuration name="MyArrayListTest.addTest" configurationId="JUnit" />
272 284
     </history-entry>
285
+    <history-entry file="MyArrayListTest_addTest - 2018.11.20 at 16h 53m 18s.xml">
286
+      <configuration name="MyArrayListTest.addTest" configurationId="JUnit" />
287
+    </history-entry>
288
+    <history-entry file="MyArrayListTest_addTest - 2018.11.20 at 16h 53m 39s.xml">
289
+      <configuration name="MyArrayListTest.addTest" configurationId="JUnit" />
290
+    </history-entry>
273 291
   </component>
274 292
   <component name="TimeTrackingManager">
275
-    <option name="totallyTimeSpent" value="7939000" />
293
+    <option name="totallyTimeSpent" value="8469000" />
276 294
   </component>
277 295
   <component name="ToolWindowManager">
278 296
     <frame x="654" y="-1057" width="960" height="1057" extended-state="0" />
@@ -288,7 +306,7 @@
288 306
       <window_info anchor="bottom" id="Messages" />
289 307
       <window_info anchor="bottom" id="Message" order="0" />
290 308
       <window_info anchor="bottom" id="Find" order="1" visible="true" weight="0.4660767" />
291
-      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.22287968" />
309
+      <window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.22287968" />
292 310
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
293 311
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
294 312
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
@@ -297,6 +315,7 @@
297 315
       <window_info anchor="bottom" id="Terminal" order="8" />
298 316
       <window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
299 317
       <window_info anchor="bottom" id="Version Control" order="10" show_stripe_button="false" />
318
+      <window_info anchor="right" id="Coverage" side_tool="true" weight="0.2211329" />
300 319
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
301 320
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
302 321
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
@@ -343,25 +362,25 @@
343 362
         </state>
344 363
       </provider>
345 364
     </entry>
346
-    <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
365
+    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
347 366
       <provider selected="true" editor-type-id="text-editor">
348
-        <state relative-caret-position="465">
349
-          <caret line="31" lean-forward="true" selection-start-line="31" selection-end-line="31" />
367
+        <state relative-caret-position="299">
368
+          <caret line="20" column="32" selection-start-line="20" selection-start-column="32" selection-end-line="20" selection-end-column="32" />
350 369
           <folding>
351
-            <element signature="imports" expanded="true" />
370
+            <element signature="e#120#121#0" expanded="true" />
371
+            <element signature="e#162#163#0" expanded="true" />
372
+            <element signature="e#784#785#0" expanded="true" />
373
+            <element signature="e#816#817#0" expanded="true" />
352 374
           </folding>
353 375
         </state>
354 376
       </provider>
355 377
     </entry>
356
-    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
378
+    <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
357 379
       <provider selected="true" editor-type-id="text-editor">
358
-        <state relative-caret-position="204">
359
-          <caret line="15" column="8" lean-forward="true" selection-start-line="15" selection-start-column="8" selection-end-line="15" selection-end-column="8" />
380
+        <state relative-caret-position="540">
381
+          <caret line="36" column="5" lean-forward="true" selection-start-line="36" selection-start-column="5" selection-end-line="36" selection-end-column="5" />
360 382
           <folding>
361
-            <element signature="e#120#121#0" expanded="true" />
362
-            <element signature="e#162#163#0" expanded="true" />
363
-            <element signature="e#784#785#0" expanded="true" />
364
-            <element signature="e#816#817#0" expanded="true" />
383
+            <element signature="imports" expanded="true" />
365 384
           </folding>
366 385
         </state>
367 386
       </provider>

+ 1
- 1
src/main/java/MyArrayList.java Прегледај датотеку

@@ -18,7 +18,7 @@ public class MyArrayList <T> {
18 18
 
19 19
     public T get(int index){
20 20
 
21
-        return null;
21
+        return container[index];
22 22
 
23 23
     }
24 24
 

+ 9
- 0
src/test/java/MyArrayListTest.java Прегледај датотеку

@@ -27,4 +27,13 @@ public class MyArrayListTest {
27 27
 
28 28
     }
29 29
 
30
+    @Test
31
+    public void getTest(){
32
+
33
+        //Assert
34
+        String expected = "hello";
35
+        Assert.assertEquals(expected, list.get(0));
36
+
37
+    }
38
+
30 39
 }