Skip to content

Commit 47be7da

Browse files
committed
Enable TestWatchmanTest
1 parent d69cdd8 commit 47be7da

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/test/java/org/junit/rules/AllRulesTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
TestRuleTest.class,
2323
TestWatcherTest.class,
2424
TestWatchmanTest.class,
25-
// todo TestWatchmanTest.class, - doesn't work and wasn't being run before.
25+
TestWatchmanTest.class,
2626
TimeoutRuleTest.class,
2727
VerifierRuleTest.class
2828
})

src/test/java/org/junit/rules/TestWatchmanTest.java

+15-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@
55
import static org.junit.Assert.assertThat;
66
import static org.junit.Assume.assumeTrue;
77
import static org.junit.runner.JUnitCore.runClasses;
8-
8+
import org.junit.BeforeClass;
99
import org.junit.Rule;
1010
import org.junit.Test;
1111
import org.junit.runners.model.FrameworkMethod;
1212

1313
@SuppressWarnings("deprecation")
1414
public class TestWatchmanTest {
1515
public static class ViolatedAssumptionTest {
16-
static StringBuilder log = new StringBuilder();
16+
static StringBuilder log;
17+
18+
@BeforeClass
19+
public static void initLog() {
20+
log = new StringBuilder();
21+
}
22+
1723
@Rule
1824
public LoggingTestWatchman watchman = new LoggingTestWatchman(log);
1925

@@ -31,7 +37,13 @@ public void neitherLogSuccessNorFailedForViolatedAssumption() {
3137
}
3238

3339
public static class FailingTest {
34-
static StringBuilder log = new StringBuilder();
40+
static StringBuilder log;
41+
42+
@BeforeClass
43+
public static void initLog() {
44+
log = new StringBuilder();
45+
}
46+
3547
@Rule
3648
public LoggingTestWatchman watchman = new LoggingTestWatchman(log);
3749

0 commit comments

Comments
 (0)