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

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


      Assert.assertEquals("mock-command-inputmany --values ", test.getBuffer());

      test.clearScreen();

      // Verify that command execution works for one argument
      Result result = test.execute("mock-command-inputmany --values one", 5, TimeUnit.SECONDS);
      Assert.assertEquals("Command executed with input values : one ", result.getMessage());

      // Verify that command execution works for multiple arguments
      result = test.execute("mock-command-inputmany --values one two three", 5, TimeUnit.SECONDS);
      Assert.assertEquals("Command executed with input values : one two three ", result.getMessage());

      // Verify that command execution fails for no arguments
      test.clearScreen();
      test.waitForStdErrChanged("mock-command-inputmany --values\n", 5, TimeUnit.SECONDS);
      Assert.assertThat(test.getStdErr(),
View Full Code Here


   }
  
   @Test
   public void testGitSetup() throws Exception
   {
      Result result = commandController.execute();
      assertTrue(project.getRootDirectory().getChildDirectory(".git").isDirectory());
      assertEquals("GIT has been installed.", result.getMessage());
   }
View Full Code Here

   {
      commandController.execute();
      assertTrue(project.getRootDirectory().getChildDirectory(".git").isDirectory());
     
      commandController.initialize();
      Result result = commandController.execute();
      assertTrue(project.getRootDirectory().getChildDirectory(".git").isDirectory());
      assertEquals("GIT has been installed.", result.getMessage());
   }
View Full Code Here

   @Test(timeout = 10000)
   public void testExport() throws Exception
   {
      shellTest.execute("export A_VARIABLE=123");
      shellTest.clearScreen();
      Result result = shellTest.execute("echo-export", 5, TimeUnit.SECONDS);
      Assert.assertThat(result.getMessage(), CoreMatchers.containsString("123"));
   }
View Full Code Here

      String stdOut = test.waitForCompletion(QUANTITY, TimeUnit.SECONDS);
      Assert.assertThat(stdOut,
               allOf(containsString(Career.MEDICINE.toString()), containsString(Career.MECHANICS.toString())));

      test.write("*");
      Result result = test.execute(stdOut, QUANTITY, TimeUnit.SECONDS);
      Assert.assertFalse(result instanceof Failed);
      Assert.assertThat(result.getMessage(),
               allOf(containsString(Career.MEDICINE.toString()), containsString(Career.MECHANICS.toString())));
   }
View Full Code Here

   @Test
   public void testVerboseOutput() throws Exception
   {
      shellTest.execute("export VERBOSE=false");
      Thread.sleep(500);
      Result result = shellTest.execute("throw-exception", 5, TimeUnit.SECONDS);
      Assert.assertThat(result, instanceOf(Failed.class));
      Assert.assertThat(shellTest.getStdErr(), not(containsString("Cause Exception")));
      shellTest.clearScreen();
      shellTest.execute("export VERBOSE=true");
      Thread.sleep(500);
View Full Code Here

   @Test
   public void testShellTestUtility() throws Exception
   {
      Assert.assertNotNull(test);

      Result result = test.execute("command-list", 15, TimeUnit.SECONDS);
      Assert.assertNotNull(result);
      Assert.assertFalse(result instanceof Failed);
   }
View Full Code Here

               project.getRoot());
      controller.initialize();
      UISelectMany<AddonId> component = (UISelectMany<AddonId>) controller.getInputs().get("addonDependencies");
      controller.setValueFor("addonDependencies", component.getValueChoices());
      Assert.assertTrue(controller.canExecute());
      Result result = controller.execute();
      Assert.assertFalse(result instanceof Failed);

      Assert.assertTrue(project.hasFacet(AddonTestFacet.class));
   }
View Full Code Here

      Shell shell = test.getShell();
      shell.setCurrentResource(currentResource);
      DirectoryResource child = currentResource.getChildDirectory("Forge 2 Escape");
      child.mkdir();
      child.deleteOnExit();
      Result result = test.execute("cd Forge\\ 2\\ Escape", 10, TimeUnit.SECONDS);
      Assert.assertThat(result.getMessage(), CoreMatchers.nullValue());
      Assert.assertEquals(shell.getCurrentResource(), child);
      currentResource.delete(true);
   }
View Full Code Here

      Shell shell = test.getShell();
      shell.setCurrentResource(currentResource);
      FileResource<?> child = currentResource.getChildDirectory("Forge 2 Escape");
      child.mkdir();
      child.deleteOnExit();
      Result result = test.execute("cd \"Forge 2 Escape\"", 10, TimeUnit.SECONDS);
      Assert.assertThat(result.getMessage(), nullValue());
      Assert.assertEquals(shell.getCurrentResource(), child);
      currentResource.delete(true);
   }
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.