Skip to content

Commit 2926fdc

Browse files
committed
Split API and engine
fixes #254
1 parent cc40e74 commit 2926fdc

File tree

194 files changed

+645
-254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+645
-254
lines changed

core-api/pom.xml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
4+
<parent>
5+
<groupId>com.pholser</groupId>
6+
<artifactId>junit-quickcheck</artifactId>
7+
<version>0.10-SNAPSHOT</version>
8+
</parent>
9+
10+
<artifactId>junit-quickcheck-core-api</artifactId>
11+
<version>0.10-SNAPSHOT</version>
12+
<packaging>jar</packaging>
13+
<name>junit-quickcheck-core-api</name>
14+
<description>Property-based testing, JUnit-style: core functionality</description>
15+
<url>http://github.com/pholser/junit-quickcheck</url>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.javaruntype</groupId>
20+
<artifactId>javaruntype</artifactId>
21+
</dependency>
22+
23+
<dependency>
24+
<groupId>junit</groupId>
25+
<artifactId>junit</artifactId>
26+
<scope>test</scope>
27+
</dependency>
28+
<dependency>
29+
<groupId>org.hamcrest</groupId>
30+
<artifactId>hamcrest-core</artifactId>
31+
<scope>test</scope>
32+
</dependency>
33+
<dependency>
34+
<groupId>org.hamcrest</groupId>
35+
<artifactId>hamcrest-library</artifactId>
36+
<scope>test</scope>
37+
</dependency>
38+
<dependency>
39+
<groupId>org.mockito</groupId>
40+
<artifactId>mockito-all</artifactId>
41+
<scope>test</scope>
42+
</dependency>
43+
<dependency>
44+
<groupId>ch.qos.logback</groupId>
45+
<artifactId>logback-classic</artifactId>
46+
<scope>test</scope>
47+
</dependency>
48+
</dependencies>
49+
50+
<build>
51+
<plugins>
52+
<plugin>
53+
<groupId>org.apache.maven.plugins</groupId>
54+
<artifactId>maven-release-plugin</artifactId>
55+
</plugin>
56+
<plugin>
57+
<groupId>org.apache.maven.plugins</groupId>
58+
<artifactId>maven-compiler-plugin</artifactId>
59+
</plugin>
60+
<plugin>
61+
<groupId>org.jacoco</groupId>
62+
<artifactId>jacoco-maven-plugin</artifactId>
63+
</plugin>
64+
<plugin>
65+
<groupId>org.apache.maven.plugins</groupId>
66+
<artifactId>maven-checkstyle-plugin</artifactId>
67+
</plugin>
68+
<plugin>
69+
<groupId>org.apache.maven.plugins</groupId>
70+
<artifactId>maven-pmd-plugin</artifactId>
71+
</plugin>
72+
<plugin>
73+
<groupId>org.codehaus.mojo</groupId>
74+
<artifactId>findbugs-maven-plugin</artifactId>
75+
</plugin>
76+
</plugins>
77+
</build>
78+
</project>

core/src/main/java/com/pholser/junit/quickcheck/From.java renamed to core-api/src/main/java/com/pholser/junit/quickcheck/From.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ a copy of this software and associated documentation files (the
2929
import java.lang.annotation.Retention;
3030
import java.lang.annotation.Target;
3131

32-
import com.pholser.junit.quickcheck.generator.Generator;
33-
3432
import static java.lang.annotation.ElementType.*;
3533
import static java.lang.annotation.RetentionPolicy.*;
3634

35+
import com.pholser.junit.quickcheck.generator.Generator;
36+
3737
/**
3838
* <p>Mark a parameter of a {@link Property} method with this annotation to
3939
* have random values supplied to it via the specified

core/src/main/java/com/pholser/junit/quickcheck/Mode.java renamed to core-api/src/main/java/com/pholser/junit/quickcheck/Mode.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ a copy of this software and associated documentation files (the
2525

2626
package com.pholser.junit.quickcheck;
2727

28-
import com.pholser.junit.quickcheck.internal.ParameterSampler;
29-
import com.pholser.junit.quickcheck.internal.sampling.ExhaustiveParameterSampler;
30-
import com.pholser.junit.quickcheck.internal.sampling.TupleParameterSampler;
31-
3228
/**
3329
* Represents different modes of execution of property-based tests.
3430
*
@@ -40,23 +36,13 @@ public enum Mode {
4036
* Verify {@link Property#trials()} tuples of arguments for a property's
4137
* parameters.
4238
*/
43-
SAMPLING {
44-
@Override ParameterSampler sampler(int defaultSampleSize) {
45-
return new TupleParameterSampler(defaultSampleSize);
46-
}
47-
},
39+
SAMPLING,
4840

4941
/**
5042
* Generate {@link Property#trials()} arguments for each parameter
5143
* property, and verify the cross-products of those sets of arguments.
5244
* This behavior mirrors that of the JUnit
5345
* {@link org.junit.experimental.theories.Theories} runner.
5446
*/
55-
EXHAUSTIVE {
56-
@Override ParameterSampler sampler(int defaultSampleSize) {
57-
return new ExhaustiveParameterSampler(defaultSampleSize);
58-
}
59-
};
60-
61-
abstract ParameterSampler sampler(int defaultSampleSize);
47+
EXHAUSTIVE;
6248
}

core/src/main/java/com/pholser/junit/quickcheck/Pair.java renamed to core-api/src/main/java/com/pholser/junit/quickcheck/Pair.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,16 @@ a copy of this software and associated documentation files (the
2525

2626
package com.pholser.junit.quickcheck;
2727

28+
import com.pholser.junit.quickcheck.generator.Gen;
29+
2830
import java.util.Objects;
2931

3032
/**
3133
* Typed pair of elements.
3234
*
3335
* @param <F> type of first element of pair
3436
* @param <S> type of second element of pair
35-
* @see com.pholser.junit.quickcheck.generator.Gen#frequency(Pair, Pair[])
37+
* @see Gen#frequency(Pair, Pair[])
3638
*/
3739
public final class Pair<F, S> {
3840
public final F first;

core/src/main/java/com/pholser/junit/quickcheck/Produced.java renamed to core-api/src/main/java/com/pholser/junit/quickcheck/Produced.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ a copy of this software and associated documentation files (the
3131
import static java.lang.annotation.ElementType.*;
3232
import static java.lang.annotation.RetentionPolicy.*;
3333

34+
import com.pholser.junit.quickcheck.generator.Generator;
35+
3436
/**
3537
* <p>Mark a parameter of a {@link Property} method with this annotation to
3638
* have random values supplied to it via one of the
37-
* {@link com.pholser.junit.quickcheck.generator.Generator}s specified by the
39+
* {@link Generator}s specified by the
3840
* aggregated {@link From} annotations.</p>
3941
*
4042
* <p>Alternatively, you can specify many generators via many repetitions of

0 commit comments

Comments
 (0)