ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs JarTest.java
Date Fri, 17 Jan 2003 10:50:57 GMT
bodewig     2003/01/17 02:50:57

  Modified:    src/etc/testcases/taskdefs jar.xml
               src/testcases/org/apache/tools/ant/taskdefs JarTest.java
  Log:
  Add (disabled) tests for 12651
  
  Revision  Changes    Path
  1.6       +17 -1     jakarta-ant/src/etc/testcases/taskdefs/jar.xml
  
  Index: jar.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/testcases/taskdefs/jar.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jar.xml	17 Jan 2003 10:35:09 -0000	1.5
  +++ jar.xml	17 Jan 2003 10:50:57 -0000	1.6
  @@ -3,6 +3,7 @@
   <project name="jar-test" basedir="." default="test1">
   
     <property name="tmp.jar" location="tmp.jar"/>
  +  <property name="tmp.dir" location="jartmp"/>
   
     <target name="test1">
       <jar/>
  @@ -41,7 +42,7 @@
   
     <target name="testRecreateNewerFileSetup" depends="test4">
       <touch file="jar.xml"/>
  -    <sleep seconds="2"/>
  +    <sleep seconds="3"/>
       <touch file="${tmp.jar}"/>
     </target>
   
  @@ -79,8 +80,23 @@
       />
     </target>
   
  +  <target name="testManifestStaysIntact">
  +    <mkdir dir="${tmp.dir}"/>
  +    <manifest file="${tmp.dir}/manifest">
  +      <attribute name="Foo" value="bar"/>
  +    </manifest>
  +    <jar destfile="${tmp.jar}" basedir="." includes="jar.xml"
  +         manifest="${tmp.dir}/manifest"/>
  +    <sleep seconds="3"/>
  +    <touch file="jar.xml"/>
  +    <jar destfile="${tmp.jar}" basedir="." includes="jar.xml"
  +         update="true"/>
  +    <unjar src="${tmp.jar}" dest="${tmp.dir}"/>
  +  </target>    
  +
     <target name="cleanup">
       <delete file="${tmp.jar}" />
  +    <delete dir="${tmp.dir}"/>
     </target>
   
   </project>
  
  
  
  1.10      +14 -0     jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/JarTest.java
  
  Index: JarTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/JarTest.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JarTest.java	17 Jan 2003 10:35:10 -0000	1.9
  +++ JarTest.java	17 Jan 2003 10:50:57 -0000	1.10
  @@ -55,6 +55,8 @@
   package org.apache.tools.ant.taskdefs;
   
   import java.io.File;
  +import java.io.FileReader;
  +import java.io.IOException;
   import java.util.Date;
   import org.apache.tools.ant.BuildFileTest;
   
  @@ -148,5 +150,17 @@
           jarFile = new File(getProjectDir(), tempJar);
           assertTrue("jar has been recreated in " + secondTarget,
                      jarModifiedDate < jarFile.lastModified());
  +    }
  +
  +    public void XtestManifestStaysIntact() 
  +        throws IOException, ManifestException {
  +        executeTarget("testManifestStaysIntact");
  +        Manifest mf1 = 
  +            new Manifest(new FileReader(getProject()
  +                                        .resolveFile("jartmp/manifest")));
  +        Manifest mf2 = 
  +            new Manifest(new FileReader(getProject()
  +                                        .resolveFile("jartmp/META-INF/MANIFEST.MF")));
  +        assertEquals(mf1, mf2);
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message