Package org.jboss.forge.addon.parser.java.facets

Examples of org.jboss.forge.addon.parser.java.facets.JavaSourceFacet


         Dependency dependency = DependencyBuilder.create(addonDependency.getName()).setVersion(
                  addonDependency.getVersion().toString())
                  .setClassifier(MavenAddonDependencyResolver.FORGE_ADDON_CLASSIFIER).setScopeType("test");
         Assert.assertTrue(deps.hasEffectiveDependency(dependency));
      }
      JavaSourceFacet facet = project.getFacet(JavaSourceFacet.class);
      JavaResource javaResource = facet.getTestJavaResource("org.jboss.forge.test.MyTestCase");
      Assert.assertNotNull(javaResource);
      Assert.assertThat(javaResource.getJavaType(), is(instanceOf(JavaClass.class)));
      Assert.assertFalse(javaResource.getJavaType().hasSyntaxErrors());

      Resource<?> finalArtifact = project.getFacet(PackagingFacet.class).getFinalArtifact();
View Full Code Here


            }
         }
      }
      else if (project.hasFacet(JavaSourceFacet.class))
      {
         JavaSourceFacet facet = project.getFacet(JavaSourceFacet.class);
         targetLocation.setDefaultValue(facet.getSourceDirectory()).setEnabled(false);
         targetPackage.setValue(calculateBackingBeanPackage(project));
      }
      builder.add(targetLocation);
      builder.add(targetPackage).add(named);
   }
View Full Code Here

            throws FileNotFoundException
   {
      Project selectedProject = getSelectedProject(context);
      if (selectedProject != null)
      {
         JavaSourceFacet facet = selectedProject.getFacet(JavaSourceFacet.class);
         facet.saveJavaSource(field.getOrigin());
      }
      context.getUIContext().setSelection(javaResource);
   }
View Full Code Here

   @Test(expected = ResourceException.class)
   public void testNullRelativePath() throws Exception
   {
      Project project = projectFactory.createTempProject();
      JavaSourceFacet facet = facetFactory.install(project, JavaSourceFacet.class);
      facet.getJavaResource((String) null);
   }
View Full Code Here

   @Test(expected = ResourceException.class)
   public void testEmptyRelativePath() throws Exception
   {
      Project project = projectFactory.createTempProject();
      JavaSourceFacet facet = facetFactory.install(project, JavaSourceFacet.class);
      facet.getJavaResource("");
   }
View Full Code Here

      String testPackage = "org.jboss.forge.testpkg";

      targetClass.setPackage(testPackage);
      testEnum.setPackage(testPackage);

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

      javaSourceFacet.saveJavaSource(targetClass);
      javaSourceFacet.saveJavaSource(testEnum);

      assertThat(fieldOperations.isFieldTypeEnum(project, targetClass, "TestEnum"), is(true));
      assertThat(fieldOperations.isFieldTypeEnum(project, targetClass, "org.jboss.forge.testpkg.TestEnum"), is(true));

      assertThat(fieldOperations.isFieldTypeEnum(project, targetClass, "NotExist"), is(false));
View Full Code Here

      Assert.assertTrue(controller.isValid());
      Assert.assertTrue(controller.canExecute());
      Result result = controller.execute();
      Assert.assertThat(result, is(not(instanceOf(Failed.class))));

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

      final List<JavaClass<?>> embeddables = new ArrayList<>();
      facet.visitJavaSources(new JavaResourceVisitor()
      {
         @Override
         public void visit(VisitContext context, JavaResource resource)
         {
            try
View Full Code Here

      Assert.assertTrue(controller.isValid());
      Assert.assertTrue(controller.canExecute());
      Result result = controller.execute();
      Assert.assertThat(result, is(not(instanceOf(Failed.class))));

      JavaSourceFacet facet = project.getFacet(JavaSourceFacet.class);
      JavaResource javaResource = facet.getJavaResource("org.jboss.forge.test.MyInterceptorBinding");
      Assert.assertNotNull(javaResource);
      Assert.assertThat(javaResource.getJavaType(), is(instanceOf(JavaAnnotation.class)));
      JavaAnnotation<?> ann = javaResource.getJavaType();
      Assert.assertTrue(ann.hasAnnotation(InterceptorBinding.class));
      Assert.assertFalse(ann.hasAnnotation(Inherited.class));
View Full Code Here

      Assert.assertTrue(controller.isValid());
      Assert.assertTrue(controller.canExecute());
      Result result = controller.execute();
      Assert.assertThat(result, is(not(instanceOf(Failed.class))));

      JavaSourceFacet facet = project.getFacet(JavaSourceFacet.class);
      JavaResource javaResource = facet.getJavaResource("org.jboss.forge.test.MyQualifier");
      Assert.assertNotNull(javaResource);
      Assert.assertThat(javaResource.getJavaType(), is(instanceOf(JavaAnnotation.class)));
      JavaAnnotation<?> ann = javaResource.getJavaType();
      Assert.assertTrue(ann.hasAnnotation(Qualifier.class));
      Assert.assertFalse(ann.hasAnnotation(Inherited.class));
View Full Code Here

      Assert.assertTrue(controller.isValid());
      Assert.assertTrue(controller.canExecute());
      Result result = controller.execute();
      Assert.assertThat(result, is(not(instanceOf(Failed.class))));

      JavaSourceFacet facet = project.getFacet(JavaSourceFacet.class);
      JavaResource javaResource = facet.getJavaResource("org.jboss.forge.test.MyInheritedQualifier");
      Assert.assertNotNull(javaResource);
      Assert.assertThat(javaResource.getJavaType(), is(instanceOf(JavaAnnotation.class)));
      JavaAnnotation<?> ann = javaResource.getJavaType();
      Assert.assertTrue(ann.hasAnnotation(Qualifier.class));
      Assert.assertTrue(ann.hasAnnotation(Inherited.class));
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.parser.java.facets.JavaSourceFacet

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.