diff --git a/src/main/java/fr/inria/coming/core/engine/files/FilePair.java b/src/main/java/fr/inria/coming/core/engine/files/FilePair.java index 3d6bed03..8086c9c4 100644 --- a/src/main/java/fr/inria/coming/core/engine/files/FilePair.java +++ b/src/main/java/fr/inria/coming/core/engine/files/FilePair.java @@ -33,6 +33,9 @@ public String getNextVersion() { } @Override + // TODO this should return a file + // because the convention on the "name" is unclear + // a file name? or a valid file path? public String getNextName() { return postName; } diff --git a/src/test/java/fr/inria/coming/spoon/patterns/InstanceMiningTest.java b/src/test/java/fr/inria/coming/spoon/patterns/InstanceMiningTest.java index d3b30f7a..ea0f88f6 100644 --- a/src/test/java/fr/inria/coming/spoon/patterns/InstanceMiningTest.java +++ b/src/test/java/fr/inria/coming/spoon/patterns/InstanceMiningTest.java @@ -489,6 +489,7 @@ private void runnerMainPatterngeneric(String action, String entitytype, String e public void assertResult(Set commitsId, FinalResult finalResult) { CommitFinalResult commitResult = (CommitFinalResult) finalResult; System.out.println("FinalResults: \n" + finalResult); + Commit found = null; for (Commit commit : commitResult.getAllResults().keySet()) { PatternInstancesFromRevision patterns = (PatternInstancesFromRevision) commitResult.getAllResults() @@ -496,17 +497,23 @@ public void assertResult(Set commitsId, FinalResult finalResult) { assertNotNull(patterns); if (commitsId.contains(commit.getName())) { + found = commit; assertTrue("Not changes at: " + commit.getName(), patterns.getInfoPerDiff().size() > 0); System.out.println("Instance found: " + patterns.getInfoPerDiff()); for (PatternInstancesFromDiff instancesdiff : patterns.getInfoPerDiff()) { - assertTrue(instancesdiff.getInstances().size() > 0); + // + if (instancesdiff.getInstances().size() > 0) { + return; + } } + throw new AssertionError("No instances found at: " + commit.getName() + " but expected"); } else { // firsts commits, no changes, file introduction - // assertTrue(patterns.getInstances().isEmpty()); } - + } + if (found == null) { + throw new AssertionError("No commit found with the expected instances"); } }