Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-2109 Refactoring the UICommands
  3. FORGE-2275

Refactor the Java EE Tests with new @AddonDependency

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Major Major
    • 2.15.2.Final
    • 2.15.1.Final
    • Java EE
    • None

      The JPA / Bean Validation / CDI Tests have recently been strenghten. It is important to refactor them with new @AddonDependency management (because these tests are used in the Tutorials and should use the latest dependency management)

      Tests should look like this : https://github.com/forge/core/blob/master/maven/tests/src/test/java/org/jboss/forge/addon/maven/projects/facets/MavenFacetTest.java

      There is a command to create tests : addon-new-test
      https://github.com/forge/core/blob/master/addons/impl/src/main/java/org/jboss/forge/addon/addons/ui/NewFurnaceTestCommandImpl.java

      So the tests go from :

         @Deployment
         @AddonDeployments({
                  @AddonDeployment(name = "org.jboss.forge.addon:ui"),
                  @AddonDeployment(name = "org.jboss.forge.addon:ui-test-harness"),
                  @AddonDeployment(name = "org.jboss.forge.addon:shell-test-harness"),
                  @AddonDeployment(name = "org.jboss.forge.addon:javaee"),
                  @AddonDeployment(name = "org.jboss.forge.addon:maven")
         })
         public static AddonArchive getDeployment()
         {
            return ShrinkWrap
                     .create(AddonArchive.class)
                     .addClass(ProjectHelper.class)
                     .addBeansXML()
                     .addAsAddonDependencies(
                              AddonDependencyEntry.create("org.jboss.forge.furnace.container:cdi"),
                              AddonDependencyEntry.create("org.jboss.forge.addon:projects"),
                              AddonDependencyEntry.create("org.jboss.forge.addon:ui"),
                              AddonDependencyEntry.create("org.jboss.forge.addon:ui-test-harness"),
                              AddonDependencyEntry.create("org.jboss.forge.addon:shell-test-harness"),
                              AddonDependencyEntry.create("org.jboss.forge.addon:javaee"),
                              AddonDependencyEntry.create("org.jboss.forge.addon:maven")
                     );
         }
      

      To

         @Deployment
         @AddonDependencies({
                  @AddonDependency(name = "org.jboss.forge.addon:ui-test-harness"),
                  @AddonDependency(name = "org.jboss.forge.addon:shell-test-harness"),
                  @AddonDependency(name = "org.jboss.forge.addon:javaee"),
                  @AddonDependency(name = "org.jboss.forge.addon:maven"),
                  @AddonDependency(name = "org.jboss.forge.furnace.container:cdi")
         })
         public static AddonArchive getDeployment()
         {
            return ShrinkWrap.create(AddonArchive.class).addBeansXML().addClass(ProjectHelper.class);
         }
      

      But there is still a problem with the setup commands JPASetupWizardTest, RestSetupTest and WebSocketSetupWizardTest

              agoncal Antonio Goncalves (Inactive)
              agoncal Antonio Goncalves (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: