Skip to content

Commit

Permalink
Final cleanup of Categories and release notes for 4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
David Saff committed Dec 1, 2009
1 parent cec8e3e commit 5a3a326
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 16 deletions.
10 changes: 6 additions & 4 deletions build.xml
Expand Up @@ -6,7 +6,7 @@
<property name="target" location="target" />
<property name="bin" location="${target}/main" />
<property name="version-base" value="4.8" />
<property name="version-status" value="b3" />
<property name="version-status" value="" />
<property name="version" value="${version-base}${version-status}" />
<property name="dist" value="junit${version}" />
<property name="versionfile" value="${src}/junit/runner/Version.java" />
Expand All @@ -19,7 +19,6 @@
<property name="srcjar" value="junit-${version}-src.jar" />
<property name="javadocdir" location="${dist}/javadoc" />
<property name="javadoczip" location="${dist}-javadoc.zip" />
<property name="javadocpackages" value="org.junit, org.junit.runner, org.junit.runner.description, org.junit.runner.manipulation, org.junit.runner.notification, org.junit.runners, org.hamcrest.core, org.junit.matchers" />
<property name="hamcrestlib" location="lib/hamcrest-core-1.1.jar" />
<property name="hamcrestsrc" location="${dist}/temp.hamcrest.source" />

Expand Down Expand Up @@ -117,14 +116,17 @@
</target>

<target name="javadoc" depends="unjar.hamcrest">
<javadoc packagenames="${javadocpackages}"
destdir="${javadocdir}"
<javadoc destdir="${javadocdir}"
author="false"
version="false"
use="false"
windowtitle="JUnit API"
stylesheetfile="stylesheet.css"
>
<excludepackage name="junit.*" />
<excludepackage name="org.junit.internal.*" />
<excludepackage name="org.junit.experimental.theories.internal.*" />

<sourcepath location="${src}" />
<sourcepath location="${hamcrestsrc}" />
<link href="http://java.sun.com/javase/6/docs/api/" />
Expand Down
28 changes: 24 additions & 4 deletions doc/ReleaseNotes4.8.html
Expand Up @@ -5,12 +5,16 @@ <h3>Categories</h3>
<p>From a given set of test classes, the <code>Categories</code> runner
runs only the classes and methods
that are annotated with either the category given with the <code>@IncludeCategory</code>
annotation, or a subtype of that category.</p>
annotation, or a subtype of that category. Either classes or interfaces can be
used as categories. Subtyping works, so if you say <code>@IncludeCategory(SuperClass.class)</code>,
a test marked <code>@Category({SubClass.class})</code> will be run.</p>

<p>You can also exclude categories by using the <code>@ExcludeCategory</code> annotation</p>

<p>Example:</p>

<pre><code>public interface FastTests extends CategoryType {}
public interface SlowTests extends CategoryType {}
<pre><code>public interface FastTests { /* category marker */ }
public interface SlowTests { /* category marker */ }

public static class A {
@Test
Expand All @@ -35,5 +39,21 @@ <h3>Categories</h3>
@RunWith(Categories.class)
@IncludeCategory(SlowTests.class)
@SuiteClasses( { A.class, B.class }) // Note that Categories is a kind of Suite
public static class SlowTestSuite {}
public static class SlowTestSuite {
// Will run A.b and B.c, but not A.a
}

@RunWith(Categories.class)
@IncludeCategory(SlowTests.class)
@ExcludeCategory(FastTests.class)
@SuiteClasses( { A.class, B.class }) // Note that Categories is a kind of Suite
public static class SlowTestSuite {
// Will run A.b, but not A.a or B.c
}
</code></pre>

<h3>Bug fixes</h3>

<ul>
<li>github#16: thread safety of Result counting</li>
</ul>
18 changes: 15 additions & 3 deletions doc/ReleaseNotes4.8.txt
Expand Up @@ -6,8 +6,10 @@ From a given set of test classes, the `Categories` runner
runs only the classes and methods
that are annotated with either the category given with the `@IncludeCategory`
annotation, or a subtype of that category. Either classes or interfaces can be
used as categories. Subtyping works, so if you say @IncludeCategory(SuperClass.class),
a test marked @Category({SubClass.class}) will be run.
used as categories. Subtyping works, so if you say `@IncludeCategory(SuperClass.class)`,
a test marked `@Category({SubClass.class})` will be run.

You can also exclude categories by using the `@ExcludeCategory` annotation

Example:

Expand Down Expand Up @@ -37,7 +39,17 @@ Example:
@RunWith(Categories.class)
@IncludeCategory(SlowTests.class)
@SuiteClasses( { A.class, B.class }) // Note that Categories is a kind of Suite
public static class SlowTestSuite {}
public static class SlowTestSuite {
// Will run A.b and B.c, but not A.a
}

@RunWith(Categories.class)
@IncludeCategory(SlowTests.class)
@ExcludeCategory(FastTests.class)
@SuiteClasses( { A.class, B.class }) // Note that Categories is a kind of Suite
public static class SlowTestSuite {
// Will run A.b, but not A.a or B.c
}

### Bug fixes ###

Expand Down
2 changes: 1 addition & 1 deletion doc/building-junit.txt
Expand Up @@ -5,7 +5,7 @@ Steps to build junit:
- Update version in build.xml
- Not too tedious:
- Run the ant zip task
- Upload stuff to github
- Upload stuff to github (including tag)
- Tedious:
- Update SourceForge if major release
- Update javadocs on SourceForge and junit.org
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/junit/runner/Version.java
Expand Up @@ -9,7 +9,7 @@ private Version() {
}

public static String id() {
return "4.8b1";
return "4.8";
}

public static void main(String[] args) {
Expand Down
Expand Up @@ -90,9 +90,6 @@ public String describe() {
public boolean shouldRun(Description description) {
if (hasCorrectCategoryAnnotation(description))
return true;

// TODO: feels as if we've done this child crawl several times.
// Change design?
for (Description each : description.getChildren())
if (shouldRun(each))
return true;
Expand Down

0 comments on commit 5a3a326

Please sign in to comment.