Converted test structure to be the same as OpenSAML. This avoids placing tests in...
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 26 Feb 2003 07:33:54 +0000 (07:33 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 26 Feb 2003 07:33:54 +0000 (07:33 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@513 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

.classpath
build.xml
data/arp1.xml [moved from test/arp1.xml with 100% similarity]
data/arp2.xml [moved from test/arp2.xml with 100% similarity]
data/arp6.xml [moved from test/arp6.xml with 100% similarity]
data/arp7.xml [moved from test/arp7.xml with 100% similarity]
tests/edu/internet2/middleware/shibboleth/aa/arp/ArpTests.java [moved from src/edu/internet2/middleware/shibboleth/aa/arp/ArpTests.java with 98% similarity]

index 8b316dd..cd05744 100644 (file)
@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
     <classpathentry kind="src" path="src"/>
-    <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
+    <classpathentry kind="src" path="tests"/>
+    <classpathentry kind="var" path="JRE_LIB" sourcepath="JRE_SRC"/>
     <classpathentry kind="lib" path="webApplication/WEB-INF/lib/commons-beanutils.jar"/>
     <classpathentry kind="lib" path="webApplication/WEB-INF/lib/commons-collections.jar"/>
     <classpathentry kind="lib"
@@ -23,5 +24,5 @@
     <classpathentry kind="lib" path="lib/xercesImpl-2.2.1.jar" sourcepath="/Shibboleth/lib/xercesImpl-2.2.1-src.jar"/>
     <classpathentry kind="lib" path="lib/ant-1.5.1.jar"/>
     <classpathentry kind="lib" path="lib/ant-optional-1.5.1.jar"/>
-    <classpathentry kind="output" path="webApplication\WEB-INF\classes"/>
+    <classpathentry kind="output" path="webApplication/WEB-INF/classes"/>
 </classpath>
index 8aaa2a4..6b69b50 100755 (executable)
--- a/build.xml
+++ b/build.xml
@@ -6,6 +6,7 @@
     <property name="distname" value="shibboleth" />
     <property name="root" value="." />
     <property name="src" value="${root}/src/" />
+    <property name="tests" value="${root}/tests/" />
     <property name="approot" value="${root}/webApplication/" />
     <property name="appconfig" value="${src}/conf/" />
     <property name="configroot" value="${root}/webAppConfig/" />
 
 
     <!-- This target should be run before checking code into the repository -->
-    <target name="pre-checkin" depends="compile-all, test-all, clean-all" />
+    <target name="pre-checkin" depends="compile, test-all, clean-all" />
 
 
     <!-- Compile classes and move them to ${build} -->
-    <target name="compile-all" depends="init">
+    <target name="compile" depends="init">
         <javac srcdir="${src}" destdir="${build}" includes="**/*.java" debug="on">
             <classpath refid="build.path" />
         </javac>
             <fileset dir="${src}/conf"/>
         </copy>
     </target>
+    
+        <target name="compile-tests" depends="compile">
+        <javac srcdir="${tests}" destdir="${build}" includes="**/*.java" debug="on">
+            <classpath refid="build.path" />
+        </javac>
+    </target>
 
 
        <!-- Generate API docs -->
 
     <!-- Create various product distributions and move them to ${dist} -->
     <target name="dist" depends="dist-all" />
-    <target name="dist-all" depends="compile-all, test-all, package-all, clean-build" />
+    <target name="dist-all" depends="compile, test-all, package-all, clean-build" />
     <target name="package-all">
         <war warfile="${dist}/${distname}.war" webxml="${configroot}/all.xml" basedir="${approot}" update="no" />
     </target>
 
-    <target name="dist-origin" depends="compile-all, test-origin, package-origin, clean-build" />
+    <target name="dist-origin" depends="compile, test-origin, package-origin, clean-build" />
     <target name="package-origin">
         <war warfile="${dist}/${distname}.war" webxml="${configroot}/origin.xml" basedir="${approot}" update="no" />
     </target>
 
     <!-- Build utilities -->
-    <target name="build-util" depends="compile-all">
+    <target name="build-util" depends="compile">
         <jar jarfile="${distlibs}/shib-util.jar" basedir="${build}" />
     </target>
 
-    <target name="dist-wayf" depends="compile-all, test-wayf, package-wayf, clean-build" />
+    <target name="dist-wayf" depends="compile, test-wayf, package-wayf, clean-build" />
     <target name="package-wayf">
         <war warfile="${dist}/${distname}-wayf.war" webxml="${configroot}/wayf.xml" basedir="${approot}" update="no" />
     </target>
         </junit>
     </target>
     <target name="test-wayf" depends="test-common" />
-    <target name="test-common" depends="compile-all"/>
+    <target name="test-common" depends="compile-tests"/>
     
-       <target name="genSecret" depends="compile-all">
+       <target name="genSecret" depends="compile">
        <taskdef name="genSecret" classname="edu.internet2.middleware.shibboleth.utils.HandleRepositorySecretGenerator" classpathref="build.path"/>
                <genSecret keyStorePath="${appconfig}/handle.jks" keyStorePassword="shibhs" keyStoreKeyAlias="handleKey" keyStoreKeyPassword="shibhs" />
        </target>
similarity index 100%
rename from test/arp1.xml
rename to data/arp1.xml
similarity index 100%
rename from test/arp2.xml
rename to data/arp2.xml
similarity index 100%
rename from test/arp6.xml
rename to data/arp6.xml
similarity index 100%
rename from test/arp7.xml
rename to data/arp7.xml
@@ -76,6 +76,14 @@ import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 
+import edu.internet2.middleware.shibboleth.aa.arp.Arp;
+import edu.internet2.middleware.shibboleth.aa.arp.ArpAttribute;
+import edu.internet2.middleware.shibboleth.aa.arp.ArpEngine;
+import edu.internet2.middleware.shibboleth.aa.arp.ArpException;
+import edu.internet2.middleware.shibboleth.aa.arp.ArpRepository;
+import edu.internet2.middleware.shibboleth.aa.arp.ArpRepositoryException;
+import edu.internet2.middleware.shibboleth.aa.arp.ArpRepositoryFactory;
+import edu.internet2.middleware.shibboleth.aa.arp.MatchFunction;
 import edu.internet2.middleware.shibboleth.common.*;
 
 /**
@@ -162,7 +170,7 @@ public class ArpTests extends TestCase {
 
                //Test ARP description
                try {
-                       InputStream inStream = new FileInputStream("test/arp1.xml");
+                       InputStream inStream = new FileInputStream("data/arp1.xml");
                        parser.parse(new InputSource(inStream));
                        Arp arp1 = new Arp();
                        arp1.marshall(parser.getDocument().getDocumentElement());
@@ -182,7 +190,7 @@ public class ArpTests extends TestCase {
 
                //Test case where ARP description does not exist
                try {
-                       InputStream inStream = new FileInputStream("test/arp2.xml");
+                       InputStream inStream = new FileInputStream("data/arp2.xml");
                        parser.parse(new InputSource(inStream));
                        Arp arp2 = new Arp();
                        arp2.marshall(parser.getDocument().getDocumentElement());
@@ -549,7 +557,7 @@ public class ArpTests extends TestCase {
                        URI[] list3 = new URI[0];
 
                        //Test with just a site ARP
-                       InputStream inStream = new FileInputStream("test/arp1.xml");
+                       InputStream inStream = new FileInputStream("data/arp1.xml");
                        parser.parse(new InputSource(inStream));
                        Arp arp1 = new Arp();
                        arp1.marshall(parser.getDocument().getDocumentElement());
@@ -563,7 +571,7 @@ public class ArpTests extends TestCase {
                                new HashSet(Arrays.asList(list1)));
 
                        //Test with site and user ARPs
-                       inStream = new FileInputStream("test/arp7.xml");
+                       inStream = new FileInputStream("data/arp7.xml");
                        parser.parse(new InputSource(inStream));
                        Arp arp7 = new Arp();
                        arp7.setPrincipal(principal1);
@@ -577,7 +585,7 @@ public class ArpTests extends TestCase {
                                new HashSet(Arrays.asList(list2)));
 
                        //Ensure that explicit denies on any value are not in the release set
-                       inStream = new FileInputStream("test/arp6.xml");
+                       inStream = new FileInputStream("data/arp6.xml");
                        parser.parse(new InputSource(inStream));
                        Arp arp6 = new Arp();
                        arp6.setPrincipal(principal1);