Skip to content
This repository was archived by the owner on Oct 13, 2020. It is now read-only.

Commit bf7fd61

Browse files
committedDec 11, 2014
Merge commit '940f9d0406114b37978e3864d00563bdff752599'
2 parents 58b90fe + 940f9d0 commit bf7fd61

Some content is hidden

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

51 files changed

+1998
-893
lines changed
 

‎theories/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
target
2+
.idea/
23
*.iml
34
*.ipr
45
*.iws

‎theories/README.md

+23-7
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ JUnit Theories Runner
33

44
This is a port of the JUnit theories runner into junit.contrib.
55

6-
In addition to being current with the theories implementation in the latest release of JUnit and
6+
In addition to being current with the theories implementation in JUnit 4.12 and
77
depending on its core, this implementation contains a resolution for
8-
[JUnit GitHub issue 64](http://github.com/KentBeck/junit/issues/64), making it possible for
8+
[JUnit GitHub issue 64](http://github.com/junit-team/junit/issues/64), making it possible for
99
[junit-quickcheck](http://github.com/pholser/junit-quickcheck) to generate values for theory
1010
parameters involving generics in a safe manner.
1111

@@ -14,8 +14,24 @@ so that the one in the core can be removed, meaning that this runner can evolve
1414
releases of JUnit.
1515

1616
**PLEASE NOTE**: The classes that comprise this rendition of the JUnit theories runner are packaged
17-
as `org.junit.contrib.theories.*`, rather than `org.junit.experimental.theories.*`. Be careful not
18-
to intermix the two.
17+
as `org.junit.contrib.theories.*`, rather than `org.junit.experimental.theories.*`. Be mindful of
18+
which one you're using.
19+
20+
## Downloading
21+
22+
Releases are synced to the central Maven repository. Declare a dependency element in your POM like so:
23+
24+
...
25+
<dependencies>
26+
...
27+
<dependency>
28+
<groupId>org.junit.contrib</groupId>
29+
<artifactId>junit-theories</artifactId>
30+
<version>4.12</version>
31+
</dependency>
32+
...
33+
</dependencies>
34+
...
1935

2036
### What is a theory?
2137

@@ -84,9 +100,9 @@ We can eliminate duplicated test logic sometimes by using parameterized tests:
84100
Neither of these tests expresses important characteristics we want the the answers given by
85101
`PrimeFactors.of()` to exhibit: No matter what positive integer you give the method...
86102

87-
* The factors should be prime
88-
* The factors should multiply together to give the original integer
89-
* No two factorizations of two distinct integers are identical
103+
* The factors must be prime
104+
* The factors must multiply together to give the original integer
105+
* Factorizations of two distinct integers must themselves be distinct (the Fundamental Theorem of Arithmetic)
90106

91107
Whenever we want to express characteristics of a test subject that hold for entire classes of
92108
inputs, and we can express the characteristics in terms of inputs and outputs, we can codify these

0 commit comments

Comments
 (0)