diff options
author | Carlo Zancanaro <carlo@zancanaro.id.au> | 2015-06-09 23:58:41 +1000 |
---|---|---|
committer | Carlo Zancanaro <carlo@zancanaro.id.au> | 2015-06-09 23:58:41 +1000 |
commit | 6546881559e4bbcfe2b220199a9f3cd4196d1960 (patch) | |
tree | 16244beed46eff76b65d1e5304cae4591b7db7ee /src/main/java/au/id/zancanaro/javacheck/junit/Properties.java | |
parent | 40961d4950c40643d5d71721a7e024e3951323ce (diff) |
A few changes, as suggested by static analysis
Diffstat (limited to 'src/main/java/au/id/zancanaro/javacheck/junit/Properties.java')
-rw-r--r-- | src/main/java/au/id/zancanaro/javacheck/junit/Properties.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/main/java/au/id/zancanaro/javacheck/junit/Properties.java b/src/main/java/au/id/zancanaro/javacheck/junit/Properties.java index a7bf19b..c428edc 100644 --- a/src/main/java/au/id/zancanaro/javacheck/junit/Properties.java +++ b/src/main/java/au/id/zancanaro/javacheck/junit/Properties.java @@ -27,11 +27,6 @@ public class Properties extends BlockJUnit4ClassRunner { } @Override - protected void collectInitializationErrors(List<Throwable> errors) { - super.collectInitializationErrors(errors); - } - - @Override protected void validateConstructor(List<Throwable> errors) { validateOnlyOneConstructor(errors); } @@ -109,7 +104,7 @@ public class Properties extends BlockJUnit4ClassRunner { } catch (AssumptionViolatedException ex) { numTests++; if (assumptionsViolated++ == 50) { - throw new Error("Violated 50 assumptions in a row: failing test"); + throw new Error("Violated 50 assumptions in a row: failing test", ex); } } catch (Throwable ex) { throw new PropertyError(method.getName(), seed, shrink(tree, ex)); @@ -130,9 +125,11 @@ public class Properties extends BlockJUnit4ClassRunner { Iterator<ShrinkTree<List<Object>>> trees = failed.getChildren().iterator(); while (trees.hasNext()) { ShrinkTree<List<Object>> tree = trees.next(); - if (seenArgs.add(Arrays.asList(tree.getValue()))) { + List<Object> value = tree.getValue(); + boolean haveSeen = seenArgs.add(Arrays.asList(value)); + if (haveSeen) { try { - runTest(tree.getValue().toArray()); + runTest(value.toArray()); } catch (AssumptionViolatedException ex) { // ignore, because it's not useful } catch (Throwable ex) { |