Skip to content

Commit

Permalink
Merge remote-tracking branch 'KentBeck/master' into junit.improvements
Browse files Browse the repository at this point in the history
Conflicts:
	src/main/java/org/junit/experimental/ParallelComputer.java
  • Loading branch information
Tibor Digana committed Oct 25, 2012
2 parents fdbf41e + 2f879b9 commit c781baa
Show file tree
Hide file tree
Showing 25 changed files with 1,249 additions and 952 deletions.
33 changes: 26 additions & 7 deletions build.xml
Expand Up @@ -133,7 +133,7 @@
<property name="basename" value="doc/ReleaseNotes${version-base}" /> <property name="basename" value="doc/ReleaseNotes${version-base}" />
<exec executable="perl" failonerror="true"> <exec executable="perl" failonerror="true">
<arg file="build/Markdown.pl"/> <arg file="build/Markdown.pl"/>
<arg file="${basename}.txt"/> <arg file="${basename}.md"/>
<redirector output="${basename}.html" /> <redirector output="${basename}.html" />
</exec> </exec>
</target> </target>
Expand Down Expand Up @@ -174,7 +174,8 @@
<copy file="build.xml" tofile="${dist}/build.xml" /> <copy file="build.xml" tofile="${dist}/build.xml" />
</target> </target>


<macrodef name="run-tests"> <macrodef name="run-dist-tests">
<!-- Runs the tests against the built jar files -->
<element name="extra-args" implicit="yes" /> <element name="extra-args" implicit="yes" />
<sequential> <sequential>
<java classname="org.junit.runner.JUnitCore" fork="yes" failonerror="true"> <java classname="org.junit.runner.JUnitCore" fork="yes" failonerror="true">
Expand All @@ -188,16 +189,34 @@
</sequential> </sequential>
</macrodef> </macrodef>


<macrodef name="run-local-tests">
<!-- Runs the tests against the local class files -->
<sequential>
<java classname="org.junit.runner.JUnitCore" fork="yes" failonerror="true">
<arg value="org.junit.tests.AllTests"/>
<classpath>
<pathelement location="${bin}" />
<pathelement location="${testbin}" />
<pathelement location="${hamcrestlib}" />
</classpath>
</java>
</sequential>
</macrodef>

<target name="test" depends="build">
<run-local-tests />
</target>

<target name="dist" depends="populate-dist"> <target name="dist" depends="populate-dist">
<run-tests> <run-dist-tests>
<jvmarg value="-Dignore.this=ignored" /> <jvmarg value="-Dignore.this=ignored"/>
</run-tests> </run-dist-tests>
</target> </target>


<target name="profile" depends="populate-dist"> <target name="profile" depends="populate-dist">
<run-tests> <run-dist-tests>
<jvmarg value="-agentlib:hprof=cpu=samples"/> <jvmarg value="-agentlib:hprof=cpu=samples"/>
</run-tests> </run-dist-tests>
</target> </target>


<target name="zip" depends="dist"> <target name="zip" depends="dist">
Expand Down
40 changes: 40 additions & 0 deletions build/maven/junit-dep-pom-template.xml
Expand Up @@ -4,10 +4,50 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit-dep</artifactId> <artifactId>junit-dep</artifactId>
<packaging>pom</packaging>
<version>@version@</version> <version>@version@</version>
<distributionManagement> <distributionManagement>
<relocation> <relocation>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>@version@</version>
<message>The artifact junit:junit does not contain Hamcrest anymore but declares a dependency to Hamcrest. Thus, junit:junit-dep has become obsolete.</message>
</relocation> </relocation>
</distributionManagement> </distributionManagement>
<name>JUnit</name>
<url>http://junit.org</url>
<description>
JUnit is a regression testing framework written by Erich Gamma and Kent Beck.
It is used by the developer who implements unit tests in Java.
</description>
<organization>
<name>JUnit</name>
<url>http://www.junit.org</url>
</organization>
<mailingLists>
<mailingList>
<name>JUnit Mailing List</name>
<post>junit@yahoogroups.com</post>
<archive>
http://tech.groups.yahoo.com/group/junit/
</archive>
</mailingList>
</mailingLists>
<licenses>
<license>
<name>Common Public License Version 1.0</name>
<url>http://www.opensource.org/licenses/cpl1.0.txt</url>
</license>
</licenses>
<scm>
<connection>scm:git:git://github.com/KentBeck/junit.git</connection>
<developerConnection>scm:git:git@github.com:KentBeck/junit.git</developerConnection>
<url>http://github.com/KentBeck/junit/tree/master</url>
</scm>
<developers>
<developer>
<id>dsaff</id>
<name>David Saff</name>
<email>david@saff.net</email>
</developer>
</developers>
</project> </project>
84 changes: 84 additions & 0 deletions doc/ReleaseNotes4.10.md
@@ -0,0 +1,84 @@
## Summary of Changes in version 4.10 ##

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

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

### junit-dep has correct contents ###

junit-dep-4.9.jar incorrectly contained hamcrest classes, which could lead to version conflicts in projects that depend on hamcrest directly. This is fixed in 4.10 [@dsaff, closing gh-309]

### RuleChain ###

The RuleChain rule allows ordering of TestRules:

public static class UseRuleChain {
@Rule
public TestRule chain= RuleChain
.outerRule(new LoggingRule("outer rule")
.around(new LoggingRule("middle rule")
.around(new LoggingRule("inner rule");

@Test
public void example() {
assertTrue(true);
}
}

writes the log

starting outer rule
starting middle rule
starting inner rule
finished inner rule
finished middle rule
finished outer rule

### TemporaryFolder ###

- `TemporaryFolder#newFolder(String... folderNames)` creates recursively deep temporary folders
[@rodolfoliviero, closing gh-283]
- `TemporaryFolder#newFile()` creates a randomly named new file, and `#newFolder()` creates a randomly named new folder
[@Daniel Rothmaler, closing gh-299]

### Theories ###

The `Theories` runner does not anticipate theory parameters that have generic
types, as reported by github#64. Fixing this won't happen until `Theories` is
moved to junit-contrib. In anticipation of this, 4.9.1 adds some of the
necessary machinery to the runner classes, and deprecates a method that only
the `Theories` runner uses, `FrameworkMethod`#producesType().
The Common Public License that JUnit is released under is now included
in the source repository.

Thanks to `@pholser` for identifying a potential resolution for github#64
and initiating work on it.

### Bug fixes ###

- Built-in Rules implementations
- TemporaryFolder should not create files in the current working directory if applying the rule fails
[@orfjackal, fixing gh-278]
- TestWatcher and TestWatchman should not call failed for AssumptionViolatedExceptions
[@stefanbirkner, fixing gh-296]
- Javadoc bugs
- Assert documentation [@stefanbirkner, fixing gh-134]
- ClassRule [@stefanbirkner, fixing gh-254]
- Parameterized [@stefanbirkner, fixing gh-89]
- Parameterized, again [@orfjackal, fixing gh-285]
- Miscellaneous
- Useless code in RunAfters [@stefanbirkner, fixing gh-289]
- Parameterized test classes should be able to have `@Category` annotations
[@dsaff, fixing gh-291]
- Error count should be initialized in junit.tests.framework.TestListenerTest [@stefanbirkner, fixing gh-225]
- AssertionFailedError constructor shouldn't call super with null message [@stefanbirkner, fixing gh-318]
- Clearer error message for non-static inner test classes [@stefanbirkner, fixing gh-42]

### Minor changes ###

- Description, Result and Failure are Serializable [@ephox-rob, closing gh-101]
- FailOnTimeout is reusable, allowing for retrying Rules [@stefanbirkner, closing gh-265]
- New `ErrorCollector.checkThat` overload, that allows you to specify a reason [@drothmaler, closing gh-300]



85 changes: 1 addition & 84 deletions doc/ReleaseNotes4.10.txt
@@ -1,84 +1 @@
## Summary of Changes in version 4.10 ## Please see ReleaseNotes4.10.md

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

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

### junit-dep has correct contents ###

junit-dep-4.9.jar incorrectly contained hamcrest classes, which could lead to version conflicts in projects that depend on hamcrest directly. This is fixed in 4.10 [@dsaff, closing gh-309]

### RuleChain ###

The RuleChain rule allows ordering of TestRules:

public static class UseRuleChain {
@Rule
public TestRule chain= RuleChain
.outerRule(new LoggingRule("outer rule")
.around(new LoggingRule("middle rule")
.around(new LoggingRule("inner rule");

@Test
public void example() {
assertTrue(true);
}
}

writes the log

starting outer rule
starting middle rule
starting inner rule
finished inner rule
finished middle rule
finished outer rule

### TemporaryFolder ###

- `TemporaryFolder#newFolder(String... folderNames)` creates recursively deep temporary folders
[@rodolfoliviero, closing gh-283]
- `TemporaryFolder#newFile()` creates a randomly named new file, and `#newFolder()` creates a randomly named new folder
[@Daniel Rothmaler, closing gh-299]

### Theories ###

The `Theories` runner does not anticipate theory parameters that have generic
types, as reported by github#64. Fixing this won't happen until `Theories` is
moved to junit-contrib. In anticipation of this, 4.9.1 adds some of the
necessary machinery to the runner classes, and deprecates a method that only
the `Theories` runner uses, `FrameworkMethod`#producesType().
The Common Public License that JUnit is released under is now included
in the source repository.

Thanks to `@pholser` for identifying a potential resolution for github#64
and initiating work on it.

### Bug fixes ###

- Built-in Rules implementations
- TemporaryFolder should not create files in the current working directory if applying the rule fails
[@orfjackal, fixing gh-278]
- TestWatcher and TestWatchman should not call failed for AssumptionViolatedExceptions
[@stefanbirkner, fixing gh-296]
- Javadoc bugs
- Assert documentation [@stefanbirkner, fixing gh-134]
- ClassRule [@stefanbirkner, fixing gh-254]
- Parameterized [@stefanbirkner, fixing gh-89]
- Parameterized, again [@orfjackal, fixing gh-285]
- Miscellaneous
- Useless code in RunAfters [@stefanbirkner, fixing gh-289]
- Parameterized test classes should be able to have `@Category` annotations
[@dsaff, fixing gh-291]
- Error count should be initialized in junit.tests.framework.TestListenerTest [@stefanbirkner, fixing gh-225]
- AssertionFailedError constructor shouldn't call super with null message [@stefanbirkner, fixing gh-318]
- Clearer error message for non-static inner test classes [@stefanbirkner, fixing gh-42]

### Minor changes ###

- Description, Result and Failure are Serializable [@ephox-rob, closing gh-101]
- FailOnTimeout is reusable, allowing for retrying Rules [@stefanbirkner, closing gh-265]
- New `ErrorCollector.checkThat` overload, that allows you to specify a reason [@drothmaler, closing gh-300]



0 comments on commit c781baa

Please sign in to comment.