Skip to content

Commit

Permalink
added 1 more unit test for maven module
Browse files Browse the repository at this point in the history
  • Loading branch information
hofmeister committed Feb 17, 2013
1 parent 55eaf01 commit 7d2323b
Showing 1 changed file with 22 additions and 0 deletions.
Expand Up @@ -30,6 +30,28 @@ public void testResolveDependencies() throws Exception {
assertTrue("Found more than 1 dependency (result includes itself)",artifacts.size() > 1);
}


@Test
public void testAddRepository() throws Exception {
Maven mvn = new Maven();

boolean gotException = false;
try {
mvn.resolveArtifact("com.caucho", "resin-hessian", "3.2.1");

} catch(ArtifactResolutionException ex) {
gotException = true;
}
assertTrue("Artifact could not be resolved from maven central",gotException);

//Add additional maven repo.
mvn.addRepository("caucho","http://caucho.com/m2");

final Artifact artifact = mvn.resolveArtifact("com.caucho", "resin-hessian", "3.2.1");

assertTrue("Got jar file that doesn't exist in Maven Central repo", artifact.getFile().exists());
}

@Test
public void testAddArtifact() throws Exception {
Maven mvn = new Maven();
Expand Down

0 comments on commit 7d2323b

Please sign in to comment.