Search in sources :

Example 11 with UploaderException

use of com.twitter.heron.spi.uploader.UploaderException in project incubator-heron by apache.

the class SubmitterMainTest method testSubmitTopologyUploaderException.

@Test(expected = UploaderException.class)
public void testSubmitTopologyUploaderException() throws Exception {
    SubmitterMain submitterMain = spy(new SubmitterMain(config, topology));
    doNothing().when(submitterMain).validateSubmit(any(SchedulerStateManagerAdaptor.class), anyString());
    doThrow(new UploaderException("")).when(submitterMain).uploadPackage(eq(uploader));
    try {
        submitterMain.submitTopology();
    } finally {
        verify(uploader, never()).undo();
        verify(uploader).close();
        verify(launcher).close();
        verify(statemgr).close();
    }
}
Also used : UploaderException(com.twitter.heron.spi.uploader.UploaderException) SchedulerStateManagerAdaptor(com.twitter.heron.spi.statemgr.SchedulerStateManagerAdaptor) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

UploaderException (com.twitter.heron.spi.uploader.UploaderException)11 SchedulerStateManagerAdaptor (com.twitter.heron.spi.statemgr.SchedulerStateManagerAdaptor)4 IOException (java.io.IOException)3 URI (java.net.URI)3 URISyntaxException (java.net.URISyntaxException)3 Test (org.junit.Test)3 SdkClientException (com.amazonaws.SdkClientException)2 Config (com.twitter.heron.spi.common.Config)2 PackingException (com.twitter.heron.spi.packing.PackingException)2 PackingPlan (com.twitter.heron.spi.packing.PackingPlan)2 ILauncher (com.twitter.heron.spi.scheduler.ILauncher)2 LauncherException (com.twitter.heron.spi.scheduler.LauncherException)2 IStateManager (com.twitter.heron.spi.statemgr.IStateManager)2 IUploader (com.twitter.heron.spi.uploader.IUploader)2 File (java.io.File)2 URL (java.net.URL)2 CopyOption (java.nio.file.CopyOption)2 Path (java.nio.file.Path)2 StandardCopyOption (java.nio.file.StandardCopyOption)2 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)2