ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs JarTest.java
Date Wed, 12 Mar 2003 10:19:59 GMT
bodewig     2003/03/12 02:19:59

  Modified:    src/etc/testcases/taskdefs jar.xml
               src/testcases/org/apache/tools/ant/taskdefs JarTest.java
  Log:
  currently failing testcase to demonstrate PR: 17780
  
  Revision  Changes    Path
  1.10      +11 -0     ant/src/etc/testcases/taskdefs/jar.xml
  
  Index: jar.xml
  ===================================================================
  RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/jar.xml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- jar.xml	26 Feb 2003 09:57:01 -0000	1.9
  +++ jar.xml	12 Mar 2003 10:19:59 -0000	1.10
  @@ -189,4 +189,15 @@
       </jar>
     </target>
   
  +  <!-- bug 17780 -->
  +  <target name="testUpdateIfOnlyManifestHasChanged"
  +          depends="test4">
  +    <jar destfile="${tmp.jar}" update="true">
  +      <manifest>
  +        <attribute name="Foo" value="bar"/>
  +      </manifest>
  +    </jar>
  +    <mkdir dir="${tmp.dir}"/>
  +    <unzip src="${tmp.jar}" dest="${tmp.dir}"/>
  +  </target>
   </project>
  
  
  
  1.19      +9 -2      ant/src/testcases/org/apache/tools/ant/taskdefs/JarTest.java
  
  Index: JarTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/JarTest.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- JarTest.java	26 Feb 2003 09:57:01 -0000	1.18
  +++ JarTest.java	12 Mar 2003 10:19:59 -0000	1.19
  @@ -67,6 +67,7 @@
   public class JarTest extends BuildFileTest {
   
       private static String tempJar = "tmp.jar";
  +    private static String tempDir = "jartmp/";
       private Reader r1, r2;
   
       public JarTest(String name) {
  @@ -170,9 +171,9 @@
           executeTarget("testManifestStaysIntact");
   
           r1 = new FileReader(getProject()
  -                            .resolveFile("jartmp/manifest"));
  +                            .resolveFile(tempDir + "manifest"));
           r2 = new FileReader(getProject()
  -                            .resolveFile("jartmp/META-INF/MANIFEST.MF"));
  +                            .resolveFile(tempDir + "META-INF/MANIFEST.MF"));
           Manifest mf1 = new Manifest(r1);
           Manifest mf2 = new Manifest(r2);
           assertEquals(mf1, mf2);
  @@ -218,5 +219,11 @@
           executeTarget("testCreateWithEmptyFilesetSetUp");
           executeTarget("testCreateWithEmptyFileset");
           executeTarget("testCreateWithEmptyFileset");
  +    }
  +
  +    public void testUpdateIfOnlyManifestHasChanged() {
  +        executeTarget("testUpdateIfOnlyManifestHasChanged");
  +        File jarXml = getProject().resolveFile(tempDir + "jar.xml");
  +        assertTrue(jarXml.exists());
       }
   }
  
  
  

Mime
View raw message