You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2014/07/19 14:44:51 UTC

[1/3] git commit: add some ignores

Repository: ant-antlibs-compress
Updated Branches:
  refs/heads/master e2fa62db4 -> a0f2bae0d


add some ignores


Project: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/commit/fca03fb7
Tree: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/tree/fca03fb7
Diff: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/diff/fca03fb7

Branch: refs/heads/master
Commit: fca03fb71f5b7dffefd1e4ee64c53571d83c3bed
Parents: e2fa62d
Author: Stefan Bodewig <bo...@apache.org>
Authored: Sat Jul 19 14:41:50 2014 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Sat Jul 19 14:41:50 2014 +0200

----------------------------------------------------------------------
 .gitignore | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/fca03fb7/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 34d4c36..6e5356c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,7 @@ lib/optional/*.jar
 src/tests/antunit/core/output
 .idea
 *.iml
+*~
+ivy
+lib
+docs/style.css


[3/3] git commit: use a Java5 compatible pack200 test resource

Posted by bo...@apache.org.
use a Java5 compatible pack200 test resource

The pack200 format depends on the Java version that created it unless
it contains a class file (in which case the target version of the
class file determines the pack version).

http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6712743


Project: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/commit/a0f2bae0
Tree: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/tree/a0f2bae0
Diff: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/diff/a0f2bae0

Branch: refs/heads/master
Commit: a0f2bae0db00c7b39e0aa451dd60171596b9972b
Parents: a562586
Author: Stefan Bodewig <bo...@apache.org>
Authored: Sat Jul 19 14:44:29 2014 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Sat Jul 19 14:44:29 2014 +0200

----------------------------------------------------------------------
 src/tests/antunit/pack200-base.xml         |  44 ++++++++++++++++++
 src/tests/antunit/pack200-test.xml         |  59 +++++++++++-------------
 src/tests/antunit/pack200resource-test.xml |  14 ++----
 src/tests/antunit/unpack200-test.xml       |  45 +++++-------------
 src/tests/resources/Foo.pack               | Bin 0 -> 230 bytes
 src/tests/resources/asf-logo.gif.pack      | Bin 7324 -> 0 bytes
 6 files changed, 88 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/a0f2bae0/src/tests/antunit/pack200-base.xml
----------------------------------------------------------------------
diff --git a/src/tests/antunit/pack200-base.xml b/src/tests/antunit/pack200-base.xml
new file mode 100644
index 0000000..4edbde6
--- /dev/null
+++ b/src/tests/antunit/pack200-base.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<project default="antunit"
+         name="pack200-base"
+         xmlns:au="antlib:org.apache.ant.antunit"
+         xmlns:cmp="antlib:org.apache.ant.compress">
+
+  <import file="antunit-base.xml" />
+
+  <target name="setUp">
+    <mkdir dir="${output}"/>
+    <property name="java.dir" value="${input}/java"/>
+    <mkdir dir="${java.dir}"/>
+    <echo file="${java.dir}/Foo.java">public class Foo {}</echo>
+    <javac srcdir="${java.dir}" destdir="${java.dir}"/>
+    <jar destfile="${input}/test.jar" basedir="${java.dir}"/>
+    <cmp:pack200 destfile="${input}/test.pack"
+                 src="${input}/test.jar"/>
+    <macrodef name="assertFooMatches">
+      <sequential>
+        <au:assertFileExists file="${output}/Foo.java"/>
+        <au:assertFilesMatch
+            actual="${output}/Foo.java"
+            expected="${java.dir}/Foo.java"
+            />
+      </sequential>
+    </macrodef>
+  </target>
+</project>

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/a0f2bae0/src/tests/antunit/pack200-test.xml
----------------------------------------------------------------------
diff --git a/src/tests/antunit/pack200-test.xml b/src/tests/antunit/pack200-test.xml
index 2e8b906..a0533f0 100644
--- a/src/tests/antunit/pack200-test.xml
+++ b/src/tests/antunit/pack200-test.xml
@@ -20,48 +20,45 @@
          xmlns:cond="antlib:org.apache.tools.ant.types.conditions"
          xmlns:cmp="antlib:org.apache.ant.compress">
 
-  <import file="antunit-base.xml" />
-
-  <target name="setUp">
-    <mkdir dir="${output}" />
-  </target>
+  <import file="pack200-base.xml" />
 
   <target name="testRealTest" depends="setUp">
-    <cmp:pack200 src="../resources/asf-logo.gif.zip"
-              destfile="${output}/asf-logo.gif.pack" />
-    <au:assertLogContains text="Building: asf-logo.gif.pack"/>
-    <au:assertFileExists file="${output}/asf-logo.gif.pack"/>
+    <cmp:pack200 destfile="${output}/test.pack"
+                 src="${input}/test.jar"/>
+    <au:assertLogContains text="Building: test.pack"/>
+    <au:assertFileExists file="${output}/test.pack"/>
   </target>
 
   <target name="testRealTestWithResource" depends="setUp">
-    <cmp:pack200 destfile="${output}/asf-logo.gif.pack">
-      <file file="../resources/asf-logo.gif.zip"/>
+    <cmp:pack200 destfile="${output}/test.pack">
+      <file file="${input}/test.jar"/>
     </cmp:pack200>
-    <au:assertLogContains text="Building: asf-logo.gif.pack"/>
-    <au:assertFileExists file="${output}/asf-logo.gif.pack"/>
+    <au:assertLogContains text="Building: test.pack"/>
+    <au:assertFileExists file="${output}/test.pack"/>
   </target>
 
   <target name="testDateCheck" depends="setUp">
-    <touch file="${output}/asf-logo.gif.pack"/>
-    <cmp:pack200 src="../resources/asf-logo.gif.zip"
-              destfile="${output}/asf-logo.gif.pack" />
-    <au:assertLogContains text="Nothing to do: asf-logo.gif.pack is up to date."/>
+    <sleep seconds="2"/>
+    <touch file="${input}/test.pack"/>
+    <cmp:pack200 destfile="${input}/test.pack"
+                 src="${input}/test.jar"/>
+    <au:assertLogContains text="Nothing to do: test.pack is up to date."/>
   </target>
 
   <target name="testNestedTask" depends="setUp">
-    <cmp:pack200 destfile="${output}/asf-logo.zip.pack">
+    <cmp:pack200 destfile="${output}/test.pack">
       <cmp:zip>
         <cmp:cpiofileset src="../resources/asf-logo.gif.bin.cpio"
                          includes="asf-logo.gif"/>
       </cmp:zip>
     </cmp:pack200>
-    <au:assertFileExists file="${output}/asf-logo.zip.pack"/>
+    <au:assertFileExists file="${output}/test.pack"/>
     <au:assertTrue>
       <cond:islastmodified datetime="2009-07-31-20:11:14 +0200"
                            pattern="yyyy-MM-dd-HH:mm:ss Z">
         <cmp:zipentry name="asf-logo.gif">
           <cmp:pack200resource>
-            <file file="${output}/asf-logo.zip.pack"/>
+            <file file="${output}/test.pack"/>
           </cmp:pack200resource>
         </cmp:zipentry>
       </cond:islastmodified>
@@ -69,28 +66,28 @@
   </target>
 
   <target name="testTempFileStrategy" depends="setUp">
-    <cmp:pack200 src="../resources/asf-logo.gif.zip"
-                 destfile="${output}/asf-logo.gif.pack"
+    <cmp:pack200 src="${input}/test.jar"
+                 destfile="${output}/test.pack"
                  pack200strategy="temp-file"/>
-    <au:assertLogContains text="Building: asf-logo.gif.pack"/>
-    <au:assertFileExists file="${output}/asf-logo.gif.pack"/>
+    <au:assertLogContains text="Building: test.pack"/>
+    <au:assertFileExists file="${output}/test.pack"/>
   </target>
 
   <target name="testProperties" depends="setUp">
-    <cmp:pack200 src="../resources/asf-logo.gif.zip"
-                 destfile="${output}/asf-logo.gif.pack">
+    <cmp:pack200 src="${input}/test.jar"
+                 destfile="${output}/test.pack">
       <property key="pack.effort" value="9"/>
     </cmp:pack200>
-    <au:assertLogContains text="Building: asf-logo.gif.pack"/>
-    <au:assertFileExists file="${output}/asf-logo.gif.pack"/>
+    <au:assertLogContains text="Building: test.pack"/>
+    <au:assertFileExists file="${output}/test.pack"/>
   </target>
 
   <target name="testNestingOfPackTasks" depends="setUp">
-    <cmp:gzip destfile="${output}/asf-logo.gif.pack.gz">
+    <cmp:gzip destfile="${output}/test.pack.gz">
       <cmp:pack200 src="../resources/asf-logo.gif.zip"/>
     </cmp:gzip>
-    <au:assertLogContains text="Building: asf-logo.gif.pack.gz"/>
-    <au:assertFileExists file="${output}/asf-logo.gif.pack.gz"/>
+    <au:assertLogContains text="Building: test.pack.gz"/>
+    <au:assertFileExists file="${output}/test.pack.gz"/>
   </target>
 
 </project>

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/a0f2bae0/src/tests/antunit/pack200resource-test.xml
----------------------------------------------------------------------
diff --git a/src/tests/antunit/pack200resource-test.xml b/src/tests/antunit/pack200resource-test.xml
index 53c53fa..da9025d 100644
--- a/src/tests/antunit/pack200resource-test.xml
+++ b/src/tests/antunit/pack200resource-test.xml
@@ -21,22 +21,18 @@
          xmlns:cond="antlib:org.apache.tools.ant.types.conditions"
          xmlns:cmp="antlib:org.apache.ant.compress">
 
-  <import file="antunit-base.xml" />
-
-  <target name="setUp">
-    <mkdir dir="${output}"/>
-  </target>    
+  <import file="pack200-base.xml" />
 
   <target name="testNativePack200" depends="setUp">
     <copy todir="${output}">
       <cmp:zipfileset>
         <cmp:pack200resource>
-          <file file="../resources/asf-logo.gif.pack"/>
+          <file file="../resources/Foo.pack"/>
         </cmp:pack200resource>
       </cmp:zipfileset>
     </copy>
-    <au:assertFilesMatch expected="../resources/asf-logo.gif"
-                         actual="${output}/asf-logo.gif"/>
+    <au:assertFilesMatch expected="${java.dir}/Foo.java"
+                         actual="${output}/Foo.java"/>
   </target>
 
   <target name="testDoesntSupportConcatenatedStreams">
@@ -44,7 +40,7 @@
       <copy todir="${output}">
         <cmp:zipfileset>
           <cmp:pack200resource decompressconcatenated="true">
-            <file file="../resources/asf-logo.gif.pack"/>
+            <file file="${input}/test.pack"/>
           </cmp:pack200resource>
         </cmp:zipfileset>
       </copy>

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/a0f2bae0/src/tests/antunit/unpack200-test.xml
----------------------------------------------------------------------
diff --git a/src/tests/antunit/unpack200-test.xml b/src/tests/antunit/unpack200-test.xml
index 73a462a..7d8b434 100644
--- a/src/tests/antunit/unpack200-test.xml
+++ b/src/tests/antunit/unpack200-test.xml
@@ -19,67 +19,44 @@
          xmlns:au="antlib:org.apache.ant.antunit"
          xmlns:cmp="antlib:org.apache.ant.compress">
 
-  <import file="antunit-base.xml" />
-
-  <target name="setUp">
-    <mkdir dir="${output}"/>
-    <mkdir dir="${input}"/>
-  </target>
+  <import file="pack200-base.xml" />
 
   <target name="testAgainstPack200Task" depends="setUp">
-    <cmp:pack200 destfile="${input}/test.pack">
-      <cmp:zip>
-        <fileset dir="."/>
-      </cmp:zip>
-    </cmp:pack200>
     <cmp:unpack200 src="${input}/test.pack" dest="${input}/test.zip"/>
     <cmp:unzip src="${input}/test.zip" dest="${output}"/>
-    <au:assertFileExists file="${output}/untar-test.xml"/>
-    <au:assertFilesMatch
-       actual="${output}/untar-test.xml"
-       expected="untar-test.xml"
-       />
+    <assertFooMatches/>
   </target>
 
   <target name="testAgainstNativePack200" depends="setUp">
-    <cmp:unpack200 src="../resources/asf-logo.gif.pack"
+    <cmp:unpack200 src="../resources/Foo.pack"
                    dest="${input}/test.zip" />
     <cmp:unzip src="${input}/test.zip" dest="${output}" />
-    <au:assertFileExists file="${output}/asf-logo.gif"/>
+    <au:assertFileExists file="${output}/Foo.java"/>
     <au:assertFilesMatch
-       actual="${output}/asf-logo.gif"
-       expected="../resources/asf-logo.gif"
-       />
+        actual="${output}/Foo.java"
+        expected="${java.dir}/Foo.java"/>
   </target>
 
   <target name="testTempFileStrategy" depends="setUp">
-    <cmp:unpack200 src="../resources/asf-logo.gif.pack"
+    <cmp:unpack200 src="${input}/test.pack"
                    dest="${input}/test.zip"
                    pack200strategy="temp-file"/>
     <cmp:unzip src="${input}/test.zip" dest="${output}" />
-    <au:assertFileExists file="${output}/asf-logo.gif"/>
-    <au:assertFilesMatch
-       actual="${output}/asf-logo.gif"
-       expected="../resources/asf-logo.gif"
-       />
+    <assertFooMatches/>
   </target>
 
   <target name="testProperties" depends="setUp">
-    <cmp:unpack200 src="../resources/asf-logo.gif.pack"
+    <cmp:unpack200 src="${input}/test.pack"
                    dest="${input}/test.zip">
       <property key="unpack.deflate.hint" value="keep"/>
     </cmp:unpack200>
     <cmp:unzip src="${input}/test.zip" dest="${output}" />
-    <au:assertFileExists file="${output}/asf-logo.gif"/>
-    <au:assertFilesMatch
-       actual="${output}/asf-logo.gif"
-       expected="../resources/asf-logo.gif"
-       />
+    <assertFooMatches/>
   </target>
 
   <target name="testDoesntSupportConcatenatedStreams">
     <au:expectfailure>
-      <cmp:unpack200 src="../resources/asf-logo.gif.pack"
+      <cmp:unpack200 src="${input}/test.pack"
                      dest="${input}/test.zip"
                      decompressconcatenated="true"/>
     </au:expectfailure>

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/a0f2bae0/src/tests/resources/Foo.pack
----------------------------------------------------------------------
diff --git a/src/tests/resources/Foo.pack b/src/tests/resources/Foo.pack
new file mode 100644
index 0000000..c19fca9
Binary files /dev/null and b/src/tests/resources/Foo.pack differ

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/a0f2bae0/src/tests/resources/asf-logo.gif.pack
----------------------------------------------------------------------
diff --git a/src/tests/resources/asf-logo.gif.pack b/src/tests/resources/asf-logo.gif.pack
deleted file mode 100644
index c09dd31..0000000
Binary files a/src/tests/resources/asf-logo.gif.pack and /dev/null differ


[2/3] git commit: add test dependency on AntUnit

Posted by bo...@apache.org.
add test dependency on AntUnit


Project: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/commit/a562586d
Tree: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/tree/a562586d
Diff: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/diff/a562586d

Branch: refs/heads/master
Commit: a562586d86f81dc98b4b3cb5cd21bf39823641ea
Parents: fca03fb
Author: Stefan Bodewig <bo...@apache.org>
Authored: Sat Jul 19 14:42:10 2014 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Sat Jul 19 14:42:10 2014 +0200

----------------------------------------------------------------------
 ivy.xml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/a562586d/ivy.xml
----------------------------------------------------------------------
diff --git a/ivy.xml b/ivy.xml
index 4f5fec9..d9e5faf 100644
--- a/ivy.xml
+++ b/ivy.xml
@@ -33,8 +33,8 @@
     </description>
   </info>
   <configurations>
-		<conf name="default" description="full antlib with all dependencies"/>
-		<conf name="test" description="dependencies used for junit testing the antlib" visibility="private" />
+    <conf name="default" description="full antlib with all dependencies"/>
+    <conf name="test" description="dependencies used for junit testing the antlib" visibility="private" />
   </configurations>
   <publications xmlns:e="urn:ant.apache.org:ivy-extras">
     <artifact name="${artifact.name}" type="pom" ext="pom"/>
@@ -58,5 +58,6 @@
     <dependency org="org.apache.commons" name="commons-compress" rev="1.8" conf="default"/>
     <dependency org="org.tukaani" name="xz" rev="1.5" conf="default"/>
     <dependency org="junit" name="junit" rev="4.11" conf="test->default"/>
+    <dependency org="org.apache.ant" name="ant-antunit" rev="1.3" conf="test->default"/>
   </dependencies>
 </ivy-module>