Skip to content

Commit

Permalink
Fixed connector_group_2 tests
Browse files Browse the repository at this point in the history
Signed-off-by: David Matějček <[email protected]>
  • Loading branch information
dmatej committed Nov 9, 2024
1 parent 9b768ee commit e270372
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 119 deletions.
1 change: 1 addition & 0 deletions appserver/tests/appserv-tests/config/properties.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ AS_ADMIN_MASTERPASSWORD=${master.password}</echo>

<target name="setS1ASclassPath" unless="s1as.classpath">
<path id="s1as_classpath_jars">
<fileset dir="${env.S1AS_HOME}/lib/bootstrap" includes="*.jar"/>
<fileset dir="${env.S1AS_HOME}/modules" includes="**/*.jar" />
</path>
<pathconvert pathsep=":" property="s1as.classpath" refid="s1as_classpath_jars" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

-->

<!ENTITY commonSetup SYSTEM "./../../../../config/properties.xml">
<!ENTITY commonBuild SYSTEM "./../../../../config/common.xml">
<!ENTITY testproperties SYSTEM "./build.properties">
<!ENTITY commonSetup SYSTEM "./../../../../config/properties.xml">
<!ENTITY commonBuild SYSTEM "./../../../../config/common.xml">
<!ENTITY testproperties SYSTEM "./build.properties">
]>

<project name="connection-factory-definition-App" default="usage" basedir=".">
Expand All @@ -31,131 +31,131 @@

<target name="all" depends="build,setup,deploy,run,unsetup,undeploy"/>

<target name="clean" depends="init-common">
<antcall target="clean-common"/>
<ant dir="ra" target="clean"/>
</target>

<target name="info" depends="init-common">
<echo message="build.classes.dir is ${build.classes.dir}"/>
<echo message="s1astest.classpath is ${s1astest.classpath}"/>
</target>

<target name="compile-ut" depends="init-common">
<mkdir dir="${build.classes.dir}"/>
<javac srcdir="ut" destdir="${build.classes.dir}"
classpath="${mvn.lib.dir}/junit.jar:${s1astest.classpath}"
debug="on"
includeantruntime="false"
failonerror="true"/>
</target>
<target name="build-ut" depends="init-common">
<!-- build a special ear which only includes deployment descriptors-->
<mkdir dir="${assemble.dir}"/>
<mkdir dir="${assemble.dir}/temp"/>
<mkdir dir="${build.classes.dir}/META-INF"/>
<copy file="${basedir}/descriptor/ut-application.xml" tofile="${build.classes.dir}/META-INF/application.xml" failonerror="false"/>
<jar jarfile="${assemble.dir}/${appname}App-UT.ear">
<fileset dir="${assemble.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${build.classes.dir}">
<include name="META-INF/application.xml"/>
</fileset>
</jar>

<!-- unpack war, jar, ear files, otherwise annotations will not be processed. -->
<unjar src="${assemble.dir}/${appname}-ejb.jar" dest="${assemble.dir}/temp/${appname}-ejb"/>
<unjar src="${assemble.dir}/${appname}-web.war" dest="${assemble.dir}/temp/${appname}-web"/>
<unjar src="${assemble.dir}/${appname}-client.jar" dest="${assemble.dir}/temp/${appname}-client"/>
<unjar src="${assemble.dir}/${appname}App-UT.ear" dest="${assemble.dir}/temp/${appname}App-UT"/>

</target>

<target name="run-ut" depends="compile-ut">
<junit printsummary="yes" haltonerror="no" haltonfailure="no" fork="true">
<formatter type="plain" usefile="false"/>
<jvmarg value="-DtestClasspath=${build.classes.dir}"/>
<!--<jvmarg value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9099"/>-->
<jvmarg value="-DworkDir=${basedir}"/>
<jvmarg value="-DArchiveDir=${assemble.dir}/temp"/>
<classpath>
<pathelement path="${mvn.lib.dir}/junit.jar:${s1astest.classpath}"/>
</classpath>

<test name="com.sun.s1asdev.cfd.ArchiveTest" todir="${basedir}/report"/>
<test name="com.sun.s1asdev.cfd.DDTest" todir="${basedir}/report"/>
</junit>
</target>

<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="servlet"/>
</antcall>
</target>

<target name="build" depends="compile">
<echo message="assemble.dir = ${assemble.dir}"/>
<!--build and package .war first so it doesn't contain ejb bean !-->
<!--classes that have @Stateless/@Stateul !-->
<antcall target="webclient-war-common">
<param name="hasWebclient" value="true"/>
</antcall>

<antcall target="compile-common">
<param name="src" value="ejb"/>
</antcall>
<antcall target="compile-common">
<param name="src" value="client"/>
</antcall>

<antcall target="appclient-jar-common">
<param name="appclientjar.classes"
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
<ant dir="ra" target="clean"/>
</target>

<target name="info" depends="init-common">
<echo message="build.classes.dir is ${build.classes.dir}"/>
<echo message="s1astest.classpath is ${s1astest.classpath}"/>
</target>

<target name="compile-ut" depends="init-common">
<mkdir dir="${build.classes.dir}" />
<javac srcdir="ut" destdir="${build.classes.dir}"
classpath="${mvn.lib.dir}/junit.jar:${s1astest.classpath}"
debug="on" includeantruntime="false" failonerror="true"
/>
</target>

<target name="build-ut" depends="init-common">
<!-- build a special ear which only includes deployment descriptors-->
<mkdir dir="${assemble.dir}"/>
<mkdir dir="${assemble.dir}/temp"/>
<mkdir dir="${build.classes.dir}/META-INF"/>
<copy file="${basedir}/descriptor/ut-application.xml" tofile="${build.classes.dir}/META-INF/application.xml" failonerror="false"/>
<jar jarfile="${assemble.dir}/${appname}App-UT.ear">
<fileset dir="${assemble.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${build.classes.dir}">
<include name="META-INF/application.xml"/>
</fileset>
</jar>

<!-- unpack war, jar, ear files, otherwise annotations will not be processed. -->
<unjar src="${assemble.dir}/${appname}-ejb.jar" dest="${assemble.dir}/temp/${appname}-ejb"/>
<unjar src="${assemble.dir}/${appname}-web.war" dest="${assemble.dir}/temp/${appname}-web"/>
<unjar src="${assemble.dir}/${appname}-client.jar" dest="${assemble.dir}/temp/${appname}-client"/>
<unjar src="${assemble.dir}/${appname}App-UT.ear" dest="${assemble.dir}/temp/${appname}App-UT"/>

</target>

<target name="run-ut" depends="compile-ut">
<junit printsummary="yes" haltonerror="no" haltonfailure="no" fork="true">
<formatter type="plain" usefile="false"/>
<jvmarg value="-DtestClasspath=${build.classes.dir}"/>
<!--<jvmarg value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9099"/>-->
<jvmarg value="-DworkDir=${basedir}"/>
<jvmarg value="-DArchiveDir=${assemble.dir}/temp"/>
<classpath>
<pathelement path="${mvn.lib.dir}/junit.jar:${s1astest.classpath}"/>
</classpath>

<test name="com.sun.s1asdev.cfd.ArchiveTest" todir="${basedir}/report"/>
<test name="com.sun.s1asdev.cfd.DDTest" todir="${basedir}/report"/>
</junit>
</target>

<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="servlet"/>
</antcall>
</target>

<target name="build" depends="compile">
<echo message="assemble.dir = ${assemble.dir}"/>
<!--build and package .war first so it doesn't contain ejb bean !-->
<!--classes that have @Stateless/@Stateul !-->
<antcall target="webclient-war-common">
<param name="hasWebclient" value="true"/>
</antcall>

<antcall target="compile-common">
<param name="src" value="ejb"/>
</antcall>
<antcall target="compile-common">
<param name="src" value="client"/>
</antcall>

<antcall target="appclient-jar-common">
<param name="appclientjar.classes"
value="**/*Client*.class"/>
</antcall>
</antcall>

<antcall target="ejb-jar-common">
<param name="ejbjar.classes"
<antcall target="ejb-jar-common">
<param name="ejbjar.classes"
value="**/Hello**.class"/>
</antcall>
</antcall>

<antcall target="ear-common"/>
<antcall target="ear-common"/>

<antcall target="build-ut"/>
<antcall target="build-ut"/>

<ant dir="ra" target="all"/>
</target>
<ant dir="ra" target="all"/>
</target>

<target name="setup" depends="init-common">
</target>
<target name="setup" depends="init-common">
</target>

<target name="unsetup" depends="init-common">
</target>
<target name="unsetup" depends="init-common">
</target>

<target name="deploy" depends="init-common">
<ant dir="ra" inheritAll="false" target="deploy"/>
<ant dir="ra" inheritAll="false" target="testAddAdmin"/>
<antcall target="deploy-common"/>
<target name="deploy" depends="init-common">
<ant dir="ra" inheritAll="false" target="deploy"/>
<ant dir="ra" inheritAll="false" target="testAddAdmin"/>
<antcall target="deploy-common"/>

</target>
</target>

<target name="run" depends="init-common">
<antcall target="run-ut"/>
<antcall target="run-it"/>
</target>
<target name="run" depends="init-common">
<antcall target="run-ut"/>
<antcall target="run-it"/>
</target>

<target name="run-it" depends="init-common">
<antcall target="runclient-common">
<param name="appclient.application.args" value="${http.host} ${http.port}"/>
</antcall>
</target>
<target name="run-it" depends="init-common">
<antcall target="runclient-common">
<param name="appclient.application.args" value="${http.host} ${http.port}"/>
</antcall>
</target>

<target name="undeploy" depends="init-common">
<antcall target="undeploy-common"/>
<ant dir="ra" inheritAll="false" target="undeploy"/>
</target>
<target name="undeploy" depends="init-common">
<antcall target="undeploy-common"/>
<ant dir="ra" inheritAll="false" target="undeploy"/>
</target>

<target name="usage">
<antcall target="usage-common"/>
</target>
<target name="usage">
<antcall target="usage-common"/>
</target>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private void doTestApplicationArchive() throws Exception{

ApplicationArchivist reader = (ApplicationArchivist) TestUtil.getByType(ApplicationArchivist.class);
reader.setAnnotationProcessingRequested(true);
ASURLClassLoader classLoader = new ASURLClassLoader(this.getClass().getClassLoader());
ASURLClassLoader classLoader = new ASURLClassLoader(appArchiveName, this.getClass().getClassLoader());
classLoader.addURL(archive.toURL());
reader.setClassLoader(classLoader);

Expand Down Expand Up @@ -127,7 +127,7 @@ private void doTestWebArchive() throws Exception{
File archive = new File(archiveDir, appArchiveName);
assertTrue("Do not fing the archive "+archive.getAbsolutePath(), archive.exists());

ASURLClassLoader classLoader = new ASURLClassLoader(this.getClass().getClassLoader());
ASURLClassLoader classLoader = new ASURLClassLoader(appArchiveName, this.getClass().getClassLoader());
classLoader.addURL(archive.toURL());

WebArchivist reader = (WebArchivist) TestUtil.getByType(WebArchivist.class);
Expand Down Expand Up @@ -236,7 +236,7 @@ private void doTestEJBArchive() throws Exception{
File archive = new File(archiveDir, appArchiveName);
assertTrue("Do not fing the archive "+archive.getAbsolutePath(), archive.exists());

ASURLClassLoader classLoader = new ASURLClassLoader(this.getClass().getClassLoader());
ASURLClassLoader classLoader = new ASURLClassLoader(appArchiveName, this.getClass().getClassLoader());
classLoader.addURL(archive.toURL());

EjbArchivist reader = (EjbArchivist) TestUtil.getByType(EjbArchivist.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
<target name="setS1ASclassPath" unless="s1as.classpath">
<path id="s1as_classpath_jars">
<fileset dir="${env.S1AS_HOME}/lib" includes="*.jar,*.zip"/>
<fileset dir="${env.S1AS_HOME}/lib/bootstrap" includes="*.jar"/>
<fileset dir="${env.APS_HOME}/lib" includes="**/*.jar,**/*.zip"/>
<fileset dir="${env.APS_HOME}/lib/target" includes="**/*.jar"/>
<fileset dir="${env.ANT_HOME}/lib" includes="*.jar"/>
Expand Down

0 comments on commit e270372

Please sign in to comment.