From 1b0565b1f6b4d5009da689ba5d486bce203e4905 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Tue, 7 Jul 2015 00:02:23 +1000 Subject: Run less tests (to make them faster) --- .../java/au/id/zancanaro/javacheck/ListFunctorRulesTest.java | 9 +++------ .../java/au/id/zancanaro/javacheck/OptionalFunctorRulesTest.java | 9 +++------ .../java/au/id/zancanaro/javacheck/SimpleListOperationsTest.java | 7 ++----- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/test/java/au/id/zancanaro/javacheck/ListFunctorRulesTest.java b/src/test/java/au/id/zancanaro/javacheck/ListFunctorRulesTest.java index 4100378..8d6cd88 100644 --- a/src/test/java/au/id/zancanaro/javacheck/ListFunctorRulesTest.java +++ b/src/test/java/au/id/zancanaro/javacheck/ListFunctorRulesTest.java @@ -16,9 +16,6 @@ import static org.junit.Assert.assertEquals; @RunWith(Properties.class) public class ListFunctorRulesTest { - private final static int runs = 1000; - private final static int maxSize = 1000; - @DataSource public static Generator> integerFunction = oneOf( @@ -26,7 +23,7 @@ public class ListFunctorRulesTest { longInteger().map(ListFunctorRulesTest::timesI), longInteger().map(ListFunctorRulesTest::constantlyI)); - @Property(maxSize = maxSize, runs = runs) + @Property public void mappingCompositionsWithStreams( List list, Function f, @@ -43,7 +40,7 @@ public class ListFunctorRulesTest { assertEquals(left, right); } - @Property(maxSize = maxSize, runs = runs) + @Property public void mappingCompositionsWithIntermediateList( List list, Function f, @@ -58,7 +55,7 @@ public class ListFunctorRulesTest { assertEquals(left, right); } - @Property(maxSize = maxSize, runs = runs) + @Property public void mapIdentityIsIdentity(List list) { List mapped = list.stream().map(x -> x).collect(Collectors.toList()); diff --git a/src/test/java/au/id/zancanaro/javacheck/OptionalFunctorRulesTest.java b/src/test/java/au/id/zancanaro/javacheck/OptionalFunctorRulesTest.java index b13fb8b..5ef552e 100644 --- a/src/test/java/au/id/zancanaro/javacheck/OptionalFunctorRulesTest.java +++ b/src/test/java/au/id/zancanaro/javacheck/OptionalFunctorRulesTest.java @@ -16,9 +16,6 @@ import static org.junit.Assert.assertEquals; @RunWith(Properties.class) public class OptionalFunctorRulesTest { - private final static int runs = 1000; - private final static int maxSize = 1000; - @DataSource public static Generator> listOfIntegers = oneOf( pure(Optional.empty()), @@ -31,7 +28,7 @@ public class OptionalFunctorRulesTest { integer().map(OptionalFunctorRulesTest::timesI), integer().map(OptionalFunctorRulesTest::constantlyI)); - @Property(maxSize = maxSize, runs = runs) + @Property public void mappingCompositionsWithStreams( Optional optional, Function f, @@ -46,7 +43,7 @@ public class OptionalFunctorRulesTest { assertEquals(left, right); } - @Property(maxSize = maxSize, runs = runs) + @Property public void mappingCompositionsWithIntermediateList( Optional optional, Function f, @@ -60,7 +57,7 @@ public class OptionalFunctorRulesTest { assertEquals(left, right); } - @Property(maxSize = maxSize, runs = runs) + @Property public void mapIdentityIsIdentity(Optional optional) { Optional mapped = optional.map(x -> x); diff --git a/src/test/java/au/id/zancanaro/javacheck/SimpleListOperationsTest.java b/src/test/java/au/id/zancanaro/javacheck/SimpleListOperationsTest.java index 3f4d58b..3cfef37 100644 --- a/src/test/java/au/id/zancanaro/javacheck/SimpleListOperationsTest.java +++ b/src/test/java/au/id/zancanaro/javacheck/SimpleListOperationsTest.java @@ -14,10 +14,7 @@ import static org.junit.Assert.assertEquals; @RunWith(Properties.class) public class SimpleListOperationsTest { - private final static int runs = 1000; - private final static int maxSize = 1000; - - @Property(maxSize = maxSize, runs = runs) + @Property public void sortingIsIdempotent(List list) { List left = new ArrayList<>(list); sort(left); @@ -29,7 +26,7 @@ public class SimpleListOperationsTest { assertEquals(left, right); } - @Property(maxSize = 100, runs = runs) + @Property public void reverseIsItsOwnInverse(List list) { List reversed = new ArrayList<>(list); reverse(reversed); -- cgit v1.2.3