X-Git-Url: http://jaekl.net/gitweb/?p=cfb.git;a=blobdiff_plain;f=test%2Fnet%2Fjaekl%2Fcfb%2Fanalyze%2FDeltaTest.java;h=cb2222c77f35d31152852aaa0d3fb093b8cbdfd4;hp=04f1dcd4338d9dab398f884e706460967a3555af;hb=bedb0c5b72bcbbbcc2b8d11575ad99489aef6853;hpb=e39cfda923b6edce0fb80211cc927a7534abba10 diff --git a/test/net/jaekl/cfb/analyze/DeltaTest.java b/test/net/jaekl/cfb/analyze/DeltaTest.java index 04f1dcd..cb2222c 100644 --- a/test/net/jaekl/cfb/analyze/DeltaTest.java +++ b/test/net/jaekl/cfb/analyze/DeltaTest.java @@ -44,7 +44,6 @@ public class DeltaTest { + "\n" + "\n"; - /* private static String VO_VOLATILE_INCREMENT = "" + "" + "" @@ -58,7 +57,6 @@ public class DeltaTest { + "" + "" + ""; - */ private static final String DM_NUMBER_CTOR_156 = "" + "" @@ -189,7 +187,8 @@ public class DeltaTest { } @Test - public void test_computeDeltas() throws FileNotFoundException, IOException, SAXException { + public void test_computeDeltas() throws FileNotFoundException, IOException, SAXException + { String[][] bugSpecs = { { DM_DEFAULT_ENCODING, "DM_DEFAULT_ENCODING" }, { RCN_REDUNDANT_NULL_CHECK, "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" }, @@ -208,4 +207,29 @@ public class DeltaTest { } } + @Test + public void test_deltaWithNoPrior() throws FileNotFoundException, IOException, SAXException + { + String[][] bugSpecs = { + { DM_DEFAULT_ENCODING, "DM_DEFAULT_ENCODING" }, + { RCN_REDUNDANT_NULL_CHECK, "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" }, + { VO_VOLATILE_INCREMENT, "VO_VOLATILE_INCREMENT" }, + { DM_NUMBER_CTOR_156, "DM_NUMBER_CTOR" }, + { DM_NUMBER_CTOR_169, "DM_NUMBER_CTOR" } + }; + + final String PROJECT_NAME = "AlphaOne"; + String secondXml = buildXml(bugSpecs, 0, bugSpecs.length - 1); + + Analysis second = analysisFromXml(secondXml, PROJECT_NAME, "1.0.1"); + + Delta delta = new Delta(null, second); + + assertNotNull(delta); + for (int i = 0; i < bugSpecs.length; ++i) { + assertFalse(contains(delta.getCommon(), bugSpecs[i][1])); + assertFalse(contains(delta.getFixed(), bugSpecs[i][1])); + assertTrue(contains(delta.getNew(), bugSpecs[i][1])); + } + } }