ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r806411 - /ant/sandbox/antlibs/compress/trunk/src/tests/antunit/cpio.xml
Date Fri, 21 Aug 2009 03:40:39 GMT
Author: bodewig
Date: Fri Aug 21 03:40:38 2009
New Revision: 806411

URL: http://svn.apache.org/viewvc?rev=806411&view=rev
Log:
some cpio task tests

Added:
    ant/sandbox/antlibs/compress/trunk/src/tests/antunit/cpio.xml   (with props)

Added: ant/sandbox/antlibs/compress/trunk/src/tests/antunit/cpio.xml
URL: http://svn.apache.org/viewvc/ant/sandbox/antlibs/compress/trunk/src/tests/antunit/cpio.xml?rev=806411&view=auto
==============================================================================
--- ant/sandbox/antlibs/compress/trunk/src/tests/antunit/cpio.xml (added)
+++ ant/sandbox/antlibs/compress/trunk/src/tests/antunit/cpio.xml Fri Aug 21 03:40:38 2009
@@ -0,0 +1,130 @@
+<?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"
+         xmlns:au="antlib:org.apache.ant.antunit"
+         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}"/>
+    <property name="dest" location="${output}/test.cpio"/>
+    <macrodef name="checkProperties">
+      <attribute name="dateTime"/>
+      <attribute name="uid" default="0"/>
+      <attribute name="gid" default="0"/>
+      <attribute name="mode" default="32768"/>
+      <sequential>
+        <au:assertTrue>
+          <cond:islastmodified datetime="@{dateTime}"
+                               pattern="yyyy-MM-dd-HH:mm:ss Z">
+            <cmp:cpioentry name="asf-logo.gif">
+              <file file="${dest}"/>
+            </cmp:cpioentry>
+          </cond:islastmodified>
+        </au:assertTrue>
+        <au:assertTrue>
+          <cmp:hasuserid id="@{uid}">
+            <cmp:cpioentry name="asf-logo.gif">
+              <file file="${dest}"/>
+            </cmp:cpioentry>
+          </cmp:hasuserid>
+        </au:assertTrue>
+        <au:assertTrue>
+          <cmp:hasgroupid id="@{gid}">
+            <cmp:cpioentry name="asf-logo.gif">
+              <file file="${dest}"/>
+            </cmp:cpioentry>
+          </cmp:hasgroupid>
+        </au:assertTrue>
+        <au:assertTrue>
+          <cmp:hasmode mode="@{mode}">
+            <cmp:cpioentry name="asf-logo.gif">
+              <file file="${dest}"/>
+            </cmp:cpioentry>
+          </cmp:hasmode>
+        </au:assertTrue>
+      </sequential>
+    </macrodef>
+  </target>
+
+  <target name="testPlainFileSet" depends="setUp">
+    <mkdir dir="${input}"/>
+    <copy todir="${input}" file="../resources/asf-logo.gif"/>
+    <touch datetime="2009-08-19-05:49:21 +0200"
+           pattern="yyyy-MM-dd-HH:mm:ss Z"
+           file="${input}/asf-logo.gif"/>
+    <cmp:cpio destfile="${dest}">
+      <fileset dir="${input}" includes="asf-logo.gif"/>
+    </cmp:cpio>
+    <checkProperties dateTime="2009-08-19-05:49:21 +0200"/>
+  </target>
+
+  <target name="testCoreZipFileSet" depends="setUp">
+    <cmp:cpio destfile="${dest}">
+      <zipfileset src="../resources/asf-logo.gif.zip"
+                  includes="asf-logo.gif"/>
+    </cmp:cpio>
+    <checkProperties dateTime="2001-11-19-15:34:20 +0100" mode="33188"/>
+  </target>
+
+  <target name="testAntlibZipFileSet" depends="setUp">
+    <cmp:cpio destfile="${dest}">
+      <cmp:zipfileset src="../resources/asf-logo.gif.zip"
+                      includes="asf-logo.gif"/>
+    </cmp:cpio>
+    <checkProperties dateTime="2001-11-19-15:34:20 +0100" mode="33188"/>
+  </target>
+
+  <target name="testCoreTarFileSet" depends="setUp">
+    <cmp:cpio destfile="${dest}">
+      <tarfileset src="../resources/asf-logo.gif.tar"
+                  includes="asf-logo.gif"/>
+    </cmp:cpio>
+    <checkProperties dateTime="2001-11-19-15:34:20 +0100" mode="33188"
+                     uid="500" gid="500"/>
+  </target>
+
+  <target name="testAntlibTarFileSet" depends="setUp">
+    <cmp:cpio destfile="${dest}">
+      <cmp:tarfileset src="../resources/asf-logo.gif.tar"
+                      includes="asf-logo.gif"/>
+    </cmp:cpio>
+    <checkProperties dateTime="2001-11-19-15:34:20 +0100" mode="33188"
+                     uid="500" gid="500"/>
+  </target>
+
+  <target name="testArFileSet" depends="setUp">
+    <cmp:cpio destfile="${dest}">
+      <cmp:arfileset src="../resources/asf-logo.gif.ar"
+                     includes="asf-logo.gif"/>
+    </cmp:cpio>
+    <checkProperties dateTime="2009-07-31-20:11:13 +0200" mode="100644"
+                     uid="1000" gid="1000"/>
+  </target>
+
+  <target name="testCpioFileSet" depends="setUp">
+    <cmp:cpio destfile="${dest}">
+      <cmp:cpiofileset src="../resources/asf-logo.gif.cpio"
+                       includes="asf-logo.gif"/>
+    </cmp:cpio>
+    <checkProperties dateTime="2009-07-31-20:11:13 +0200" mode="33188"
+                     uid="1000" gid="1000"/>
+  </target>
+</project>

Propchange: ant/sandbox/antlibs/compress/trunk/src/tests/antunit/cpio.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message