/** * Test method for {@link org.irods.jargon.icommandinvoke.icommands.ImkdirCommand#buildCommand()} * . */ @Test public void testExecMkdirCommand() throws Exception { ImkdirCommand command = new ImkdirCommand(); String testingDirName = "mkdir-test"; command.setCollectionName( testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties( testingProperties, testingDirName)); IrodsInvocationContext invocationContext = testingPropertiesHelper.buildIRODSInvocationContextFromTestProperties(testingProperties); IcommandInvoker invoker = new IcommandInvoker(invocationContext); invoker.invokeCommandAndGetResultAsString(command); // use an ils command to see if the dir now exists IlsCommand ilsCommand = new IlsCommand(); ilsCommand.setIlsBasePath( testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties( testingProperties, testingDirName)); String ilsResult = invoker.invokeCommandAndGetResultAsString(ilsCommand); Assert.assertTrue("test directory is not there", ilsResult.indexOf(testingDirName) > -1); }
/** * Test method for {@link org.irods.jargon.icommandinvoke.icommands.ImkdirCommand#buildCommand()} * . */ @Test public void testCanBuildValidMkdirCommand() throws Exception { ImkdirCommand command = new ImkdirCommand(); command.setCollectionName("scratch"); command.buildCommand(); }
/** * Test method for {@link org.irods.jargon.icommandinvoke.icommands.ImkdirCommand#buildCommand()} * . */ @Test(expected = IllegalArgumentException.class) public void testZeroLengthCollection() throws Exception { ImkdirCommand command = new ImkdirCommand(); command.setCollectionName(""); command.buildCommand(); }