Package org.jboss.forge.addon.ui.controller

Examples of org.jboss.forge.addon.ui.controller.WizardCommandController.execute()


         public void postCommandExecuted(UICommand command, UIExecutionContext context, Result result)
         {
            counter.incrementAndGet();
         }
      });
      tester.execute();

      UISelection<Object> selection = tester.getContext().getSelection();
      Assert.assertFalse(selection.isEmpty());
      Assert.assertTrue(selection.get() instanceof FileResource);
      Assert.assertEquals("persistence.xml", ((FileResource) selection.get()).getName());
View Full Code Here


      tester.setValueFor("container", eap6Container);
      Assert.assertTrue(tester.canMoveToNextStep());

      tester.next().initialize();

      Result result = tester.execute();
      Assert.assertFalse(result instanceof Failed);

      // Check SUT values
      PersistenceCommonDescriptor config = (PersistenceCommonDescriptor) project.getFacet(JPAFacet.class).getConfig();
      List<PersistenceUnitCommon> allUnits = config.getAllPersistenceUnit();
View Full Code Here

      tester2.setValueFor("container", eap6Container);
      Assert.assertTrue(tester2.canMoveToNextStep());

      tester2.next().initialize();

      result = tester2.execute();
      Assert.assertFalse(result instanceof Failed);

      config = (PersistenceCommonDescriptor) project.getFacet(JPAFacet.class).getConfig();
      allUnits = config.getAllPersistenceUnit();
      Assert.assertEquals(project.getFacet(MetadataFacet.class).getProjectName()
View Full Code Here

      tester3.next().initialize();
      tester3.setValueFor("persistenceUnitName", project.getFacet(MetadataFacet.class).getProjectName()
               + PersistenceOperations.DEFAULT_UNIT_SUFFIX);
      tester3.setValueFor("overwritePersistenceUnit", true);

      result = tester3.execute();
      Assert.assertFalse(result instanceof Failed);

      // Check SUT values
      config = (PersistenceCommonDescriptor) project.getFacet(JPAFacet.class).getConfig();
      allUnits = config.getAllPersistenceUnit();
View Full Code Here

         public void postCommandExecuted(UICommand command, UIExecutionContext context, Result result)
         {
            counter.incrementAndGet();
         }
      });
      tester.execute();
      // Ensure that the two pages were invoked
      Assert.assertEquals(2, counter.get());

      // Reload to refresh facets.
      project = projectFactory.findProject(project.getRoot());
View Full Code Here

      Assert.assertNull(model.getName());
      tester.setValueFor("firstName", "Forge");
      Assert.assertNotNull(model);
      Assert.assertFalse(tester.canMoveToNextStep());
      Assert.assertEquals("Forge", model.getName());
      tester.execute();
   }

   @Test
   @org.junit.Ignore("FORGE-1209")
   public void testImportedWithCustomScope() throws Exception
View Full Code Here

      tester.initialize();
      Assert.assertTrue("Should not be satisfied since there is no Context in scope", modelInstance.isUnsatisfied());
      Assert.assertTrue(tester.isValid());
      Assert.assertFalse("Should be satisfied since there command context was initialized",
               modelInstance.isUnsatisfied());
      tester.execute();
      Assert.assertTrue("Should not be satisfied since there is no Context in scope after finish is called",
               modelInstance.isUnsatisfied());
   }
}
View Full Code Here

      {
         Assert.assertFalse(wizard.isValid());
         wizard.setValueFor("regexp", "[0-9]");
         Assert.assertTrue(wizard.isValid());
      }
      wizard.execute();
      JavaClassSource javaClass = jpaEntity.getJavaType();
      FieldSource<JavaClassSource> field = javaClass.getField("id");
      AnnotationSource<JavaClassSource> pattern = field.getAnnotation(Pattern.class);
      Assert.assertNotNull(pattern);
      Assert.assertEquals("[0-9]", pattern.getStringValue("regexp"));
View Full Code Here

      {
         Assert.assertFalse(wizard.isValid());
         wizard.setValueFor("regexp", "^\\d{9}[\\d|X]$");
         Assert.assertTrue(wizard.isValid());
      }
      wizard.execute();
      JavaClassSource javaClass = jpaEntity.getJavaType();
      FieldSource<JavaClassSource> field = javaClass.getField("id");
      AnnotationSource<JavaClassSource> pattern = field.getAnnotation(Pattern.class);
      Assert.assertNotNull(pattern);
      Assert.assertEquals("^\\d{9}[\\d|X]$", pattern.getStringValue("regexp"));
View Full Code Here

         Assert.assertTrue(wizard.isValid());
         Assert.assertTrue(wizard.canExecute());

         File targetDirectory = new File(tempDir, "Test-Project-Name-Valid");
         Assert.assertFalse(targetDirectory.exists());
         wizard.execute();

         Assert.assertTrue(targetDirectory.exists());
      }
      finally
      {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.