You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by je...@apache.org on 2006/04/01 18:51:55 UTC

svn commit: r390694 - in /xmlgraphics/commons/trunk: build.xml test/java/org/apache/xmlgraphics/StandardTestSuite.java

Author: jeremias
Date: Sat Apr  1 08:51:53 2006
New Revision: 390694

URL: http://svn.apache.org/viewcvs?rev=390694&view=rev
Log:
Enabled JUnit tests from the Ant build.

Added:
    xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/StandardTestSuite.java   (with props)
Modified:
    xmlgraphics/commons/trunk/build.xml

Modified: xmlgraphics/commons/trunk/build.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/commons/trunk/build.xml?rev=390694&r1=390693&r2=390694&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/build.xml (original)
+++ xmlgraphics/commons/trunk/build.xml Sat Apr  1 08:51:53 2006
@@ -22,21 +22,6 @@
   <property file="${basedir}/build.properties"/>
   <property environment="env"/>
 
-  <path id="libs-build-classpath">
-    <fileset dir="${basedir}/lib">
-      <include name="*.jar"/>
-    </fileset>
-  </path>
-
-  <path id="libs-run-classpath">
-    <fileset dir="${basedir}/lib">
-      <include name="*.jar"/>
-    </fileset>
-    <fileset dir="${basedir}/build">
-      <include name="xmlgraphics-commons.jar"/>
-    </fileset>
-  </path>
-
   <property name="Name" value="Apache XML Graphics Commons"/>
   <property name="name" value="xmlgraphics-commons"/>
   <property name="version" value="0.1svn"/>
@@ -62,6 +47,21 @@
   <property name="build.classes.dir" value="${build.dir}/classes"/>
   <property name="build.javadocs.dir" value="${build.dir}/javadocs"/>
 
+  <path id="libs-build-classpath">
+    <fileset dir="${lib.dir}">
+      <include name="*.jar"/>
+    </fileset>
+  </path>
+
+  <path id="libs-run-classpath">
+    <fileset dir="${lib.dir}">
+      <include name="*.jar"/>
+    </fileset>
+    <fileset dir="${build.dir}">
+      <include name="${name}.jar"/>
+    </fileset>
+  </path>
+
   <!-- =================================================================== -->
   <!-- Initialization target                                               -->
   <!-- =================================================================== -->
@@ -158,36 +158,17 @@
   <target name="package" depends="jar-main" description="Generates the jar files"/>
 
   <!-- =================================================================== -->
-  <!-- Default Target                                                      -->
-  <!-- =================================================================== -->
-
-  <target name="all" depends="package"/> <!-- "all" target for us Makefile converts ;-) -->
-
-  <!-- =================================================================== -->
-  <!-- Special target for Gump                                             -->
-  <!-- =================================================================== -->
-
-  <target name="gump" depends="all, javadocs"/>
-
-  <!-- =================================================================== -->
   <!-- Testing                                                             -->
   <!-- =================================================================== -->
-  <!--target name="junit-with-xmlunit" depends="init-avail" if="xmlunit.present">
-    <patternset id="test-sources"/>
-  </target>
-  <target name="junit-without-xmlunit" depends="init-avail" unless="xmlunit.present">
-    <patternset id="test-sources">
-      <exclude name="**/intermediate/*"/>
-    </patternset>
-  </target>
-  <target name="junit-compile" depends="package, transcoder-pkg, junit-with-xmlunit, junit-without-xmlunit" description="Runs FOP's JUnit tests" if="junit.present">
+  <target name="junit-compile" depends="package" if="junit.present">
     <mkdir dir="${build.dir}/test-classes"/>
+    <mkdir dir="${build.dir}/test-reports"/>
     <javac destdir="${build.dir}/test-classes" fork="${javac.fork}"
            debug="${javac.debug}" deprecation="${javac.deprecation}"
            optimize="${javac.optimize}" source="${javac.source}"
            target="${javac.target}">
       <src path="${basedir}/test/java"/>
-      <patternset refid="test-sources"/>
+      <!--patternset refid="test-sources"/-->
       <classpath>
         <path refid="libs-build-classpath"/>
         <fileset dir="${build.dir}">
@@ -197,15 +178,30 @@
     </javac>
   </target>
 
-  <target name="junit" depends="junit-basic, junit-transcoder, junit-layout, junit-fotree, junit-intermediate-format" description="Runs all of FOP's JUnit tests" if="junit.present">
+  <target name="junit-basic" depends="junit-compile" description="Runs the standard JUnit test suite" if="junit.present">
+    <echo message="Running basic functionality tests"/>
+    <junit haltonerror="no" fork="${junit.fork}" errorproperty="test.junit.error" failureproperty="test.junit.failure">
+      <sysproperty key="basedir" value="${basedir}"/>
+      <sysproperty key="jawa.awt.headless" value="true"/>
+      <formatter type="brief" usefile="false"/>
+      <formatter type="plain" usefile="true"/>
+      <classpath>
+        <pathelement location="${build.dir}/test-classes"/>
+        <path refid="libs-build-classpath"/>
+        <fileset dir="build">
+          <include name="${name}.jar"/>
+        </fileset>
+      </classpath>
+      <test name="org.apache.xmlgraphics.StandardTestSuite" todir="${build.dir}/test-reports"/>
+    </junit>
+  </target>
+
+  <target name="junit" depends="junit-basic" description="Runs all JUnit tests" if="junit.present">
     <fail>
       <condition>
         <or>
-          <isset property="fop.junit.error"/>
-          <isset property="fop.junit.failure"/>
-          <not>
-            <isset property="hyphenation.present"/>
-          </not>
+          <isset property="test.junit.error"/>
+          <isset property="test.junit.failure"/>
         </or>
       </condition>
 NOTE:
@@ -215,7 +211,7 @@
 **************************************************************************
     </fail>
     <echo>All Junit tests passed!</echo>
-  </target-->
+  </target>
 
   <!-- =================================================================== -->
   <!-- Creates the API documentation                                       -->
@@ -255,7 +251,7 @@
       <footer><![CDATA[${name} ${version}]]></footer>
       <classpath>
         <path refid="libs-build-classpath"/>
-        <pathelement path="${java.class.path}"/>
+        <!--pathelement path="${java.class.path}"/-->
       </classpath>
       <sourcepath>
         <pathelement path="${src.java.dir}"/>
@@ -266,6 +262,10 @@
         <package name="org.apache.xmlgraphics.image"/>
         <package name="org.apache.xmlgraphics.image.*"/>
       </group>
+      <group title="Java2D">
+        <package name="org.apache.xmlgraphics.java2d"/>
+        <package name="org.apache.xmlgraphics.java2d.*"/>
+      </group>
       <group title="Utility">
         <package name="org.apache.xmlgraphics.util"/>
         <package name="org.apache.xmlgraphics.util.*"/>
@@ -366,4 +366,16 @@
     </delete>
   </target>
   
+  <!-- =================================================================== -->
+  <!-- Default Target                                                      -->
+  <!-- =================================================================== -->
+
+  <target name="all" depends="package, junit"/> <!-- "all" target for us Makefile converts ;-) -->
+
+  <!-- =================================================================== -->
+  <!-- Special target for Gump                                             -->
+  <!-- =================================================================== -->
+
+  <target name="gump" depends="all, javadocs"/>
+
 </project>

Added: xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/StandardTestSuite.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/StandardTestSuite.java?rev=390694&view=auto
==============================================================================
--- xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/StandardTestSuite.java (added)
+++ xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/StandardTestSuite.java Sat Apr  1 08:51:53 2006
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * Licensed 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.
+ */
+
+/* $Id$ */
+ 
+package org.apache.xmlgraphics;
+
+import org.apache.xmlgraphics.image.codec.png.PNGEncoderTest;
+import org.apache.xmlgraphics.util.io.Base64Test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Test suite for basic functionality of XML Graphics Commons.
+ */
+public class StandardTestSuite {
+
+    /**
+     * Builds the test suite
+     * @return the test suite
+     */
+    public static Test suite() {
+        TestSuite suite = new TestSuite(
+            "Basic functionality test suite for XML Graphics Commons");
+        //$JUnit-BEGIN$
+        suite.addTest(new TestSuite(Base64Test.class));
+        suite.addTest(new TestSuite(PNGEncoderTest.class));
+        //$JUnit-END$
+        return suite;
+    }
+}

Propchange: xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/StandardTestSuite.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
Apache XML Graphics Project URL: http://xmlgraphics.apache.org/
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org