Examples of saveTestJavaSource()


Examples of org.jboss.forge.addon.parser.java.facets.JavaSourceFacet.saveTestJavaSource()

      {
         getDeployment.addAnnotation("Dependencies").setLiteralValue("{" + annotationBody + "}");
      }

      JavaSourceFacet facet = project.getFacet(JavaSourceFacet.class);
      JavaResource javaResource = facet.saveTestJavaSource(javaClass);
      uiContext.setSelection(javaResource);
      return Results.success("Test class " + javaClass.getQualifiedName() + " created");
   }

   @Override
View Full Code Here

Examples of org.jboss.forge.addon.parser.java.facets.JavaSourceFacet.saveTestJavaSource()

         Project project = getFaceted();
         JavaSourceFacet facet = project.getFacet(JavaSourceFacet.class);
         String topLevelPackage = facet.getBasePackage();
         JavaClassSource testClass = Roaster.create(JavaClassSource.class).setPackage(topLevelPackage);
         testClass.setName("AbstractTestCase").setAbstract(true);
         facet.saveTestJavaSource(testClass.getEnclosingType());
         return true;
      }
      return false;
   }
View Full Code Here

Examples of org.jboss.forge.parser.java.facets.JavaSourceFacet.saveTestJavaSource()

         JavaClass testClass = JavaParser.create(JavaClass.class).setPackage(topLevelPackage);
         testClass.setName("AbstractTestCase").setAbstract(true);
         JavaSourceFacet facet = project.getFacet(JavaSourceFacet.class);
         try
         {
            facet.saveTestJavaSource(testClass.getEnclosingType());
         }
         catch (FileNotFoundException ffe)
         {
            // this is not good :P
            ffe.printStackTrace();
View Full Code Here

Examples of org.jboss.forge.project.facets.JavaSourceFacet.saveTestJavaSource()

      CompiledTemplateResource testSource = compiler.compileResource(getClass().getResourceAsStream(
               "/org/jboss/forge/dev/PluginTemplateTest.jv"));

      JavaResource pluginResource = java.saveJavaSource(JavaParser.parse(JavaClass.class, pluginSource.render(context))
               .setPackage(packg));
      java.saveTestJavaSource(JavaParser.parse(JavaClass.class, testSource.render(context)).setPackage(packg));

      pickup.fire(new PickupResource(pluginResource));
   }

   public String canonicalize(final String name)
View Full Code Here

Examples of org.jboss.forge.project.facets.JavaSourceFacet.saveTestJavaSource()

         {
            clazz.removeAnnotation(clazz.getAnnotation(Ignore.class));
         }

         clazz.addImport(Arquillian.class);
         java.saveTestJavaSource(clazz);
      }
      catch (FileNotFoundException e) {
         throw new RuntimeException(e);
      }
   }
View Full Code Here

Examples of org.jboss.forge.project.facets.JavaSourceFacet.saveTestJavaSource()

         JavaSourceFacet java = project.getFacet(JavaSourceFacet.class);

         JavaResource root = java.getTestJavaResource(java.getBasePackage() + ".Root");
         if (!root.exists())
         {
            java.saveTestJavaSource(JavaParser.create(JavaInterface.class).setName("Root")
                     .setPackage(java.getBasePackage()));
         }
         clazz.addImport(root.getJavaSource());

         clazz.addImport(WebArchive.class);
View Full Code Here

Examples of org.jboss.forge.project.facets.JavaSourceFacet.saveTestJavaSource()

      CompiledTemplateResource testSource = compiler.compileResource(getClass().getResourceAsStream(
               "/org/jboss/forge/dev/PluginTemplateTest.jv"));

      JavaResource pluginResource = java.saveJavaSource(JavaParser.parse(JavaClass.class, pluginSource.render(context))
               .setPackage(packg));
      java.saveTestJavaSource(JavaParser.parse(JavaClass.class, testSource.render(context)).setPackage(packg));

      pickup.fire(new PickupResource(pluginResource));
   }

   public String canonicalize(final String name)
View Full Code Here

Examples of org.jboss.forge.project.facets.JavaSourceFacet.saveTestJavaSource()

      CompiledTemplateResource testSource = compiler.compileResource(getClass().getResourceAsStream(
               "/org/jboss/forge/dev/PluginTemplateTest.jv"));

      JavaResource pluginResource = java.saveJavaSource(JavaParser.parse(JavaClass.class, pluginSource.render(context))
               .setPackage(packg));
      java.saveTestJavaSource(JavaParser.parse(JavaClass.class, testSource.render(context)).setPackage(packg));

      pickup.fire(new PickupResource(pluginResource));
   }

   public String canonicalize(final String name)
View Full Code Here

Examples of org.jboss.forge.project.facets.JavaSourceFacet.saveTestJavaSource()

      final StringWriter writer = new StringWriter();
      Velocity.mergeTemplate(testFrameworkFacet.getTemplateName(), "UTF-8", context, writer);

      final JavaClass testClass = JavaParser.parse(JavaClass.class, writer.toString());
      java.saveTestJavaSource(testClass);
      pickup.fire(new PickupResource(java.getTestJavaResource(testClass)));
   }

   private VelocityContext initializeVelocityContext(boolean enableJPA, JavaSource<?> javaSource)
   {
View Full Code Here

Examples of org.jboss.forge.project.facets.JavaSourceFacet.saveTestJavaSource()

      CompiledTemplateResource testSource = compiler.compileResource(getClass().getResourceAsStream(
               "/org/jboss/forge/dev/PluginTemplateTest.jv"));

      JavaResource pluginResource = java.saveJavaSource(JavaParser.parse(JavaClass.class, pluginSource.render(context))
               .setPackage(packg));
      java.saveTestJavaSource(JavaParser.parse(JavaClass.class, testSource.render(context)).setPackage(packg));

      pickup.fire(new PickupResource(pluginResource));
   }

   public String canonicalize(final String name)
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.