blob: 97f0604e3b8f7e0b1212330d75c93c6c9c19fd4a [file] [log] [blame]
<?xml version="1.0" ?>
<!--
Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<!-- ======================================================================= -->
<!-- AdminGUI Test build file -->
<!-- ======================================================================= -->
<!DOCTYPE project [
<!ENTITY commonSetup SYSTEM "file:./../../config/properties.xml">
<!ENTITY commonBuild SYSTEM "file:./../../config/common.xml">
]>
<project name="AdminGUITest" default="all" basedir=".">
&commonSetup;
&commonBuild;
<property name="src.dir" value="src" />
<property environment="env" />
<!-- Comment this line i.e. only config.properties if you want to run standalone -->
<property file="./../../config.properties" />
<property name="jars.dir" value="../../lib" />
<property name="classes.dir" value="classes" />
<property name="test.class" value="AdminGUITest" />
<!-- uncomment this, when you want to run standalone
<property file="./build.properties" />
-->
<property name="classpath" value="" />
<!-- =================================================================== -->
<!-- Defines the classpath used for compilation and test. -->
<!-- =================================================================== -->
<path id="base.classpath">
<fileset dir="${jars.dir}">
<include name="*.jar"/>
<!--<include name="${env.S1AS_HOME}/lib/j2ee.jar"/>-->
<!--<include name="${env.S1AS_HOME}/lib/xercesImpl.jar"/>-->
</fileset>
<fileset dir="${env.S1AS_HOME}/lib/">
<include name="appserv-admin.jar"/>
<include name="appserv-rt.jar"/>
</fileset>
<pathelement location="${classpath}" />
</path>
<!-- =================================================================== -->
<!-- Compiles the source code -->
<!-- =================================================================== -->
<target name="compile" depends="init-common">
<mkdir dir="${build.classes.dir}" />
<javac srcdir="${src.dir}" destdir="${build.classes.dir}"
debug="on" deprecation="off" optimize="off">
<classpath>
<path refid="base.classpath" />
</classpath>
</javac>
</target>
<target name="setup">
</target>
<target name="deploy">
</target>
<target name="undeploy">
</target>
<target name="unsetup">
</target>
<!-- =================================================================== -->
<!-- Runs the test code -->
<!-- =================================================================== -->
<target name="all" depends="run-test"/>
<target name="run-test" depends="compile, get-version-common, init-common">
<!-- Not needed anymore, JSSE.java is doing this
<antcall target="get-certdb-to-jks" />
-->
<java classname="${test.class}" fork="yes" >
<sysproperty key="ADMIN_HOST" value="${admin.host}" />
<sysproperty key="ADMIN_PORT" value="${admin.port}" />
<sysproperty key="ADMIN_PASSWORD" value="${admin.password}" />
<sysproperty key="ADMIN_USER" value="${admin.user}" />
<!--
<sysproperty key="IS_EE" value="pe" />
<sysproperty key="javax.net.ssl.trustStore" value="./certdb.jks" />
<sysproperty key="javax.net.ssl.trustStorePassword" value="${ssl.password}" />
-->
<classpath>
<path refid="base.classpath" />
<pathelement location="${build.classes.dir}" />
<pathelement location="${classpath}" />
<pathelement location="${env.APS_HOME}/lib/reporter.jar" />
</classpath>
</java>
</target>
<!-- =================================================================== -->
<!-- Generate truststore for ee -->
<!-- =================================================================== -->
<target name="import-cert-jks" >
<echo message="Installing certificate in ${keystore.file} ..."/>
<exec executable="${env.JAVA_HOME}/bin/keytool">
<arg value="-import"/>
<arg value="-noprompt"/>
<arg value="-trustcacerts"/>
<arg value="-keystore"/>
<arg value="${keystore.file}"/>
<arg value="-storepass"/>
<arg value="changeit"/>
<arg value="-alias"/>
<arg value="${cert.alias}"/>
<arg value="-file"/>
<arg value="${cert.file}"/>
</exec>
</target>
<!-- Get certificate from NSS db to JKS format -->
<target name="get-certdb-to-jks" if="ee">
<echo message="Installing certificate in ${ee} ..."/>
<exec executable="${env.S1AS_HOME}/lib/certutil" output="./certdb.rfc">
<env key="LD_LIBRARY_PATH" path="${env.S1AS_HOME}/lib"/>
<arg line="-L -n ${cert.nickname}"/>
<arg line="-d ${admin.domain.dir}/${admin.domain}/config -a"/>
</exec>
<concat>
<filelist dir="." files="certdb.rfc"/>
</concat>
<antcall target="import-cert-jks">
<param name="cert.alias" value="${cert.nickname}"/>
<param name="keystore.file" value="./certdb.jks"/>
<param name="cert.file" value="./certdb.rfc"/>
</antcall>
</target>
<!-- =================================================================== -->
<!-- Cleans up generated stuff -->
<!-- =================================================================== -->
<target name="clean">
<delete dir="${classes.dir}" />
</target>
</project>