@Test public void testNoArg() throws IOException { try { launchVold(null); throw new AssertionError("Not reached"); } catch (final RunCmdErrorException e) { Assert.assertEquals(1, e.getExitValue()); } }
@Test public void testDirNotExist() throws IOException { final File tempDir = Files.createTempDirectory("vold-launch").toFile(); tempDir.delete(); try { launchVold(new String[] {tempDir.getAbsolutePath()}); throw new AssertionError("Not reached"); } catch (final RunCmdErrorException e) { Assert.assertEquals(1, e.getExitValue()); } }
@Test public void testConfigNotExist() throws IOException { final Path tempDirPath = Files.createTempDirectory("vold-launch"); try { final File tempDir = tempDirPath.toFile(); launchVold(new String[] {tempDir.getAbsolutePath()}); throw new AssertionError("Not reached"); } catch (final RunCmdErrorException e) { Assert.assertEquals(2, e.getExitValue()); } finally { com.oodrive.nuage.utils.Files.deleteRecursive(tempDirPath); } }