Add the concept of "Project Name" to the RUNS table in the database.
[cfb.git] / test / net / jaekl / cfb / analyze / AnalysisTest.java
index f0b28c78db075e6f6ca9483b976f5be3b3ed59ee..e874412281d6b2ca2189290600f9de5ae121d2f3 100644 (file)
@@ -6,6 +6,7 @@ import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.nio.charset.Charset;
 import java.util.HashMap;
+import java.util.List;
 
 import net.jaekl.cfb.xml.BugCollection;
 import net.jaekl.cfb.xml.BugInstance;
@@ -60,20 +61,20 @@ public class AnalysisTest {
                try ( ByteArrayInputStream bais = new ByteArrayInputStream(SAMPLE1_XML.getBytes(utf8)))
                {
                        InputSource inputSource = new InputSource(bais); 
-                       Analysis analysis = new Analysis(null);
+                       Analysis analysis = new Analysis(null, null);
                        analysis.parse(inputSource);
                        
                        assertNotNull(analysis);
                        
                        BugCollection bugColl = analysis.getBugCollection();
+                       List<BugInstance> bugs = bugColl.getBugs();
                        
                        assertNotNull(bugColl);
-                       assertEquals(2, bugColl.size());
+                       assertEquals(2, bugs.size());
                        
                        HashMap<String, BugInstance> typeMap = new HashMap<String, BugInstance>();
-                       for (int idx = 0; idx < bugColl.size(); ++idx) {
-                               inst = bugColl.get(idx);
-                               typeMap.put(inst.getType(), inst);
+                       for (BugInstance bug : bugs) {
+                               typeMap.put(bug.getType(), bug);
                        }
                        
                        inst = typeMap.get("DM_DEFAULT_ENCODING");