blob: d2f3b7f9f35663106b54e36dfa7bef07471b069e [file] [log] [blame]
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE project [
<!--
Copyright (c) 2017, 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
-->
<!ENTITY commonSetup SYSTEM "./../../../../config/properties.xml">
<!ENTITY commonBuild SYSTEM "./../../../../config/common.xml">
<!ENTITY testproperties SYSTEM "./build.properties">
<!ENTITY run SYSTEM "./../../../../config/run.xml">
<!ENTITY eeSetup SYSTEM "./../../../../config/ee-common.xml">
]>
<project name="mix" default="usage" basedir=".">
&commonSetup;
&commonBuild;
&run;
&eeSetup;
<!--
&eeProperties;
-->
&testproperties;
<target name="all" depends="clean, build,deploy,run,undeploy"/>
<property name="test.javabean.value" value="custom-resource-javabean-test"/>
<property name="test.primitive.int.type" value="Integer"/>
<property name="test.primitive.int.value" value="25"/>
<property name="test.primitive.string.type" value="String"/>
<property name="test.primitive.string.value" value="Primitives-And-String"/>
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
</target>
<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="javabean"/>
</antcall>
<antcall target="compile-common">
<param name="src" value="ejb"/>
</antcall>
<antcall target="compile-common">
<param name="src" value="client"/>
</antcall>
</target>
<target name="build" depends="compile">
<antcall target="build-custom-factory"/>
<antcall target="build-ear-common">
<param name="ejbjar.classes"
value="**/SimpleBMP.class, **/SimpleBMPHome.class, **/SimpleBMPBean.class"/>
<param name="appclientjar.classes"
value="**/SimpleBMP.class, **/SimpleBMPHome.class,**/*Client*.class"/>
</antcall>
</target>
<target name="build-custom-factory">
<mkdir dir="${assemble.dir}"/>
<jar basedir="${build.classes.dir}" includes="**/CustomResourceJavaBean.class"
file="${assemble.dir}/custom-resource-classes.jar"/>
</target>
<target name="deploy" depends="init-common">
<antcall target="deploy-custom-resource-classes"/>
<antcall target="create-custom-resource-common">
<param name="custom.resource.type" value="com.sun.s1asdev.custom.resource.CustomResourceJavaBean"/>
<param name="custom.resource.class" value="org.glassfish.resources.custom.factory.JavaBeanFactory"/>
<param name="custom.resource.name" value="custom/my-java-bean"/>
<param name="extra.params" value=" --property='property=${test.javabean.value}'"/>
</antcall>
<antcall target="create-custom-resource-common">
<param name="custom.resource.type" value="java.lang.Integer"/>
<param name="custom.resource.class" value="org.glassfish.resources.custom.factory.PrimitivesAndStringFactory"/>
<param name="custom.resource.name" value="custom/my-int"/>
<param name="extra.params" value=" --property='type=${test.primitive.int.type}:value=${test.primitive.int.value}'"/>
</antcall>
<antcall target="create-custom-resource-common">
<param name="custom.resource.type" value="java.lang.String"/>
<param name="custom.resource.class" value="org.glassfish.resources.custom.factory.PrimitivesAndStringFactory"/>
<param name="custom.resource.name" value="custom/my-string"/>
<param name="extra.params" value=" --property='type=${test.primitive.string.type}:value=${test.primitive.string.value}'"/>
</antcall>
<antcall target="create-custom-resource-common">
<param name="custom.resource.type" value="java.util.Properties"/>
<param name="custom.resource.class" value="org.glassfish.resources.custom.factory.PropertiesFactory"/>
<param name="custom.resource.name" value="custom/my-simple-properties"/>
<param name="extra.params" value=" --property='${test.primitive.string.type}=${test.primitive.string.value}:${test.primitive.int.type}=${test.primitive.int.value}'"/>
</antcall>
<antcall target="create-custom-resource-common">
<param name="custom.resource.type" value="java.util.Properties"/>
<param name="custom.resource.class" value="org.glassfish.resources.custom.factory.PropertiesFactory"/>
<param name="custom.resource.name" value="custom/my-properties-file"/>
<param name="extra.params" value=" --property='org.glassfish.resources.custom.factory.PropertiesFactory.fileName=simple-properties.properties'"/>
</antcall>
<antcall target="create-custom-resource-common">
<param name="custom.resource.type" value="java.util.Properties"/>
<param name="custom.resource.class" value="org.glassfish.resources.custom.factory.PropertiesFactory"/>
<param name="custom.resource.name" value="custom/my-properties-xml-file"/>
<param name="extra.params" value=" --property='org.glassfish.resources.custom.factory.PropertiesFactory.fileName=simple-properties.xml'"/>
</antcall>
<antcall target="create-custom-resource-common">
<param name="custom.resource.type" value="java.util.Properties"/>
<param name="custom.resource.class" value="org.glassfish.resources.custom.factory.PropertiesFactory"/>
<param name="custom.resource.name" value="custom/my-properties-file-with-values"/>
<param name="extra.params" value=" --property='org.glassfish.resources.custom.factory.PropertiesFactory.fileName=simple-properties.properties:${test.primitive.string.type}=${test.primitive.string.value}'"/>
</antcall>
<antcall target="create-custom-resource-common">
<param name="custom.resource.type" value="java.util.Properties"/>
<param name="custom.resource.class" value="org.glassfish.resources.custom.factory.PropertiesFactory"/>
<param name="custom.resource.name" value="custom/my-properties-xml-file-with-values"/>
<param name="extra.params" value=" --property='org.glassfish.resources.custom.factory.PropertiesFactory.fileName=simple-properties.xml:${test.primitive.string.type}=${test.primitive.string.value}'"/>
</antcall>
<antcall target="create-custom-resource-common">
<param name="custom.resource.type" value="java.net.URL"/>
<param name="custom.resource.class" value="org.glassfish.resources.custom.factory.URLObjectFactory"/>
<param name="custom.resource.name" value="custom/my-url"/>
<param name="extra.params" value=" --property='host=java.sun.com:port=80:protocol=http:file=/index.html'"/>
</antcall>
<antcall target="deploy-common"/>
<copy todir="${env.S1AS_HOME}" file="properties/simple-properties.properties"/>
<copy todir="${env.S1AS_HOME}" file="properties/simple-properties.xml"/>
</target>
<target name="deploy-custom-resource-classes">
<copyfile src="${assemble.dir}/custom-resource-classes.jar"
dest="${env.S1AS_HOME}/lib/custom-resource-classes.jar"/>
<antcall target="restart-server"/>
</target>
<target name="undeploy-custom-resource-classes">
<delete file="${env.S1AS_HOME}/lib/custom-resource-classes.jar"/>
<antcall target="restart-server"/>
</target>
<target name="run" depends="init-common">
<antcall target="runclient-common">
<param name="appclient.application.args" value="javabean ${test.javabean.value}"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="primitivesandstring ${test.primitive.int.type} ${test.primitive.int.value} custom/my-int"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="primitivesandstring ${test.primitive.string.type} ${test.primitive.string.value} custom/my-string"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="properties String Primitives-And-String Integer 25 custom/my-simple-properties"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="properties String Primitives-And-String-in-properties-file Integer 25 custom/my-properties-file"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="properties String Primitives-And-String-in-xml-file Integer 25 custom/my-properties-xml-file"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="properties String Primitives-And-String Integer 25 custom/my-properties-file-with-values"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="properties String Primitives-And-String Integer 25 custom/my-properties-xml-file-with-values"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="url http://java.sun.com:80/index.html custom/my-url"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="mappednames"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="lookupnames"/>
</antcall>
</target>
<target name="undeploy" depends="init-common">
<antcall target="undeploy-custom-resource-classes"/>
<antcall target="delete-custom-resource-common">
<param name="custom.resource.name" value="custom/my-java-bean"/>
</antcall>
<antcall target="delete-custom-resource-common">
<param name="custom.resource.name" value="custom/my-int"/>
</antcall>
<antcall target="delete-custom-resource-common">
<param name="custom.resource.name" value="custom/my-string"/>
</antcall>
<antcall target="delete-custom-resource-common">
<param name="custom.resource.name" value="custom/my-simple-properties"/>
</antcall>
<antcall target="delete-custom-resource-common">
<param name="custom.resource.name" value="custom/my-properties-file"/>
</antcall>
<antcall target="delete-custom-resource-common">
<param name="custom.resource.name" value="custom/my-properties-xml-file"/>
</antcall>
<antcall target="delete-custom-resource-common">
<param name="custom.resource.name" value="custom/my-properties-file-with-values"/>
</antcall>
<antcall target="delete-custom-resource-common">
<param name="custom.resource.name" value="custom/my-properties-xml-file-with-values"/>
</antcall>
<antcall target="delete-custom-resource-common">
<param name="custom.resource.name" value="custom/my-url"/>
</antcall>
<antcall target="undeploy-common"/>
<delete file="${env.S1AS_HOME}/simple-properties.properties"/>
<delete file="${env.S1AS_HOME}/simple-properties.xml"/>
</target>
<target name="usage">
<antcall target="usage-common"/>
</target>
</project>