Permalink
Browse files

Added MavenPluginFacet to MavenProjectLocator

  • Loading branch information...
1 parent 7fab6fb commit f06d9298e62406217d8e4ec8e4e245c7936b5183 @gastaldi gastaldi committed Apr 10, 2013
@@ -62,6 +62,7 @@ public String toString()
};
MavenFacet mavenFacet = factory.create(MavenFacet.class, project);
+ MavenPluginFacet mavenPluginFacet = factory.create(MavenPluginFacet.class, project);
MetadataFacet metadataFacet = factory.create(MavenMetadataFacet.class, project);
PackagingFacet packagingFacet = factory.create(MavenPackagingFacet.class, project);
DependencyFacet dependencyFacet = factory.create(MavenDependencyFacet.class, project);
@@ -72,6 +73,7 @@ public String toString()
&& project.install(packagingFacet)
&& project.install(dependencyFacet)
&& project.install(resourceFacet)
+ && project.install(mavenPluginFacet)
))
{
@@ -17,7 +17,14 @@
import org.jboss.forge.container.Forge;
import org.jboss.forge.container.addons.AddonId;
import org.jboss.forge.container.repositories.AddonDependencyEntry;
+import org.jboss.forge.maven.projects.MavenFacet;
+import org.jboss.forge.maven.projects.MavenPluginFacet;
import org.jboss.forge.maven.projects.MavenProjectLocator;
+import org.jboss.forge.projects.Project;
+import org.jboss.forge.projects.facets.DependencyFacet;
+import org.jboss.forge.projects.facets.MetadataFacet;
+import org.jboss.forge.projects.facets.PackagingFacet;
+import org.jboss.forge.projects.facets.ResourceFacet;
import org.jboss.forge.resource.DirectoryResource;
import org.jboss.forge.resource.FileResource;
import org.jboss.forge.resource.ResourceFactory;
@@ -78,4 +85,20 @@ public void testFindProject() throws Exception
projectDir.delete(true);
}
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testEnabledFacets() throws Exception
+ {
+ DirectoryResource addonDir = factory.create(forge.getRepositories().get(0).getRootDirectory()).reify(
+ DirectoryResource.class);
+ DirectoryResource projectDir = addonDir.createTempResource();
+ Project project = locator.createProject(projectDir);
+ boolean hasFacets = project.hasAllFacets(MavenFacet.class, MavenPluginFacet.class,
+ MetadataFacet.class, PackagingFacet.class, DependencyFacet.class, ResourceFacet.class);
+ Assert.assertTrue(hasFacets);
+
+ projectDir.delete(true);
+ }
+
}

0 comments on commit f06d929

Please sign in to comment.