Skip to content

Commit be61237

Browse files
committed
Readjust due to Issue KentBeck/junit#426 coding style.
1 parent 6bc83a0 commit be61237

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

src/main/java/org/junit/rules/TestWatcher.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
package org.junit.rules;
22

3+
import java.util.ArrayList;
4+
import java.util.List;
5+
36
import org.junit.internal.AssumptionViolatedException;
47
import org.junit.runner.Description;
58
import org.junit.runners.model.MultipleFailureException;
69
import org.junit.runners.model.Statement;
710

8-
import java.util.ArrayList;
9-
import java.util.List;
10-
1111
/**
1212
* TestWatcher is a base class for Rules that take note of the testing
1313
* action, without modifying it. For example, this class will keep a log of each
1414
* passing and failing test:
15-
* <p/>
15+
*
1616
* <pre>
1717
* public static class WatchmanTest {
18-
* private static String watchedLog;
18+
* private static String watchedLog;
1919
*
20-
* &#064;Rule
21-
* public TestWatcher watchman= new TestWatcher() {
22-
* &#064;Override
23-
* protected void failed(Throwable e, Description description) {
24-
* watchedLog+= description + &quot;\n&quot;;
25-
* }
20+
* &#064;Rule
21+
* public TestWatcher watchman= new TestWatcher() {
22+
* &#064;Override
23+
* protected void failed(Throwable e, Description description) {
24+
* watchedLog+= description + &quot;\n&quot;;
25+
* }
2626
*
27-
* &#064;Override
28-
* protected void succeeded(Description description) {
29-
* watchedLog+= description + &quot; &quot; + &quot;success!\n&quot;;
27+
* &#064;Override
28+
* protected void succeeded(Description description) {
29+
* watchedLog+= description + &quot; &quot; + &quot;success!\n&quot;;
3030
* }
3131
* };
3232
*
33-
* &#064;Test
34-
* public void fails() {
35-
* fail();
36-
* }
33+
* &#064;Test
34+
* public void fails() {
35+
* fail();
36+
* }
3737
*
38-
* &#064;Test
39-
* public void succeeds() {
38+
* &#064;Test
39+
* public void succeeds() {
4040
* }
4141
* }
4242
* </pre>
@@ -70,7 +70,7 @@ public void evaluate() throws Throwable {
7070
}
7171

7272
private void succeededQuietly(Description description,
73-
List<Throwable> errors) {
73+
List<Throwable> errors) {
7474
try {
7575
succeeded(description);
7676
} catch (Throwable t) {
@@ -79,7 +79,7 @@ private void succeededQuietly(Description description,
7979
}
8080

8181
private void failedQuietly(Throwable t, Description description,
82-
List<Throwable> errors) {
82+
List<Throwable> errors) {
8383
try {
8484
failed(t, description);
8585
} catch (Throwable t1) {
@@ -88,7 +88,7 @@ private void failedQuietly(Throwable t, Description description,
8888
}
8989

9090
private void skippedQuietly(AssumptionViolatedException e, Description description,
91-
List<Throwable> errors) {
91+
List<Throwable> errors) {
9292
try {
9393
skipped(e, description);
9494
} catch (Throwable t) {
@@ -97,7 +97,7 @@ private void skippedQuietly(AssumptionViolatedException e, Description descripti
9797
}
9898

9999
private void startingQuietly(Description description,
100-
List<Throwable> errors) {
100+
List<Throwable> errors) {
101101
try {
102102
starting(description);
103103
} catch (Throwable t) {
@@ -106,7 +106,7 @@ private void startingQuietly(Description description,
106106
}
107107

108108
private void finishedQuietly(Description description,
109-
List<Throwable> errors) {
109+
List<Throwable> errors) {
110110
try {
111111
finished(description);
112112
} catch (Throwable t) {

src/test/java/org/junit/tests/experimental/rules/TestWatcherTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
package org.junit.tests.experimental.rules;
22

3-
import org.junit.Rule;
4-
import org.junit.Test;
5-
import org.junit.experimental.results.PrintableResult;
6-
import org.junit.internal.AssumptionViolatedException;
7-
import org.junit.rules.TestRule;
8-
import org.junit.rules.TestWatcher;
9-
import org.junit.runner.Description;
10-
113
import static junit.framework.Assert.fail;
124
import static org.hamcrest.CoreMatchers.is;
135
import static org.junit.Assert.assertThat;
@@ -17,6 +9,14 @@
179
import static org.junit.experimental.results.ResultMatchers.hasFailureContaining;
1810
import static org.junit.runner.JUnitCore.runClasses;
1911

12+
import org.junit.Rule;
13+
import org.junit.Test;
14+
import org.junit.experimental.results.PrintableResult;
15+
import org.junit.internal.AssumptionViolatedException;
16+
import org.junit.rules.TestRule;
17+
import org.junit.rules.TestWatcher;
18+
import org.junit.runner.Description;
19+
2020
public class TestWatcherTest {
2121
public static class ViolatedAssumptionTest {
2222
private static StringBuilder watchedLog = new StringBuilder();
@@ -155,4 +155,4 @@ public void testWatcherFailedAndFinishedThrowsException() {
155155
assertThat(result, hasFailureContaining("watcher failed failure"));
156156
assertThat(result, hasFailureContaining("watcher finished failure"));
157157
}
158-
}
158+
}

0 commit comments

Comments
 (0)