Permalink
Browse files

added 1 more unit test for maven module

  • Loading branch information...
1 parent 55eaf01 commit 7d2323bbf1d1f93c7223a475f35f93869e81e2b5 @hofmeister committed Feb 17, 2013
Showing with 22 additions and 0 deletions.
  1. +22 −0 modules/webi-maven/src/test/java/com/vonhof/webi/maven/MavenTest.java
View
22 modules/webi-maven/src/test/java/com/vonhof/webi/maven/MavenTest.java
@@ -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();

0 comments on commit 7d2323b

Please sign in to comment.