updated test case to build serialized hashmap for CWE version 2.5 for issue #68

Former-commit-id: 9246126c1915e65862fddf2fe57a1cf58a2d8401
This commit is contained in:
Jeremy Long
2014-02-14 22:15:13 -05:00
parent 1eb1329f68
commit f9d01d2fad

View File

@@ -59,11 +59,26 @@ public class CweDBTest {
// SAXParser saxParser = factory.newSAXParser();
//
// CweHandler handler = new CweHandler();
// File file = new File(this.getClass().getClassLoader().getResource("cwe.2000.xml").getPath());
// //File file = new File(this.getClass().getClassLoader().getResource("cwe.2000.xml").getPath());
// File file = new File(this.getClass().getClassLoader().getResource("cwec_v2.5.xml").getPath());
//
// saxParser.parse(file, handler);
// System.out.println("Found " + handler.getCwe().size() + " cwe entries.");
// Map<String,String> cwe = handler.getCwe();
// Map<String, String> cwe = handler.getCwe();
//// FileOutputStream fout = new FileOutputStream("target/current.csv");
//// //FileOutputStream fout = new FileOutputStream("target/new.csv");
//// PrintWriter writer = new PrintWriter(fout);
//// for (Map.Entry<String, String> entry : cwe.entrySet()) {
//// writer.print('"');
//// writer.print(entry.getKey());
//// writer.print('"');
//// writer.print(',');
//// writer.print('"');
//// writer.print(entry.getValue());
//// writer.println('"');
//// }
//// writer.close();
//
// FileOutputStream fout = new FileOutputStream("src/main/resources/data/cwe.hashmap.serialized");
// ObjectOutputStream objOut = new ObjectOutputStream(fout);
// objOut.writeObject(cwe);