Package org.jboss.forge.addon.ui.result

Examples of org.jboss.forge.addon.ui.result.Result


      FileResource<?> tempResource = resourceFactory.create(tempDir).reify(DirectoryResource.class);
      tempDir.deleteOnExit();

      Shell shell = shellTest.getShell();
      shell.setCurrentResource(tempResource);
      Result pwdResult = shellTest.execute("pwd", 10, TimeUnit.SECONDS);
      Assert.assertNotNull(pwdResult);
      Assert.assertThat(shellTest.getStdOut(), containsString(tempResource.getFullyQualifiedName()));
      tempDir.delete();
   }
View Full Code Here


      fileTxt.createNewFile();
      fileTxt.deleteOnExit();

      Shell shell = shellTest.getShell();
      shell.setCurrentResource(tempResource);
      Result pwdResult = shellTest.execute("rm -f file.txt", 10, TimeUnit.SECONDS);
      Assert.assertNotNull(pwdResult);
      Assert.assertFalse(fileTxt.exists());
   }
View Full Code Here

      childDirectory.deleteOnExit();
      tempDir.deleteOnExit();

      Shell shell = shellTest.getShell();
      shell.setCurrentResource(tempResource);
      Result changeDirResult = shellTest.execute("cd child", 10, TimeUnit.SECONDS);
      Assert.assertNotNull(changeDirResult);
      Assert.assertEquals(childDirectory, shell.getCurrentResource());
      childDirectory.delete();
      tempDir.delete();
   }
View Full Code Here

      DirectoryResource tempResource = resourceFactory.create(tempDir).reify(DirectoryResource.class);
      tempDir.deleteOnExit();

      Shell shell = shellTest.getShell();
      shell.setCurrentResource(tempResource);
      Result changeDirResult = shellTest.execute("cd child", 10, TimeUnit.SECONDS);
      Assert.assertTrue(changeDirResult instanceof Failed);
      Assert.assertEquals("child: No such file or directory", changeDirResult.getMessage());
   }
View Full Code Here

      DirectoryResource tempResource = resourceFactory.create(tempDir).reify(DirectoryResource.class);
      tempDir.deleteOnExit();

      Shell shell = shellTest.getShell();
      shell.setCurrentResource(tempResource);
      Result changeDirResult = shellTest.execute("cd " + userHome.getAbsolutePath(), 10, TimeUnit.SECONDS);
      Assert.assertNotNull(changeDirResult);
      Assert.assertEquals(userHome, shell.getCurrentResource().getUnderlyingResourceObject());
   }
View Full Code Here

      DirectoryResource tempResource = resourceFactory.create(tempDir).reify(DirectoryResource.class);
      tempDir.deleteOnExit();

      Shell shell = shellTest.getShell();
      shell.setCurrentResource(tempResource);
      Result changeDirResult = shellTest.execute("cd", 10, TimeUnit.SECONDS);
      Assert.assertNotNull(changeDirResult);
      Assert.assertNull(changeDirResult.getMessage());
   }
View Full Code Here

   public void testDefaultPromptValue() throws Exception
   {
      try (CommandController controller = testHarness.createCommandController("prompt"))
      {
         controller.initialize();
         Result result = controller.execute();
         Assert.assertEquals("You answered: null", result.getMessage());
      }
   }
View Full Code Here

   {
      testHarness.getPromptResults().put("Type something: ", "Something");
      try (CommandController controller = testHarness.createCommandController("prompt"))
      {
         controller.initialize();
         Result result = controller.execute();
         Assert.assertEquals("You answered: Something", result.getMessage());
      }
   }
View Full Code Here

   public void testDefaultBooleanPromptValue() throws Exception
   {
      try (CommandController controller = testHarness.createCommandController("prompt-boolean"))
      {
         controller.initialize();
         Result result = controller.execute();
         Assert.assertEquals("You answered: true", result.getMessage());
      }
   }
View Full Code Here

   {
      testHarness.getPromptResults().put("Do you love Forge 2\\?", "false");
      try (CommandController controller = testHarness.createCommandController("prompt-boolean"))
      {
         controller.initialize();
         Result result = controller.execute();
         Assert.assertEquals("You answered: false", result.getMessage());
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.ui.result.Result

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.