Skip to content

Commit d3d685a

Browse files
committed
redid all unnecessary methodmodifier changes
Change-Id: I75e34743c13d62e4be1a52570425818a8e8b89bc
1 parent 43b4f5a commit d3d685a

File tree

49 files changed

+415
-407
lines changed

Some content is hidden

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

49 files changed

+415
-407
lines changed

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapred/TestLocalContainerLauncher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public static void cleanupTestDirs() throws IOException {
100100
@SuppressWarnings("rawtypes")
101101
@Test
102102
@Timeout(10000)
103-
void testKillJob() throws Exception {
103+
public void testKillJob() throws Exception {
104104
JobConf conf = new JobConf();
105105
AppContext context = mock(AppContext.class);
106106
// a simple event handler solely to detect the container cleaned event
@@ -188,7 +188,7 @@ private static Container createMockContainer() {
188188

189189

190190
@Test
191-
void testRenameMapOutputForReduce() throws Exception {
191+
public void testRenameMapOutputForReduce() throws Exception {
192192
final JobConf conf = new JobConf();
193193

194194
final MROutputFiles mrOutputFiles = new MROutputFiles();

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapred/TestTaskAttemptFinishingMonitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
public class TestTaskAttemptFinishingMonitor {
4646

4747
@Test
48-
void testFinshingAttemptTimeout()
48+
public void testFinshingAttemptTimeout()
4949
throws IOException, InterruptedException {
5050
SystemClock clock = SystemClock.getInstance();
5151
Configuration conf = new Configuration();

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapred/TestTaskAttemptListenerImpl.java

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import java.io.IOException;
2121
import java.util.ArrayList;
22+
import java.util.Arrays;
2223
import java.util.List;
2324
import java.util.concurrent.ConcurrentMap;
2425
import java.util.concurrent.atomic.AtomicReference;
@@ -78,6 +79,7 @@
7879
import static org.mockito.Mockito.any;
7980
import static org.mockito.Mockito.doReturn;
8081
import static org.mockito.Mockito.eq;
82+
import static org.mockito.Mockito.lenient;
8183
import static org.mockito.Mockito.mock;
8284
import static org.mockito.Mockito.never;
8385
import static org.mockito.Mockito.times;
@@ -182,7 +184,7 @@ public void after() throws IOException {
182184

183185
@Test
184186
@Timeout(5000)
185-
void testGetTask() throws IOException {
187+
public void testGetTask() throws IOException {
186188
configureMocks();
187189
startListener(false);
188190

@@ -241,7 +243,7 @@ void testGetTask() throws IOException {
241243

242244
@Test
243245
@Timeout(5000)
244-
void testJVMId() {
246+
public void testJVMId() {
245247

246248
JVMId jvmid = new JVMId("test", 1, true, 2);
247249
JVMId jvmid1 = JVMId.forName("jvm_test_0001_m_000002");
@@ -251,7 +253,7 @@ void testJVMId() {
251253

252254
@Test
253255
@Timeout(10000)
254-
void testGetMapCompletionEvents() throws IOException {
256+
public void testGetMapCompletionEvents() throws IOException {
255257
TaskAttemptCompletionEvent[] empty = {};
256258
TaskAttemptCompletionEvent[] taskEvents = {
257259
createTce(0, true, TaskAttemptCompletionEventStatus.OBSOLETE),
@@ -260,6 +262,12 @@ void testGetMapCompletionEvents() throws IOException {
260262
createTce(3, false, TaskAttemptCompletionEventStatus.FAILED) };
261263
TaskAttemptCompletionEvent[] mapEvents = { taskEvents[0], taskEvents[2] };
262264
Job mockJob = mock(Job.class);
265+
lenient().when(mockJob.getTaskAttemptCompletionEvents(0, 100))
266+
.thenReturn(taskEvents);
267+
lenient().when(mockJob.getTaskAttemptCompletionEvents(0, 2))
268+
.thenReturn(Arrays.copyOfRange(taskEvents, 0, 2));
269+
lenient().when(mockJob.getTaskAttemptCompletionEvents(2, 100))
270+
.thenReturn(Arrays.copyOfRange(taskEvents, 2, 4));
263271
when(mockJob.getMapAttemptCompletionEvents(0, 100)).thenReturn(
264272
TypeConverter.fromYarn(mapEvents));
265273
when(mockJob.getMapAttemptCompletionEvents(0, 2)).thenReturn(
@@ -311,7 +319,7 @@ private static TaskAttemptCompletionEvent createTce(int eventId,
311319

312320
@Test
313321
@Timeout(10000)
314-
void testCommitWindow() throws IOException {
322+
public void testCommitWindow() throws IOException {
315323
SystemClock clock = SystemClock.getInstance();
316324

317325
configureMocks();
@@ -351,7 +359,7 @@ protected void registerHeartbeatHandler(Configuration conf) {
351359
}
352360

353361
@Test
354-
void testCheckpointIDTracking()
362+
public void testCheckpointIDTracking()
355363
throws IOException, InterruptedException{
356364
configureMocks();
357365
listener = new MockTaskAttemptListenerImpl(
@@ -407,7 +415,7 @@ protected void registerHeartbeatHandler(Configuration conf) {
407415
}
408416

409417
@Test
410-
void testStatusUpdateProgress()
418+
public void testStatusUpdateProgress()
411419
throws IOException, InterruptedException {
412420
configureMocks();
413421
startListener(true);
@@ -428,7 +436,7 @@ void testStatusUpdateProgress()
428436
}
429437

430438
@Test
431-
void testPingUpdateProgress() throws IOException, InterruptedException {
439+
public void testPingUpdateProgress() throws IOException, InterruptedException {
432440
configureMocks();
433441
Configuration conf = new Configuration();
434442
conf.setBoolean(MRJobConfig.MR_TASK_ENABLE_PING_FOR_LIVELINESS_CHECK, true);
@@ -445,7 +453,7 @@ void testPingUpdateProgress() throws IOException, InterruptedException {
445453
}
446454

447455
@Test
448-
void testSingleStatusUpdate()
456+
public void testSingleStatusUpdate()
449457
throws IOException, InterruptedException {
450458
configureMocks();
451459
startListener(true);
@@ -463,7 +471,7 @@ void testSingleStatusUpdate()
463471
}
464472

465473
@Test
466-
void testStatusUpdateEventCoalescing()
474+
public void testStatusUpdateEventCoalescing()
467475
throws IOException, InterruptedException {
468476
configureMocks();
469477
startListener(true);
@@ -484,7 +492,7 @@ void testStatusUpdateEventCoalescing()
484492
}
485493

486494
@Test
487-
void testCoalescedStatusUpdatesCleared()
495+
public void testCoalescedStatusUpdatesCleared()
488496
throws IOException, InterruptedException {
489497
// First two events are coalesced, the third is not
490498
configureMocks();
@@ -508,7 +516,7 @@ void testCoalescedStatusUpdatesCleared()
508516
}
509517

510518
@Test
511-
void testStatusUpdateFromUnregisteredTask() throws Exception {
519+
public void testStatusUpdateFromUnregisteredTask() throws Exception {
512520
configureMocks();
513521
ControlledClock clock = new ControlledClock();
514522
clock.setTime(0);

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapred/TestYarnChild.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ public void setUp() throws Exception {
4545
}
4646

4747
@Test
48-
void testReportErrorWhenCapacityExceptionNotHappenByDefault()
48+
public void testReportErrorWhenCapacityExceptionNotHappenByDefault()
4949
throws IOException {
5050
Exception exception = new RuntimeException(new IOException());
5151

5252
verifyReportError(exception, false);
5353
}
5454

5555
@Test
56-
void testReportErrorWhenCapacityExceptionNotHappenAndFastFailDisabled()
56+
public void testReportErrorWhenCapacityExceptionNotHappenAndFastFailDisabled()
5757
throws IOException {
5858
Exception exception = new RuntimeException(new IOException());
5959
conf.setBoolean(KILL_LIMIT_EXCEED_CONF_NAME, false);
@@ -62,7 +62,7 @@ void testReportErrorWhenCapacityExceptionNotHappenAndFastFailDisabled()
6262
}
6363

6464
@Test
65-
void testReportErrorWhenCapacityExceptionNotHappenAndFastFailEnabled()
65+
public void testReportErrorWhenCapacityExceptionNotHappenAndFastFailEnabled()
6666
throws IOException {
6767
Exception exception = new RuntimeException(new IOException());
6868
conf.setBoolean(KILL_LIMIT_EXCEED_CONF_NAME, true);
@@ -71,7 +71,7 @@ void testReportErrorWhenCapacityExceptionNotHappenAndFastFailEnabled()
7171
}
7272

7373
@Test
74-
void testReportErrorWhenCapacityExceptionHappenByDefault()
74+
public void testReportErrorWhenCapacityExceptionHappenByDefault()
7575
throws IOException {
7676
Exception exception =
7777
new RuntimeException(new ClusterStorageCapacityExceededException());
@@ -80,7 +80,7 @@ void testReportErrorWhenCapacityExceptionHappenByDefault()
8080
}
8181

8282
@Test
83-
void testReportErrorWhenCapacityExceptionHappenAndFastFailDisabled()
83+
public void testReportErrorWhenCapacityExceptionHappenAndFastFailDisabled()
8484
throws IOException {
8585
Exception exception =
8686
new RuntimeException(new ClusterStorageCapacityExceededException());
@@ -90,7 +90,7 @@ void testReportErrorWhenCapacityExceptionHappenAndFastFailDisabled()
9090
}
9191

9292
@Test
93-
void testReportErrorWhenCapacityExceptionHappenAndFastFailEnabled()
93+
public void testReportErrorWhenCapacityExceptionHappenAndFastFailEnabled()
9494
throws IOException {
9595
Exception exception =
9696
new RuntimeException(new ClusterStorageCapacityExceededException());
@@ -100,7 +100,7 @@ void testReportErrorWhenCapacityExceptionHappenAndFastFailEnabled()
100100
}
101101

102102
@Test
103-
void testReportErrorWhenCapacityExceptionHappenInThirdOfExceptionChain()
103+
public void testReportErrorWhenCapacityExceptionHappenInThirdOfExceptionChain()
104104
throws IOException {
105105
Exception exception = new RuntimeException(new IllegalStateException(
106106
new ClusterStorageCapacityExceededException()));

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/jobhistory/TestEvents.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class TestEvents {
5353
*/
5454
@Test
5555
@Timeout(10000)
56-
void testTaskAttemptFinishedEvent() throws Exception {
56+
public void testTaskAttemptFinishedEvent() throws Exception {
5757
JobID jid = new JobID("001", 1);
5858
TaskID tid = new TaskID(jid, TaskType.REDUCE, 2);
5959
TaskAttemptID taskAttemptId = new TaskAttemptID(tid, 3);
@@ -82,7 +82,7 @@ void testTaskAttemptFinishedEvent() throws Exception {
8282

8383
@Test
8484
@Timeout(10000)
85-
void testJobPriorityChange() throws Exception {
85+
public void testJobPriorityChange() throws Exception {
8686
org.apache.hadoop.mapreduce.JobID jid = new JobID("001", 1);
8787
JobPriorityChangeEvent test = new JobPriorityChangeEvent(jid,
8888
JobPriority.LOW);
@@ -92,7 +92,7 @@ void testJobPriorityChange() throws Exception {
9292

9393
@Test
9494
@Timeout(10000)
95-
void testJobQueueChange() throws Exception {
95+
public void testJobQueueChange() throws Exception {
9696
org.apache.hadoop.mapreduce.JobID jid = new JobID("001", 1);
9797
JobQueueChangeEvent test = new JobQueueChangeEvent(jid,
9898
"newqueue");
@@ -107,7 +107,7 @@ void testJobQueueChange() throws Exception {
107107
*/
108108
@Test
109109
@Timeout(10000)
110-
void testTaskUpdated() throws Exception {
110+
public void testTaskUpdated() throws Exception {
111111
JobID jid = new JobID("001", 1);
112112
TaskID tid = new TaskID(jid, TaskType.REDUCE, 2);
113113
TaskUpdatedEvent test = new TaskUpdatedEvent(tid, 1234L);
@@ -122,7 +122,7 @@ void testTaskUpdated() throws Exception {
122122
*/
123123
@Test
124124
@Timeout(10000)
125-
void testEvents() throws Exception {
125+
public void testEvents() throws Exception {
126126
EventReader reader = new EventReader(new DataInputStream(
127127
new ByteArrayInputStream(getEvents())));
128128
HistoryEvent e = reader.getNextEvent();

0 commit comments

Comments
 (0)