Search in sources :

Example 1 with SchedulerMain

use of org.apache.heron.scheduler.SchedulerMain in project heron by twitter.

the class HeronMasterDriverTest method onNextStartTimeStartsSchedulerTManager.

@Test
@PrepareForTest({ HeronReefUtils.class, SchedulerMain.class })
public void onNextStartTimeStartsSchedulerTManager() throws Exception {
    PowerMockito.spy(HeronReefUtils.class);
    PowerMockito.doNothing().when(HeronReefUtils.class, "extractPackageInSandbox", anyString(), anyString(), anyString());
    SchedulerMain mockScheduler = mock(SchedulerMain.class);
    PowerMockito.spy(SchedulerMain.class);
    PowerMockito.doReturn(mockScheduler).when(SchedulerMain.class, "createInstance", anyString(), anyString(), anyString(), anyString(), anyString(), eq(0), eq(false));
    spyDriver.new HeronSchedulerLauncher().onNext(new StartTime(System.currentTimeMillis()));
    verify(mockScheduler, times(1)).runScheduler();
}
Also used : StartTime(org.apache.reef.wake.time.event.StartTime) SchedulerMain(org.apache.heron.scheduler.SchedulerMain) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

SchedulerMain (org.apache.heron.scheduler.SchedulerMain)1 StartTime (org.apache.reef.wake.time.event.StartTime)1 Test (org.junit.Test)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1