Package org.jboss.forge.addon.ui.impl.mock

Examples of org.jboss.forge.addon.ui.impl.mock.MockUIRuntime


   {
      MockUIContext context = new MockUIContext();
      WizardTestListener wizardListener = new WizardTestListener();
      context.addCommandExecutionListener(wizardListener);

      try (CommandController controller = controllerFactory.createWizardController(context, new MockUIRuntime(),
               flowExampleWizard))
      {
         controller.initialize();
         Assert.assertTrue(controller.canExecute());
         controller.execute();
View Full Code Here


   }

   @Test
   public void testSingleCommandController() throws Exception
   {
      CommandController controller = controllerFactory.createSingleController(new MockUIContext(), new MockUIRuntime(),
               exampleCommand);
      Assert.assertTrue(controller.isEnabled());
      Assert.assertFalse(controller.isInitialized());

      controller.initialize();
View Full Code Here

   }

   @Test(expected = IllegalArgumentException.class)
   public void testInitialized() throws Exception
   {
      CommandController controller = controllerFactory.createSingleController(new MockUIContext(), new MockUIRuntime(),
               exampleCommand);
      Assert.assertFalse(controller.getInputs().isEmpty());
   }
View Full Code Here

   }

   @Test
   public void testExampleNoUI() throws Exception
   {
      CommandController controller = controllerFactory.createSingleController(new MockUIContext(), new MockUIRuntime(),
               exampleNoUICommand);
      controller.initialize();
      Assert.assertTrue(controller.getInputs().isEmpty());
      Assert.assertTrue(controller.isValid());
      Assert.assertTrue(controller.canExecute());
View Full Code Here

   @Test
   public void testWizardCanMoveToNextStep() throws Exception
   {
      try (WizardCommandController controller = controllerFactory.createWizardController(new MockUIContext(),
               new MockUIRuntime(),
               flowExampleWizard))
      {
         controller.initialize();
         Assert.assertFalse(controller.canMoveToNextStep());
         controller.setValueFor("hasNext", Boolean.TRUE);
View Full Code Here

   }

   @Test
   public void testPreStepsCommand() throws Exception
   {
      try (CommandController controller = controllerFactory.createController(new MockUIContext(), new MockUIRuntime(),
               preStepsCommand))
      {
         Assert.assertThat(controller, instanceOf(WizardCommandController.class));
         WizardCommandController wizardController = (WizardCommandController) controller;
         wizardController.initialize();
View Full Code Here

   }

   @Test
   public void testControllerShouldNotCallCommandValidateWhenRequiredInputsAreMissing() throws Exception
   {
      try (CommandController controller = controllerFactory.createController(new MockUIContext(), new MockUIRuntime(),
               validateRequiredCommand))
      {
         controller.initialize();
         Assert.assertFalse(controller.isValid());
         controller.setValueFor("input", "Any value");
View Full Code Here

   @Test
   public void testWizardNoUI() throws Exception
   {
      WizardCommandController controller = controllerFactory.createWizardController(new MockUIContext(),
               new MockUIRuntime(),
               noUIWizard);
      controller.initialize();
      Assert.assertFalse(controller.canMoveToNextStep());
      Assert.assertFalse(controller.canMoveToPreviousStep());
      Assert.assertThat(controller.getCommand(), instanceOf(WithInputWizard.class));
View Full Code Here

   @Test
   public void testWizardWithNoUIStep() throws Exception
   {
      WizardCommandController controller = controllerFactory.createWizardController(new MockUIContext(),
               new MockUIRuntime(),
               withInputWizard);
      controller.initialize();
      Assert.assertFalse(controller.canMoveToNextStep());
      Assert.assertFalse(controller.canMoveToPreviousStep());
      Assert.assertThat(controller.getCommand(), instanceOf(WithInputWizard.class));
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.ui.impl.mock.MockUIRuntime

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.