Included black-box IdP tests in standared test suite.
[java-idp.git] / build.xml
index 85d68f4..8c5e1f9 100755 (executable)
--- a/build.xml
+++ b/build.xml
 
        <!-- Construct the CLASSPATH -->
        <path id="build.path">
-               <pathelement path="${classpath}" />
                <pathelement location="${build}" />
-               <fileset dir="${custom}">
-                       <include name="**/*.jar" />
-               </fileset>
                <fileset dir="${endorsed}">
                        <include name="**/*.jar" />
                </fileset>
                            <fileset dir="${custom.libs}">
                                <include name="*.jar"/>
                            </fileset>
-                           <filelist refid="test.path"/>
+                           <path refid="test.path"/>
                        </classpath>
                        <formatter type="plain" />
                        <test name="edu.internet2.middleware.shibboleth.aa.arp.ArpTests" />
                        <test name="edu.internet2.middleware.shibboleth.common.TrustTests" />
                        <test name="edu.internet2.middleware.shibboleth.idp.provider.DNHostNameExtractionTests" />
                        <test name="edu.internet2.middleware.shibboleth.metadata.MetadataTests" />
+                       <test name="edu.internet2.middleware.shibboleth.idp.SSOTest" />      
+                       <test name="edu.internet2.middleware.shibboleth.idp.AATest" />    
                </junit>
        </target>
 
                                <fileset dir="${custom.libs}">
                                        <include name="*.jar"/>
                                </fileset>
-                               <filelist refid="test.path"/>
+                       <path refid="test.path"/>
                        </classpath>
                        <formatter type="plain" />
                        <test name="edu.internet2.middleware.shibboleth.aap.AAPTests" />
 
 
        <!-- Tomcat Management -->
-       <target name="setupTomcatTasks">
+       <target name="setupTomcatTasks" depends="init">
                <path id="tomcat.classpath">
                        <fileset dir="${tomcat.home}/server/lib" includes="catalina-ant.jar"/>
                </path>
        </target>
 
        <target name="package-wayf" depends="compile" description="Creates the WAYF war and moves it to ${dist}">
-               <war warfile="${dist}/${distnameWayf}.war" webxml="${configroot}/wayf.xml" basedir="${approot}" update="no" />
+        <copy file="${appconfig}/schemas.properties" todir="${approot}/WEB-INF/classes/conf"/>
+        <copy file="${appconfig}/wayfconfig.xml" todir="${approot}/WEB-INF/classes/conf"/>
+            
+               <war warfile="${dist}/${distnameWayf}.war" webxml="${configroot}/wayf.xml" basedir="${approot}" update="no"/>
        </target>
 
        <target name="package-sp" depends="compile, install.url" description="Creates the Java SP war and moves it to ${dist}">
                        </then>
                </if>
        </target>
+       
+       <target name="installx" depends="init, install.init" description="Interactive SP Install">
+               <if>
+                       <xinput type="confirm" defaultvalue="y">Do you want to install the Shibboleth Service Provider?</xinput>
+                       <then>
+                               <input message="What name do you want to use for the Service Provider web application? [default: ${sp.webapp.name}]" 
+                                       addproperty="sp.webapp.name.input" defaultValue="${sp.webapp.name}" />
+                               <var name="sp.webapp.name" value="${sp.webapp.name.input}" />
+
+                               <antcall target="install.sp" />
+                       </then>
+               </if>
+       </target>
 
        <target name="install.idp" depends="init, install.init">
                <xinput message="Deploying the java web application.  Do you want to install it directly onto the filesystem or use the tomcat manager application?" 
 
                <antcall target="install.idp.${idp.install-type}" />
        </target>
+       
+       <target name="install.sp" depends="init, install.init">
+               <xinput message="Deploying the java web application.  Do you want to install it directly onto the filesystem or use the tomcat manager application?" 
+                       addproperty="sp.install-type.input" type="menu" casesensitive="no" defaultValue="${sp.install-type}">
+                       <xoption value="filesystem.prompt">filesystem</xoption>
+                       <xoption>manager</xoption>
+               </xinput>
+               <var name="sp.install-type" value="${sp.install-type.input}" />
+
+               <antcall target="install.sp.${sp.install-type}" />
+       </target>
 
        <!-- Prompt user for filesystem installation options and save them to build.properties -->
        <target name="install.idp.filesystem.prompt" depends="init, install.init">
                <antcall target="install.idp.filesystem" />
                <antcall target="savePropertyFile" />
        </target>
+       
+       <!-- Prompt user for filesystem installation options and save them to build.properties -->
+       <target name="install.sp.filesystem.prompt" depends="init, install.init">
+               <input message="Select a home directory for the Shibboleth Service Provider [default: ${sp.home}]"
+                       addproperty="sp.home.input" defaultvalue="${sp.home}" />
+               <var name="sp.home" value="${sp.home.input}" />
+               <input message="Enter tomcat home directory [default: ${tomcat.home}]"
+                       addproperty="tomcat.home.input" defaultvalue="${tomcat.home}" />
+               <var name="tomcat.home" value="${tomcat.home.input}" />
+
+               <if>
+                       <available file="${sp.home}/etc" />
+                       <then>
+                               <echo>--------------------------------------------------------------------------------------</echo>
+                               <echo>---</echo>
+                               <echo>---   NOTE:  Existing Service Provider configuration at ${sp.home}/etc ${line.separator}---   will not be overwritten.</echo>
+                               <echo>---</echo>
+                               <echo>--------------------------------------------------------------------------------------</echo>
+                               <property name="copy-sp-conf" value="n" />
+                       </then>
+                       <else>
+                               <property name="copy-sp-conf" value="y" />
+                       </else>
+               </if>
+
+               <antcall target="install.sp.filesystem" />
+               <antcall target="savePropertyFile" />
+       </target>
 
        <!-- Install Shibboleth IdP to filesystem using the properties in build.properties -->
        <target name="install.idp.filesystem" depends="init, install.init, build-util, install.url, package-idp" 
                        <fileset dir="lib" includesfile="conf/idp-lib.include" />
                </copy>
 
+               <copy todir="${idp.home}/endorsed">
+                       <fileset dir="endorsed" />
+               </copy>
+
                <copy todir="${idp.home}/bin">
                        <fileset dir="bin"/>
                </copy>
 
                <!-- Move SP war to Tomcat deployment directory -->
                <copy file="${dist}/${sp.webapp.name}.war" tofile="${tomcat.home}/webapps/${sp.webapp.name}.war" />
+               
+               <!-- Move Shib Filter jar to Tomcat shared directory -->
+               <copy file="${distlibs}/shib-filter.jar" tofile="${tomcat.home}/shared/lib/shib-filter.jar" />
+               
+               <!-- Copy test secure application to Tomcat -->
+               <copy file="${root}/data/secure.war" tofile="${tomcat.home}/webapps/secure.war" />
 
                <!-- copy sp jars and utilities -->
                <copy todir="${sp.home}/lib">
 
         <antcall target="ext-invoke">
             <param name="exts.dir" value="${custom}"/>
-            <param name="ext.build.function" value="${ext-install-filesystem}"/>
+            <param name="ext.build.function" value="ext-install-filesystem"/>
             <param name="ext.filesystem.home" value="${sp.home}"/>
             <param name="ext.home.token" value="$SP_HOME$"/>
         </antcall>      
                <copy todir="${sp.home}/etc" overwrite="true">
                        <fileset dir="${src}/conf" includesfile="conf/sp-conf.include"/>
                </copy>
-               <move file="${sp.home}/etc/dist.sp.xml" tofile="${sp.home}/etc/sp.xml" overwrite="true" />
+               <move file="${sp.home}/etc/dist.sp-iqidp.xml" tofile="${sp.home}/etc/sp.xml" overwrite="true" />
                <replace file="${sp.home}/etc/sp.xml" token="$SP_HOME$" value="${sp.home.url}" />
        </target>
 
                <input message="Enter tomcat password [default: ${tomcat.password}]" addproperty="tomcat.password.input" defaultValue="${tomcat.password}" />
                <var name="tomcat.password" value="${tomcat.password.input}" />
 
+        <antcall target="package-idp" />
                <antcall target="tomcat.deploy" />
                <antcall target="savePropertyFile" />
        </target>
                        <entry key="tomcat.password" value="${tomcat.password}" />
                </propertyfile>
        </target>
+       <!-- For IDE development, run this target first to delete all
+       directories generated by the install process before
+       recreating and reinstalling everything. -->
+       <target name="clean-install" depends="init" 
+               description="Delete old configuration and Tomcat webapp directories.">
+               <delete dir="${idp.home}" />
+               <delete dir="${sp.home}" />
+               <delete dir="${tomcat.home}/webapps/${idp.webapp.name}" />
+               <delete dir="${tomcat.home}/webapps/${sp.webapp.name}" />
+       </target>
 </project>