ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r798782 - in /ant/core/trunk/src: etc/testcases/core/antclassloader.xml tests/junit/org/apache/tools/ant/AntClassLoaderTest.java
Date Wed, 29 Jul 2009 04:49:19 GMT
Author: bodewig
Date: Wed Jul 29 04:49:18 2009
New Revision: 798782

URL: http://svn.apache.org/viewvc?rev=798782&view=rev
Log:
passing testcase for PR 47593

Modified:
    ant/core/trunk/src/etc/testcases/core/antclassloader.xml
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java

Modified: ant/core/trunk/src/etc/testcases/core/antclassloader.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/core/antclassloader.xml?rev=798782&r1=798781&r2=798782&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/core/antclassloader.xml (original)
+++ ant/core/trunk/src/etc/testcases/core/antclassloader.xml Wed Jul 29 04:49:18 2009
@@ -72,4 +72,7 @@
                storepass="apacheant" jar="${tmp.dir}/test.jar"/>
     </target>
 
+    <target name="createNonJar">
+      <touch file="${tmp.dir}/foo.jar"/>
+    </target>
 </project>

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java?rev=798782&r1=798781&r2=798782&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java Wed Jul 29
04:49:18 2009
@@ -19,6 +19,7 @@
 package org.apache.tools.ant;
 
 import java.io.File;
+import java.io.IOException;
 import org.apache.tools.ant.types.Path;
 
 /**
@@ -147,6 +148,26 @@
         assertNotNull("should be signed", foo.getSigners());
     }
 
+    /**
+     * @see https://issues.apache.org/bugzilla/show_bug.cgi?id=47593
+     */
+    public void testInvalidZipException() throws Exception {
+        executeTarget("createNonJar");
+        File jar = new File(getProject().getProperty("tmp.dir")
+                            + "/foo.jar");
+
+        Path myPath = new Path(getProject());
+        myPath.setLocation(jar);
+        getProject().setUserProperty("build.sysclasspath","ignore");
+        loader = getProject().createClassLoader(myPath);
+        loader.getResource("foo.txt");
+        String log = getLog();
+        int startMessage = log.indexOf("Unable to obtain resource from ");
+        assertTrue(startMessage >= 0);
+        assertTrue(log.indexOf("foo.jar", startMessage) > 0);
+
+    }
+
     private static class GetPackageWrapper extends ClassLoader {
         GetPackageWrapper(ClassLoader parent) {
             super(parent);



Mime
View raw message