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

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


   private ShellTest shellTest;

   @Test
   public void testListSystemProperties() throws Exception
   {
      Result result = shellTest.execute("system-property-get", 5, TimeUnit.SECONDS);
      Assert.assertThat(result, is(not(instanceOf(Failed.class))));
      String out = shellTest.getStdOut();
      //assert that console output contains some predefined system properties
      Assert.assertThat(out, containsString("user.name"));
      Assert.assertThat(out, containsString("user.home"));
View Full Code Here


   }

   @Test
   public void testSetSystemProperty() throws Exception
   {
      Result result = shellTest.execute("system-property-set --named foo --value bar", 5, TimeUnit.SECONDS);
      Assert.assertThat(result, is(not(instanceOf(Failed.class))));
      Assert.assertEquals("bar", System.getProperty("foo"));
   }
View Full Code Here

   @Test
   public void testGetSystemProperty() throws Exception
   {
      System.setProperty("foo", "bar");
      Result result = shellTest.execute("system-property-get --named foo", 5, TimeUnit.SECONDS);
      Assert.assertThat(result, is(not(instanceOf(Failed.class))));
      Assert.assertThat(shellTest.getStdOut(), containsString("bar"));
   }
View Full Code Here

   }

    @Test
    public void testGetUnknownSystemProperty() throws Exception
    {
        Result result = shellTest.execute("system-property-get --named blah", 5, TimeUnit.SECONDS);
        Assert.assertThat(result, is(not(instanceOf(Failed.class))));
        Assert.assertEquals(result.getMessage(), null);
    }
View Full Code Here

   private ShellTest shellTest;

   @Test
   public void testDateCommandWithDefaultPattern() throws Exception
   {
      Result result = shellTest.execute("date", 5, TimeUnit.SECONDS);
      Assert.assertThat(result, is(not(instanceOf(Failed.class))));
   }
View Full Code Here

         Assert.assertFalse(controller.isValid());
         controller.setValueFor("name", "Lincoln");
         controller.setValueFor("anyData", "SomethingElse");
         Assert.assertTrue(controller.isValid());

         Result result = controller.execute();
         Assert.assertTrue(!(result instanceof Failed));

         Assert.assertTrue(controller.getMetadata().getType().equals(ExampleAnnotatedCommand.class));
      }
   }
View Full Code Here

   @Test
   public void testDateCommandWithLegalPattern() throws Exception
   {
      String formattedDate = new SimpleDateFormat("yyyyMMdd").format(new Date());
      Result result = shellTest.execute("date --pattern yyyyMMdd", 5, TimeUnit.SECONDS);
      Assert.assertThat(result, is(not(instanceOf(Failed.class))));
      String out = shellTest.getStdOut();
      Assert.assertThat(out, containsString(formattedDate));
   }
View Full Code Here

      {
         controller.initialize();
         Assert.assertEquals(Boolean.FALSE, controller.getValueFor("value"));
         controller.setValueFor("value", "true");
         Assert.assertTrue(controller.isValid());
         Result result = controller.execute();
         Assert.assertEquals("true", result.getMessage());
      }
   }
View Full Code Here

   }

   @Test
   public void testDateCommandWithIllegalPattern() throws Exception
   {
      Result result = shellTest.execute("date --pattern foo", 5, TimeUnit.SECONDS);
      Assert.assertTrue(result instanceof Failed);
      String out = shellTest.getStdErr();
      Assert.assertThat(out, containsString("Illegal date pattern: foo"));
   }
View Full Code Here

      temp.deleteOnExit();
      shellTest.getShell().setCurrentResource(temp);
      Resource<?> child = temp.getChild("foo.txt");
      Assert.assertFalse(child.exists());

      Result result = shellTest.execute("touch foo.txt", 5, TimeUnit.SECONDS);
      Assert.assertFalse(result instanceof Failed);

      Assert.assertTrue(child.exists());
      child.delete();
   }
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.