Skip to content

Commit 3997816

Browse files
committed
Merge branch 'master' into concurrent-run-listeners
2 parents 10c5130 + dbe8a97 commit 3997816

39 files changed

+834
-97
lines changed

BUILDING

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
BUILDING FROM GITHUB:
22
=====================
33

4-
git clone https://github.com/KentBeck/junit.git
4+
git clone https://github.com/junit-team/junit.git
55
cd junit
66
mvn install
77

@@ -11,4 +11,4 @@ BUILDING FROM JARS OR ZIPS:
1111
The contents of the zip and jar files are largely maintained for historical
1212
reasons. We do not at this time have an official way to build from the src
1313
jar or zip. If this is an important missing feature, please let us know
14-
at http://github.com/KentBeck/junit/issues
14+
at http://github.com/junit-team/junit/issues

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks.
33

44
For more information, please visit:
5-
* [Wiki](https://github.com/KentBeck/junit/wiki)
6-
* [Download and Install guide](https://github.com/KentBeck/junit/wiki/Download-and-Install)
7-
* [Getting Started](https://github.com/KentBeck/junit/wiki/Getting-started)
5+
* [Wiki](https://github.com/junit-team/junit/wiki)
6+
* [Download and Install guide](https://github.com/junit-team/junit/wiki/Download-and-Install)
7+
* [Getting Started](https://github.com/junit-team/junit/wiki/Getting-started)
88

99
[![Latest Build Status](https://junit.ci.cloudbees.com/job/JUnit/badge/icon)](https://junit.ci.cloudbees.com/)
1010

acknowledgements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
reinholdfuereder@github For initial test for GH-39
8383

8484
2011 Apr 15
85-
ububenheimer@github for bug report https://github.com/KentBeck/junit/issues/208
85+
ububenheimer@github for bug report https://github.com/junit-team/junit/issues/208
8686

8787
2011 Apr 29
8888
reinholdfuereder@github: bug report, test, and fix for GH-38:
@@ -160,4 +160,4 @@
160160

161161
== NOTE: as of September 2011, we have stopped recording contributions here.
162162
For a full list of everyone who has contributed great bug reports and code, please see
163-
http://github.com/KentBeck/junit
163+
http://github.com/junit-team/junit

build/github_upload.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def list_files repos
155155
# setup
156156
login = `git config github.user`.chomp # your login for github
157157
token = `git config github.token`.chomp # your token for github
158-
repos = 'KentBeck/junit' # your repos name (like 'taberareloo')
158+
repos = 'junit-team/junit' # your repos name (like 'taberareloo')
159159
gh = Net::GitHub::Upload.new(
160160
:login => login,
161161
:token => token

build/maven/junit-dep-pom-template.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
</license>
4040
</licenses>
4141
<scm>
42-
<connection>scm:git:git://github.com/KentBeck/junit.git</connection>
43-
<developerConnection>scm:git:[email protected]:KentBeck/junit.git</developerConnection>
44-
<url>http://github.com/KentBeck/junit/tree/master</url>
42+
<connection>scm:git:git://github.com/junit-team/junit.git</connection>
43+
<developerConnection>scm:git:[email protected]:junit-team/junit.git</developerConnection>
44+
<url>http://github.com/junit-team/junit/tree/master</url>
4545
</scm>
4646
<developers>
4747
<developer>
@@ -50,4 +50,4 @@
5050
<email>[email protected]</email>
5151
</developer>
5252
</developers>
53-
</project>
53+
</project>

build/maven/junit-pom-template.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
</license>
3232
</licenses>
3333
<scm>
34-
<connection>scm:git:git://github.com/KentBeck/junit.git</connection>
35-
<developerConnection>scm:git:[email protected]:KentBeck/junit.git</developerConnection>
36-
<url>http://github.com/KentBeck/junit/tree/master</url>
34+
<connection>scm:git:git://github.com/junit-team/junit.git</connection>
35+
<developerConnection>scm:git:[email protected]:junit-team/junit.git</developerConnection>
36+
<url>http://github.com/junit-team/junit/tree/master</url>
3737
</scm>
3838
<developers>
3939
<developer>
@@ -65,4 +65,4 @@
6565
<properties>
6666
<jdk.version>1.5</jdk.version>
6767
</properties>
68-
</project>
68+
</project>

doc/ReleaseNotes4.10.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<h2>Summary of Changes in version 4.10 [unreleased!]</h2>
22

3-
<p>A full summary of commits between 4.9 and 4.10 is on <a href="https://github.com/KentBeck/junit/compare/r4.9...4.10">github</a></p>
3+
<p>A full summary of commits between 4.9 and 4.10 is on <a href="https://github.com/junit-team/junit/compare/r4.9...4.10">github</a></p>
44

55
<h3>junit-dep has correct contents</h3>
66

doc/ReleaseNotes4.10.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Thanks to a full cast of contributors of bug fixes and new features.
44

5-
A full summary of commits between 4.9 and 4.10 is on [github](https://github.com/KentBeck/junit/compare/r4.9...4.10)
5+
A full summary of commits between 4.9 and 4.10 is on [github](https://github.com/junit-team/junit/compare/r4.9...4.10)
66

77
### junit-dep has correct contents ###
88

doc/ReleaseNotes4.12.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Summary of changes in version 4.12 [unreleased!]
22

33
We collect release notes in the wiki:
4-
https://github.com/KentBeck/junit/wiki/4.12-release-notes
4+
https://github.com/junit-team/junit/wiki/4.12-release-notes
55

66
This file will be updated right before release.

doc/building-junit.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Steps to build junit:
33
- Must be manual
44
- Write release notes
55
- Not too tedious:
6-
- Push to github (dsaff _and_ KentBeck)
6+
- Push to github (junit-team)
77
- Run the mvn clean install
88
- If not done, update src/main/config/settings.xml in /private/.../settings.xml on CloudBees' webdav share.
99
- If not done, copy GnuPG keys in to ${gpg.homedir}. See settings.xml.
@@ -95,4 +95,4 @@ Steps to build junit:
9595
</profile>
9696
</profiles>
9797
</settings>
98-
===================================================================================
98+
===================================================================================

doc/homepage.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ <H2><A name=Developer></A>Get Involved</H2>
104104
href="http://sf.net/projects/junit">provided</A> for your submissions.
105105

106106
<br/>
107-
JUnit source code is now hosted on <a href="http://github.com/KentBeck/junit">GitHub</a>.
107+
JUnit source code is now hosted on <a href="http://github.com/junit-team/junit">GitHub</a>.
108108

109109
<hr WIDTH="100%">
110110
<font size="1">

pom.xml

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<name>JUnit contributors</name>
3535
<organization>JUnit</organization>
3636
<email>[email protected]</email>
37-
<url>https://github.com/KentBeck/junit/graphs/contributors</url>
37+
<url>https://github.com/junit-team/junit/graphs/contributors</url>
3838
<roles>
3939
<role>developers</role>
4040
</roles>
@@ -54,20 +54,20 @@
5454
</prerequisites>
5555

5656
<scm>
57-
<connection>scm:git:git://github.com/KentBeck/junit.git</connection>
58-
<developerConnection>scm:git:[email protected]:KentBeck/junit.git</developerConnection>
59-
<url>http://github.com/KentBeck/junit/tree/master</url>
57+
<connection>scm:git:git://github.com/junit-team/junit.git</connection>
58+
<developerConnection>scm:git:[email protected]:junit-team/junit.git</developerConnection>
59+
<url>http://github.com/junit-team/junit/tree/master</url>
6060
</scm>
6161
<issueManagement>
6262
<system>github</system>
63-
<url>https://github.com/KentBeck/junit/issues</url>
63+
<url>https://github.com/junit-team/junit/issues</url>
6464
</issueManagement>
6565
<ciManagement>
6666
<system>jenkins</system>
6767
<url>https://junit.ci.cloudbees.com/</url>
6868
</ciManagement>
6969
<distributionManagement>
70-
<downloadUrl>https://github.com/KentBeck/junit/wiki/Download-and-Install</downloadUrl>
70+
<downloadUrl>https://github.com/junit-team/junit/wiki/Download-and-Install</downloadUrl>
7171
<snapshotRepository>
7272
<id>junit-snapshot-repo</id>
7373
<name>Nexus Snapshot Repository</name>

src/main/java/org/junit/Assert.java

+29
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,35 @@ public static void assertArrayEquals(String message, Object[] expecteds,
295295
public static void assertArrayEquals(Object[] expecteds, Object[] actuals) {
296296
assertArrayEquals(null, expecteds, actuals);
297297
}
298+
299+
/**
300+
* Asserts that two boolean arrays are equal. If they are not, an
301+
* {@link AssertionError} is thrown with the given message. If
302+
* <code>expecteds</code> and <code>actuals</code> are <code>null</code>,
303+
* they are considered equal.
304+
*
305+
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
306+
* okay)
307+
* @param expecteds boolean array with expected values.
308+
* @param actuals boolean array with expected values.
309+
*/
310+
public static void assertArrayEquals(String message, boolean[] expecteds,
311+
boolean[] actuals) throws ArrayComparisonFailure {
312+
internalArrayEquals(message, expecteds, actuals);
313+
}
314+
315+
/**
316+
* Asserts that two boolean arrays are equal. If they are not, an
317+
* {@link AssertionError} is thrown. If <code>expected</code> and
318+
* <code>actual</code> are <code>null</code>, they are considered
319+
* equal.
320+
*
321+
* @param expecteds boolean array with expected values.
322+
* @param actuals boolean array with expected values.
323+
*/
324+
public static void assertArrayEquals(boolean[] expecteds, boolean[] actuals) {
325+
assertArrayEquals(null, expecteds, actuals);
326+
}
298327

299328
/**
300329
* Asserts that two byte arrays are equal. If they are not, an

src/main/java/org/junit/Test.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ private None() {
5959
}
6060

6161
/**
62-
* Optionally specify <code>expected</code>, a Throwable, to cause a test method to succeed iff
63-
* an exception of the specified class is thrown by the method.
62+
* Optionally specify <code>expected</code>, a Throwable, to cause a test method to succeed if
63+
* and only if an exception of the specified class is thrown by the method.
6464
*/
6565
Class<? extends Throwable> expected() default None.class;
6666

src/main/java/org/junit/experimental/categories/Categories.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@
7575
* </pre>
7676
*
7777
* @version 4.12
78-
* @see <a href="https://github.com/KentBeck/junit/wiki/Categories">Categories at JUnit wiki</a>
78+
* @see <a href="https://github.com/junit-team/junit/wiki/Categories">Categories at JUnit wiki</a>
7979
*/
8080
public class Categories extends Suite {
8181
// the way filters are implemented makes this unnecessarily complicated,
8282
// buggy, and difficult to specify. A new way of handling filters could
8383
// someday enable a better new implementation.
84-
// https://github.com/KentBeck/junit/issues/issue/172
84+
// https://github.com/junit-team/junit/issues/issue/172
8585

8686
@Retention(RetentionPolicy.RUNTIME)
8787
public @interface IncludeCategory {
@@ -387,4 +387,4 @@ private static Set<Class<?>> createSet(Class<?>... t) {
387387
}
388388
return set;
389389
}
390-
}
390+
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
package org.junit.experimental.theories;
22

3+
import static java.lang.annotation.ElementType.FIELD;
4+
import static java.lang.annotation.ElementType.METHOD;
5+
36
import java.lang.annotation.Retention;
47
import java.lang.annotation.RetentionPolicy;
8+
import java.lang.annotation.Target;
59

610
@Retention(RetentionPolicy.RUNTIME)
11+
@Target({FIELD, METHOD})
712
public @interface DataPoint {
8-
13+
String[] value() default {};
914
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,58 @@
11
package org.junit.experimental.theories;
22

3+
import static java.lang.annotation.ElementType.FIELD;
4+
import static java.lang.annotation.ElementType.METHOD;
5+
36
import java.lang.annotation.Retention;
47
import java.lang.annotation.RetentionPolicy;
8+
import java.lang.annotation.Target;
59

10+
/**
11+
* <p>
12+
* Annotating an array-typed field or method with &#064;DataPoints will cause
13+
* the values in the array (or returned array) to be used as potential
14+
* parameters for theories in that class, when run with the
15+
* {@link org.junit.experimental.theories.Theories Theories} runner.
16+
* </p>
17+
* <p>
18+
* DataPoints will only be considered as potential values for parameters for
19+
* which their types are assignable. When multiple sets of DataPoints exist with
20+
* overlapping types more control can be obtained by naming the DataPoints using
21+
* the value of this annotation, e.g. with
22+
* <code>&#064;DataPoints({"dataset1", "dataset2"})</code>, and then specifying
23+
* which named set to consider as potential values for each parameter using the
24+
* {@link org.junit.experimental.theories.FromDataPoints &#064;FromDataPoints}
25+
* annotation.
26+
* </p>
27+
* <p>
28+
* Parameters with no specified source (i.e. without &#064;FromDataPoints or
29+
* other {@link org.junit.experimental.theories.ParametersSuppliedBy
30+
* &#064;ParameterSuppliedBy} annotations) will use all DataPoints that are
31+
* assignable to the parameter type as potential values, including named sets of
32+
* DataPoints.
33+
* </p>
34+
*
35+
* <pre>
36+
* &#064;DataPoints
37+
* public static String[] dataPoints = new String[] { ... };
38+
*
39+
* &#064;DataPoints
40+
* public static String[] generatedDataPoints() {
41+
* return new String[] { ... };
42+
* }
43+
*
44+
* &#064;Theory
45+
* public void theoryMethod(String param) {
46+
* ...
47+
* }</pre>
48+
*
49+
* @see org.junit.experimental.theories.Theories
50+
* @see org.junit.experimental.theories.Theory
51+
* @see org.junit.experimental.theories.DataPoint
52+
* @see org.junit.experimental.theories.FromDataPoints
53+
*/
654
@Retention(RetentionPolicy.RUNTIME)
55+
@Target({FIELD, METHOD})
756
public @interface DataPoints {
8-
57+
String[] value() default {};
958
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package org.junit.experimental.theories;
2+
3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
8+
import org.junit.experimental.theories.internal.SpecificDataPointsSupplier;
9+
10+
/**
11+
* <p>
12+
* Annotating a parameter of a {@link org.junit.experimental.theories.Theory
13+
* &#064Theory} method with <code>&#064;FromDataPoints</code> will limit the
14+
* datapoints considered as potential values for that parameter to just the
15+
* {@link org.junit.experimental.theories.DataPoints DataPoints} with the given
16+
* name. DataPoint names can be given as the value parameter of the
17+
* &#064DataPoints annotation.
18+
* </p>
19+
* <p>
20+
* DataPoints without names will not be considered as values for any parameters
21+
* annotated with &#064FromDataPoints.
22+
* </p>
23+
*
24+
* <pre>
25+
* &#064;DataPoints
26+
* public static String[] unnamed = new String[] { ... };
27+
*
28+
* &#064;DataPoints("regexes")
29+
* public static String[] regexStrings = new String[] { ... };
30+
*
31+
* &#064;DataPoints({"forMatching", "alphanumeric"})
32+
* public static String[] testStrings = new String[] { ... };
33+
*
34+
* &#064;Theory
35+
* public void stringTheory(String param) {
36+
* // This will be called with every value in 'regexStrings',
37+
* // 'testStrings' and 'unnamed'.
38+
* }
39+
*
40+
* &#064;Theory
41+
* public void regexTheory(&#064;FromDataPoints("regexes") String regex,
42+
* &#064;FromDataPoints("forMatching") String value) {
43+
* // This will be called with only the values in 'regexStrings' as
44+
* // regex, only the values in 'testStrings' as value, and none
45+
* // of the values in 'unnamed'.
46+
* }
47+
* </pre>
48+
*
49+
* @see org.junit.experimental.theories.Theory
50+
* @see org.junit.experimental.theories.DataPoint
51+
* @see org.junit.experimental.theories.DataPoints
52+
*/
53+
@Retention(RetentionPolicy.RUNTIME)
54+
@Target(ElementType.PARAMETER)
55+
@ParametersSuppliedBy(SpecificDataPointsSupplier.class)
56+
public @interface FromDataPoints {
57+
String value();
58+
}

src/main/java/org/junit/experimental/theories/ParametersSuppliedBy.java

+5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
package org.junit.experimental.theories;
22

3+
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
4+
import static java.lang.annotation.ElementType.PARAMETER;
5+
36
import java.lang.annotation.Retention;
47
import java.lang.annotation.RetentionPolicy;
8+
import java.lang.annotation.Target;
59

610

711
@Retention(RetentionPolicy.RUNTIME)
12+
@Target({ANNOTATION_TYPE, PARAMETER})
813
public @interface ParametersSuppliedBy {
914

1015
Class<? extends ParameterSupplier> value();

0 commit comments

Comments
 (0)