Skip to content

Commit f854c17

Browse files
maksim-makarnokd
authored andcommitted
Rename test methods and enable the check (#6528)
* Rename test methods * Enable TestPrefixInMethodName check
1 parent edb1f71 commit f854c17

File tree

282 files changed

+2842
-2852
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+2842
-2852
lines changed

src/test/java/io/reactivex/completable/CompletableTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -3786,7 +3786,7 @@ public void after() {
37863786
}
37873787

37883788
@Test
3789-
public void testHookCreate() throws Throwable {
3789+
public void hookCreate() throws Throwable {
37903790
CompletableSource subscriber = mock(CompletableSource.class);
37913791
Completable create = Completable.unsafeCreate(subscriber);
37923792

@@ -4200,7 +4200,7 @@ public void onSubscribe(Subscription s) {
42004200
}
42014201

42024202
@Test
4203-
public void testHookSubscribeStart() throws Throwable {
4203+
public void hookSubscribeStart() throws Throwable {
42044204
TestSubscriber<String> ts = new TestSubscriber<String>();
42054205

42064206
Completable completable = Completable.unsafeCreate(new CompletableSource() {
@@ -4215,7 +4215,7 @@ public void testHookSubscribeStart() throws Throwable {
42154215

42164216
@Ignore("No unsafeSubscribe")
42174217
@Test
4218-
public void testHookUnsafeSubscribeStart() {
4218+
public void hookUnsafeSubscribeStart() {
42194219
/*
42204220
TestSubscriber<String> ts = new TestSubscriber<String>();
42214221
Completable completable = Completable.create(new CompletableOnSubscribe() {

src/test/java/io/reactivex/disposables/CompositeDisposableTest.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
public class CompositeDisposableTest {
3030

3131
@Test
32-
public void testSuccess() {
32+
public void success() {
3333
final AtomicInteger counter = new AtomicInteger();
3434
CompositeDisposable cd = new CompositeDisposable();
3535
cd.add(Disposables.fromRunnable(new Runnable() {
@@ -97,7 +97,7 @@ public void run() {
9797
}
9898

9999
@Test
100-
public void testException() {
100+
public void exception() {
101101
final AtomicInteger counter = new AtomicInteger();
102102
CompositeDisposable cd = new CompositeDisposable();
103103
cd.add(Disposables.fromRunnable(new Runnable() {
@@ -131,7 +131,7 @@ public void run() {
131131
}
132132

133133
@Test
134-
public void testCompositeException() {
134+
public void compositeException() {
135135
final AtomicInteger counter = new AtomicInteger();
136136
CompositeDisposable cd = new CompositeDisposable();
137137
cd.add(Disposables.fromRunnable(new Runnable() {
@@ -173,7 +173,7 @@ public void run() {
173173
}
174174

175175
@Test
176-
public void testRemoveUnsubscribes() {
176+
public void removeUnsubscribes() {
177177
Disposable d1 = Disposables.empty();
178178
Disposable d2 = Disposables.empty();
179179

@@ -188,7 +188,7 @@ public void testRemoveUnsubscribes() {
188188
}
189189

190190
@Test
191-
public void testClear() {
191+
public void clear() {
192192
Disposable d1 = Disposables.empty();
193193
Disposable d2 = Disposables.empty();
194194

@@ -215,7 +215,7 @@ public void testClear() {
215215
}
216216

217217
@Test
218-
public void testUnsubscribeIdempotence() {
218+
public void unsubscribeIdempotence() {
219219
final AtomicInteger counter = new AtomicInteger();
220220
CompositeDisposable cd = new CompositeDisposable();
221221
cd.add(Disposables.fromRunnable(new Runnable() {
@@ -236,7 +236,7 @@ public void run() {
236236
}
237237

238238
@Test(timeout = 1000)
239-
public void testUnsubscribeIdempotenceConcurrently()
239+
public void unsubscribeIdempotenceConcurrently()
240240
throws InterruptedException {
241241
final AtomicInteger counter = new AtomicInteger();
242242
final CompositeDisposable cd = new CompositeDisposable();
@@ -279,7 +279,7 @@ public void run() {
279279
}
280280

281281
@Test
282-
public void testTryRemoveIfNotIn() {
282+
public void tryRemoveIfNotIn() {
283283
CompositeDisposable cd = new CompositeDisposable();
284284

285285
CompositeDisposable cd1 = new CompositeDisposable();
@@ -293,7 +293,7 @@ public void testTryRemoveIfNotIn() {
293293
}
294294

295295
@Test(expected = NullPointerException.class)
296-
public void testAddingNullDisposableIllegal() {
296+
public void addingNullDisposableIllegal() {
297297
CompositeDisposable cd = new CompositeDisposable();
298298
cd.add(null);
299299
}

src/test/java/io/reactivex/disposables/DisposablesTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
public class DisposablesTest {
3333

3434
@Test
35-
public void testUnsubscribeOnlyOnce() {
35+
public void unsubscribeOnlyOnce() {
3636
Runnable dispose = mock(Runnable.class);
3737
Disposable subscription = Disposables.fromRunnable(dispose);
3838
subscription.dispose();
@@ -41,15 +41,15 @@ public void testUnsubscribeOnlyOnce() {
4141
}
4242

4343
@Test
44-
public void testEmpty() {
44+
public void empty() {
4545
Disposable empty = Disposables.empty();
4646
assertFalse(empty.isDisposed());
4747
empty.dispose();
4848
assertTrue(empty.isDisposed());
4949
}
5050

5151
@Test
52-
public void testUnsubscribed() {
52+
public void unsubscribed() {
5353
Disposable disposed = Disposables.disposed();
5454
assertTrue(disposed.isDisposed());
5555
}

src/test/java/io/reactivex/exceptions/CompositeExceptionTest.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private CompositeException getNewCompositeExceptionWithEx123() {
3939
}
4040

4141
@Test(timeout = 1000)
42-
public void testMultipleWithSameCause() {
42+
public void multipleWithSameCause() {
4343
Throwable rootCause = new Throwable("RootCause");
4444
Throwable e1 = new Throwable("1", rootCause);
4545
Throwable e2 = new Throwable("2", rootCause);
@@ -57,7 +57,7 @@ public void testMultipleWithSameCause() {
5757
}
5858

5959
@Test
60-
public void testEmptyErrors() {
60+
public void emptyErrors() {
6161
try {
6262
new CompositeException();
6363
fail("CompositeException should fail if errors is empty");
@@ -73,7 +73,7 @@ public void testEmptyErrors() {
7373
}
7474

7575
@Test(timeout = 1000)
76-
public void testCompositeExceptionFromParentThenChild() {
76+
public void compositeExceptionFromParentThenChild() {
7777
CompositeException cex = new CompositeException(ex1, ex2);
7878

7979
System.err.println("----------------------------- print composite stacktrace");
@@ -88,7 +88,7 @@ public void testCompositeExceptionFromParentThenChild() {
8888
}
8989

9090
@Test(timeout = 1000)
91-
public void testCompositeExceptionFromChildThenParent() {
91+
public void compositeExceptionFromChildThenParent() {
9292
CompositeException cex = new CompositeException(ex2, ex1);
9393

9494
System.err.println("----------------------------- print composite stacktrace");
@@ -103,7 +103,7 @@ public void testCompositeExceptionFromChildThenParent() {
103103
}
104104

105105
@Test(timeout = 1000)
106-
public void testCompositeExceptionFromChildAndComposite() {
106+
public void compositeExceptionFromChildAndComposite() {
107107
CompositeException cex = new CompositeException(ex1, getNewCompositeExceptionWithEx123());
108108

109109
System.err.println("----------------------------- print composite stacktrace");
@@ -118,7 +118,7 @@ public void testCompositeExceptionFromChildAndComposite() {
118118
}
119119

120120
@Test(timeout = 1000)
121-
public void testCompositeExceptionFromCompositeAndChild() {
121+
public void compositeExceptionFromCompositeAndChild() {
122122
CompositeException cex = new CompositeException(getNewCompositeExceptionWithEx123(), ex1);
123123

124124
System.err.println("----------------------------- print composite stacktrace");
@@ -133,7 +133,7 @@ public void testCompositeExceptionFromCompositeAndChild() {
133133
}
134134

135135
@Test(timeout = 1000)
136-
public void testCompositeExceptionFromTwoDuplicateComposites() {
136+
public void compositeExceptionFromTwoDuplicateComposites() {
137137
List<Throwable> exs = new ArrayList<Throwable>();
138138
exs.add(getNewCompositeExceptionWithEx123());
139139
exs.add(getNewCompositeExceptionWithEx123());
@@ -177,21 +177,21 @@ private static Throwable getRootCause(Throwable ex) {
177177
}
178178

179179
@Test
180-
public void testNullCollection() {
180+
public void nullCollection() {
181181
CompositeException composite = new CompositeException((List<Throwable>)null);
182182
composite.getCause();
183183
composite.printStackTrace();
184184
}
185185

186186
@Test
187-
public void testNullElement() {
187+
public void nullElement() {
188188
CompositeException composite = new CompositeException(Collections.singletonList((Throwable) null));
189189
composite.getCause();
190190
composite.printStackTrace();
191191
}
192192

193193
@Test(timeout = 1000)
194-
public void testCompositeExceptionWithUnsupportedInitCause() {
194+
public void compositeExceptionWithUnsupportedInitCause() {
195195
Throwable t = new Throwable() {
196196

197197
private static final long serialVersionUID = -3282577447436848385L;
@@ -215,7 +215,7 @@ public synchronized Throwable initCause(Throwable cause) {
215215
}
216216

217217
@Test(timeout = 1000)
218-
public void testCompositeExceptionWithNullInitCause() {
218+
public void compositeExceptionWithNullInitCause() {
219219
Throwable t = new Throwable("ThrowableWithNullInitCause") {
220220

221221
private static final long serialVersionUID = -7984762607894527888L;

src/test/java/io/reactivex/exceptions/ExceptionsNullTest.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -24,78 +24,78 @@ public class ExceptionsNullTest {
2424

2525
@Ignore("OnCompleteFailedException will likely not be ported")
2626
@Test
27-
public void testOnCompleteFailedExceptionNull() {
27+
public void onCompleteFailedExceptionNull() {
2828
// Throwable t = new OnCompleteFailedException(null);
2929
//
3030
// Assert.assertTrue(t.getCause() instanceof NullPointerException);
3131
}
3232

3333
@Ignore("OnCompleteFailedException will likely not be ported")
3434
@Test
35-
public void testOnCompleteFailedExceptionMessageAndNull() {
35+
public void onCompleteFailedExceptionMessageAndNull() {
3636
// Throwable t = new OnCompleteFailedException("Message", null);
3737
//
3838
// Assert.assertTrue(t.getCause() instanceof NullPointerException);
3939
}
4040

4141
@Ignore("OnErrorFailedException will likely not be ported")
4242
@Test
43-
public void testOnErrorFailedExceptionNull() {
43+
public void onErrorFailedExceptionNull() {
4444
// Throwable t = new OnErrorFailedException(null);
4545
//
4646
// Assert.assertTrue(t.getCause() instanceof NullPointerException);
4747
}
4848

4949
@Ignore("OnErrorFailedException will likely not be ported")
5050
@Test
51-
public void testOnErrorFailedExceptionMessageAndNull() {
51+
public void onErrorFailedExceptionMessageAndNull() {
5252
// Throwable t = new OnErrorFailedException("Message", null);
5353
//
5454
// Assert.assertTrue(t.getCause() instanceof NullPointerException);
5555
}
5656

5757
@Ignore("UnsubscribeFailedException will likely not be ported")
5858
@Test
59-
public void testUnsubscribeFailedExceptionNull() {
59+
public void unsubscribeFailedExceptionNull() {
6060
// Throwable t = new UnsubscribeFailedException(null);
6161
//
6262
// Assert.assertTrue(t.getCause() instanceof NullPointerException);
6363
}
6464

6565
@Ignore("UnsubscribeFailedException will likely not be ported")
6666
@Test
67-
public void testUnsubscribeFailedExceptionMessageAndNull() {
67+
public void unsubscribeFailedExceptionMessageAndNull() {
6868
// Throwable t = new UnsubscribeFailedException("Message", null);
6969
//
7070
// Assert.assertTrue(t.getCause() instanceof NullPointerException);
7171
}
7272

7373
@Ignore("OnErrorNotImplementedException will likely not be ported")
7474
@Test
75-
public void testOnErrorNotImplementedExceptionNull() {
75+
public void onErrorNotImplementedExceptionNull() {
7676
// Throwable t = new OnErrorNotImplementedException(null);
7777
//
7878
// Assert.assertTrue(t.getCause() instanceof NullPointerException);
7979
}
8080

8181
@Ignore("OnErrorNotImplementedException will likely not be ported")
8282
@Test
83-
public void testOnErrorNotImplementedExceptionMessageAndNull() {
83+
public void onErrorNotImplementedExceptionMessageAndNull() {
8484
// Throwable t = new OnErrorNotImplementedException("Message", null);
8585
//
8686
// Assert.assertTrue(t.getCause() instanceof NullPointerException);
8787
}
8888

8989
@Ignore("OnErrorThrowable may be ported later")
9090
@Test
91-
public void testOnErrorThrowableFrom() {
91+
public void onErrorThrowableFrom() {
9292
// Throwable t = OnErrorThrowable.from(null);
9393
// Assert.assertTrue(t.getCause() instanceof NullPointerException);
9494
}
9595

9696
@Ignore("OnErrorThrowable may be ported later")
9797
@Test
98-
public void testOnErrorThrowableAddValueAsLastCause() {
98+
public void onErrorThrowableAddValueAsLastCause() {
9999
// Throwable t = OnErrorThrowable.addValueAsLastCause(null, "value");
100100
// Assert.assertTrue(t instanceof NullPointerException);
101101
}

0 commit comments

Comments
 (0)