示例#1
0
  /**
   * 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);
  }
示例#2
0
 /**
  * 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();
 }
示例#3
0
 /**
  * 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();
 }