ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r944019 - /ant/ivy/core/trunk/test/java/org/apache/ivy/core/deliver/DeliverTest.java
Date Thu, 13 May 2010 21:20:39 GMT
Author: maartenc
Date: Thu May 13 21:20:38 2010
New Revision: 944019

URL: http://svn.apache.org/viewvc?rev=944019&view=rev
Log:
Changed the location of the deliver directory to "build/test/deliver" instead of the default
"distrib".

Modified:
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/deliver/DeliverTest.java

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/deliver/DeliverTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/deliver/DeliverTest.java?rev=944019&r1=944018&r2=944019&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/deliver/DeliverTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/deliver/DeliverTest.java Thu May 13 21:20:38
2010
@@ -28,39 +28,36 @@ import org.apache.ivy.ant.IvyDeliver;
 import org.apache.ivy.ant.IvyResolve;
 import org.apache.ivy.util.FileUtil;
 import org.apache.tools.ant.Project;
-import org.apache.tools.ant.taskdefs.Delete;
 
 public class DeliverTest extends TestCase {
     private File cache;
+    private File deliverDir;
 
     private IvyDeliver ivyDeliver;
 
     protected void setUp() throws Exception {
-        FileUtil.forceDelete(new File("build/test/publish"));
-        createCache("build/test/publish/cache");
+        cache = new File("build/cache");
         System.setProperty("ivy.cache.dir", cache.getAbsolutePath());
+        createCache();
 
+        deliverDir = new File("build/test/deliver");
+        deliverDir.mkdirs();
+        
         Project project = new Project();
         project.init();
+        
         ivyDeliver = new IvyDeliver();
         ivyDeliver.setProject(project);
-    }
-
-    private void createCache(String filename) {
-        cache = new File(filename);
-        cache.mkdirs();
+        ivyDeliver.setDeliverpattern(deliverDir.getAbsolutePath() + "/[type]s/[artifact]-[revision](-[classifier]).[ext]");
     }
 
     protected void tearDown() throws Exception {
-        cleanCache();
-        FileUtil.forceDelete(new File("build/test/publish"));
+        FileUtil.forceDelete(cache);
+        FileUtil.forceDelete(deliverDir);
     }
 
-    private void cleanCache() {
-        Delete del = new Delete();
-        del.setProject(new Project());
-        del.setDir(cache);
-        del.execute();
+    private void createCache() {
+        cache.mkdirs();
     }
 
     public void testIVY1111() throws Exception {
@@ -74,7 +71,7 @@ public class DeliverTest extends TestCas
         ivyDeliver.setReplacedynamicrev(true);
         ivyDeliver.doExecute();
 
-        String deliverContent = readFile("distrib/ivys/ivy-1.0.xml");
+        String deliverContent = readFile(deliverDir.getAbsolutePath() + "/ivys/ivy-1.0.xml");
         assertTrue(deliverContent.indexOf("rev=\"latest.integration\"") == -1);
         assertTrue(deliverContent.indexOf("name=\"b\" rev=\"1.5\"") >= 0);
     }



Mime
View raw message