Commit a43e2478 authored by Jeff Burke's avatar Jeff Burke
Browse files

s1840: updated int-tests

parent 7096ec20
Loading
Loading
Loading
Loading
+58 −13
Original line number Diff line number Diff line
@@ -84,24 +84,69 @@
    <property name="project" value="userAdmin" />

    <!-- JAR files to be included in classpath and war file -->
    <property name="cadcAccessControl"		value="${lib}/cadcAccessControl.jar" />
    <property name="cadcAccessControl-Server"	value="${lib}/cadcAccessControl-Server.jar" />
    <property name="cadcAC"		        value="${lib}/cadcAccessControl.jar" />
    <property name="cadcAC-Server"      value="${lib}/cadcAccessControl-Server.jar" />
    <property name="cadcLog"		    value="${lib}/cadcLog.jar" />
    <property name="cadcUtil"		    value="${lib}/cadcUtil.jar" />
    <property name="log4j"			    value="${ext.lib}/log4j.jar" />
    <property name="commons-logging"    value="${ext.lib}/commons-logging.jar" />
    <property name="unboundid"          value="${ext.lib}/unboundid-ldapsdk-se.jar" />

    <property name="cadc"       value="${cadcAccessControl}:${cadcAccessControl-Server}:${cadcUtil}" />
    <property name="external"   value="${unboundid}:${log4j}" />
    <property name="jars" value="${cadcAC}:${cadcAC-Server}:${cadcUtil}:${log4j}" />

    <property name="client.cadc.jars"       value="${cadcAC}:${cadcAC-Server}:${cadcLog}:${cadcUtil}" />
    <property name="client.external.jars"   value="${unboundid}:${log4j}" />

    <property name="jars"       value="${cadc}:${external}" />

    <target name="build" depends="simpleJar" />
    <target name="build" depends="compile,manifest">
        <jar jarfile="${build}/lib/${project}.jar"
             basedir="${build}/class" update="no"
             manifest="${build}/tmp/${project}.mf">
            <include name="ca/nrc/cadc/**" />
        </jar>
    </target>

    <target name="setup-test" depends="init">
        <copy overwrite="true"
              file="${env.A}/test-certificates/x509_CADCAuthtest1.pem"
              tofile="build/test/class/cadcauthtest1.pem"/>
    </target>

    <target name="manifest">
        <pathconvert property="client.flat.manifest" pathsep=" ">
            <mapper type="flatten"/>
            <path> <pathelement path="${client.cadc.jars}"/> </path>
            <path> <pathelement path="${client.external.jars}"/> </path>
        </pathconvert>
        <pathconvert property="client.non-flat.manifest" pathsep=" ">
            <path> <pathelement path="${client.cadc.jars}"/> </path>
            <path> <pathelement path="${client.external.jars}"/> </path>
        </pathconvert>

        <manifest file="${build}/tmp/${project}.mf" mode="replace">
            <attribute name="Main-Class" value="ca.nrc.cadc.ac.admin.Main"/>
            <attribute name="Class-Path" value="${client.flat.manifest} ${client.non-flat.manifest}"/>
        </manifest>
    </target>

    <!-- JAR files needed to run the test suite -->
    <property name="cadcLog"          value="${lib}/cadcLog.jar" />
    <property name="junit"          value="${ext.dev}/junit.jar" />

    <property name="testingJars" value="${junit}" />
    
    <property name="testingJars" value="${cadcLog}:${junit}:${unboundid}" />

    <target name="single-test" depends="compile,compile-test,setup-test">
        <echo message="Running test suite..." />
        <junit printsummary="yes" haltonfailure="yes" fork="yes">
            <classpath>
                <pathelement path="${build}/class"/>
                <pathelement path="${build}/test/class"/>
                <pathelement path="${jars}:${testingJars}"/>
            </classpath>
            <sysproperty key="ca.nrc.cadc.util.PropertiesReader.dir" value="test"/>
            <test name="ca.nrc.cadc.ac.admin.integration.AdminIntTest" />
            <formatter type="plain" usefile="false" />
        </junit>
    </target>
</project>
+2 −4
Original line number Diff line number Diff line
#!/bin/tcsh -f
#!/bin/bash

source ${DEFAULT_CONFIG_DIR}/JavaSystemProps.csh || exit $status

java -Xmx128m ${JAVA_SYSTEM_PROPS} -jar ${CADC_ROOT}/lib/userAdmin.jar $*:q
java -Xmx128m -jar ${CADC_ROOT}/lib/userAdmin.jar $*
+4 −3
Original line number Diff line number Diff line
@@ -207,6 +207,7 @@ public class CmdLineParser
        // only one command is allowed per command line
    	if (am.isSet("list"))
    	{
            System.out.println("--list");
            this.command = new ListActiveUsers();
            count++;
    	}
@@ -260,7 +261,7 @@ public class CmdLineParser
    		
            if (count == 0)
            {
                msg = "Missing command or ommand is not supported.";
                msg = "Missing command or command is not supported.";
            }
            else
            {
@@ -289,6 +290,7 @@ public class CmdLineParser
            try 
            {
                SSLUtil.validateSubject(subject, null);
                log.debug("subject: " + subject);
                this.subject = subject;
                this.proceed = true;
            } 
@@ -323,11 +325,10 @@ public class CmdLineParser
    	sb.append("--list               :list users in the Users tree\n");
    	sb.append("                     :can be executed as an anonymous user\n");
    	sb.append("--list-pending       :list users in the UserRequests tree\n");
    	sb.append("                     :except those with nsaccountlock=true\n");
    	sb.append("                     :can be executed as an anonymous user\n");
    	sb.append("--view=<userid>      :print the entire details of the user\n");
    	sb.append("--approve=<userid>   :delete the user from the UserRequests tree\n");
    	sb.append("                     :by setting nsaccount=true, and insert it to the Users tree\n");
    	sb.append("                     :and insert it into the Users tree\n");
    	sb.append("--reject=<userid>    :delete the user from the UserRequests tree\n");
    	sb.append("\n");
    	sb.append("-v|--verbose         : Verbose mode print progress and error messages\n");
+8 −0
Original line number Diff line number Diff line
# This are the configuration fields required by the unit tests
server = proc5-03.cadc.dao.nrc.ca
port = 389
proxyUser = testproxy
usersDn = ou=Users,ou=ds,dc=testcanfar
userRequestsDN = ou=UserRequests,ou=ds,dc=testcanfar
groupsDn = ou=Groups,ou=ds,dc=testcanfar
adminGroupsDn = ou=adminGroups,ou=ds,dc=testcanfar
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
#!/bin/bash

java -Xmx128m -jar ${CADC_ROOT}/lib/userAdmin.jar $*
Loading