Search in sources :

Example 6 with ILauncher

use of org.apache.heron.spi.scheduler.ILauncher in project heron by twitter.

the class LaunchRunnerTest method testSetTopologyFail.

@Test(expected = LauncherException.class)
public void testSetTopologyFail() throws Exception {
    Config runtime = createRunnerRuntime();
    Config config = createRunnerConfig();
    ILauncher launcher = Runtime.launcherClassInstance(runtime);
    LaunchRunner launchRunner = new LaunchRunner(config, runtime);
    SchedulerStateManagerAdaptor statemgr = Runtime.schedulerStateManagerAdaptor(runtime);
    when(statemgr.setTopology(any(TopologyAPI.Topology.class), eq(TOPOLOGY_NAME))).thenReturn(false);
    try {
        launchRunner.call();
    } finally {
        verify(launcher, never()).launch(any(PackingPlan.class));
    }
}
Also used : ILauncher(org.apache.heron.spi.scheduler.ILauncher) Config(org.apache.heron.spi.common.Config) PackingPlan(org.apache.heron.spi.packing.PackingPlan) HeronTopology(org.apache.heron.api.HeronTopology) SchedulerStateManagerAdaptor(org.apache.heron.spi.statemgr.SchedulerStateManagerAdaptor) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

Config (org.apache.heron.spi.common.Config)6 PackingPlan (org.apache.heron.spi.packing.PackingPlan)6 ILauncher (org.apache.heron.spi.scheduler.ILauncher)6 SchedulerStateManagerAdaptor (org.apache.heron.spi.statemgr.SchedulerStateManagerAdaptor)6 HeronTopology (org.apache.heron.api.HeronTopology)3 Test (org.junit.Test)3 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)3 URI (java.net.URI)1 HashSet (java.util.HashSet)1 TopologyAPI (org.apache.heron.api.generated.TopologyAPI)1 LauncherUtils (org.apache.heron.scheduler.utils.LauncherUtils)1 IPacking (org.apache.heron.spi.packing.IPacking)1 PackingException (org.apache.heron.spi.packing.PackingException)1 ContainerPlan (org.apache.heron.spi.packing.PackingPlan.ContainerPlan)1 LauncherException (org.apache.heron.spi.scheduler.LauncherException)1 IStateManager (org.apache.heron.spi.statemgr.IStateManager)1 IUploader (org.apache.heron.spi.uploader.IUploader)1 UploaderException (org.apache.heron.spi.uploader.UploaderException)1