Created
June 9, 2011 15:18
-
-
Save gastaldi/1016948 to your computer and use it in GitHub Desktop.
Forge Maven hasDependency Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.junit.Assert.assertTrue; | |
import org.jboss.forge.project.Project; | |
import org.jboss.forge.project.dependencies.DependencyBuilder; | |
import org.jboss.forge.project.facets.DependencyFacet; | |
import org.jboss.forge.test.AbstractShellTest; | |
import org.junit.Before; | |
import org.junit.Test; | |
public class MavenDependencyTest extends AbstractShellTest | |
{ | |
Project project; | |
@Before | |
public void setUp() throws Exception | |
{ | |
project = initializeJavaProject(); | |
} | |
@Test | |
public void testHasDependencyBehavior() throws Exception | |
{ | |
DependencyFacet dependencyFacet = project.getFacet(DependencyFacet.class); | |
DependencyBuilder forgeShellApiDependency = DependencyBuilder.create().setGroupId("org.jboss.forge") | |
.setArtifactId("forge-shell-api").setVersion("1.0.0-SNAPSHOT"); | |
DependencyBuilder cdiDependency = DependencyBuilder.create().setGroupId("javax.enterprise") | |
.setArtifactId("cdi-api"); | |
dependencyFacet.addDependency(forgeShellApiDependency); | |
assertTrue(dependencyFacet.hasDependency(cdiDependency)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment