File: ReleaseNotes4.8.md

package info (click to toggle)
junit4 4.13.2-5
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 4,544 kB
  • sloc: java: 31,240; javascript: 1,339; xml: 796; makefile: 2; sh: 1
file content (57 lines) | stat: -rw-r--r-- 1,395 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
## Summary of Changes in version 4.8 ##

### Categories ###

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.

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

```java
public interface FastTests { /* category marker */ }
public interface SlowTests { /* category marker */ }

public class A {
	@Test
	public void a() {
		fail();
	}

	@Category(SlowTests.class)
	@Test
	public void b() {
	}
}

@Category({SlowTests.class, FastTests.class})
public class B {
	@Test
	public void c() {
	}
}

@RunWith(Categories.class)
@IncludeCategory(SlowTests.class)
@SuiteClasses( { A.class, B.class }) // Note that Categories is a kind of Suite
public 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 class SlowTestSuite {
	// Will run A.b, but not A.a or B.c
}
```

### Bug fixes ###

- github#16: thread safety of Result counting