Skip to content

Commit

Permalink
Fixed using wrong java command in TCK authentication and managing fai…
Browse files Browse the repository at this point in the history
…lures

Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
  • Loading branch information
dmatej committed Apr 17, 2024
1 parent 1305fa7 commit 21f48d0
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions appserver/tests/tck/authentication/pom.xml
Expand Up @@ -209,31 +209,36 @@

<limit maxwait="60">
<exec executable="${glassfish.asadmin}" dir="${glassfish.home}/glassfish/bin">
<env key="AS_JAVA" value="${java.home}"/>
<arg value="delete-domain"/>
<arg value="domain1" />
</exec>
<exec executable="${glassfish.asadmin}" dir="${glassfish.home}/glassfish/bin">
<env key="AS_JAVA" value="${java.home}"/>
<arg value="create-domain"/>
<arg value="--domainproperties=domain.adminPort=${port.admin}:domain.instancePort=${port.http}:http.ssl.port=${port.https}:jms.port=${port.jms}:domain.jmxPort=${port.jmx}:orb.listener.port=${port.orb}:orb.ssl.port=${port.orb.ssl}:orb.mutualauth.port=${port.orb.mutual}" />
<arg value="--user=admin" />
<arg value="--nopassword" />
<arg value="domain1" />
</exec>
<exec executable="${glassfish.asadmin}" dir="${glassfish.home}/glassfish/bin">
<env key="AS_JAVA" value="${java.home}"/>
<arg value="start-domain"/>
</exec>

<if>
<isset property="jacoco.version" />
<then>
<exec executable="${glassfish.asadmin}" dir="${glassfish.home}/glassfish/bin">
<env key="AS_JAVA" value="${java.home}"/>
<arg value="create-jvm-options" />
<arg value="--port=${port.admin}" />
<arg value="&quot;-javaagent\:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${project.build.directory}/jacoco-it.exec,includes=${jacoco.includes}&quot;" />
</exec>
</then>
</if>
<exec executable="${glassfish.asadmin}" dir="${glassfish.home}/glassfish/bin">
<env key="AS_JAVA" value="${java.home}"/>
<arg value="stop-domain"/>
<arg value="domain1"/>
</exec>
Expand Down Expand Up @@ -266,29 +271,37 @@
<goal>run</goal>
</goals>
<configuration>

<target xmlns:if="ant:if" xmlns:unless="ant:unless">
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpathref="maven.plugin.classpath" />
<limit maxwait="20">
<exec executable="${glassfish.asadmin}" dir="${glassfish.home}/glassfish/bin">
<exec executable="${glassfish.asadmin}" dir="${glassfish.home}/glassfish/bin" failonerror="true">
<env key="AS_JAVA" value="${java.home}"/>
<arg value="start-domain"/>
</exec>
</limit>

<exec executable="${ant.home}/bin/ant" dir="${tck.home}/bin">
<exec executable="${ant.home}/bin/ant" dir="${tck.home}/bin" failonerror="true">
<env key="AS_JAVA" value="${java.home}"/>
<env key="JAVA_HOME" value="${java.home}"/>
<arg value="config.vi" />
</exec>
<exec executable="${ant.home}/bin/ant" dir="${tck.home}/bin">
<exec executable="${ant.home}/bin/ant" dir="${tck.home}/bin" failonerror="true">
<env key="AS_JAVA" value="${java.home}"/>
<env key="JAVA_HOME" value="${java.home}"/>
<arg value="enable.jaspic" />
</exec>

<!-- Restart GlassFish in debug mode if so requested -->
<sequential if:set="glassfish.suspend">
<exec executable="${glassfish.asadmin}" dir="${glassfish.home}/glassfish/bin">
<exec executable="${glassfish.asadmin}" dir="${glassfish.home}/glassfish/bin" failonerror="true">
<env key="AS_JAVA" value="${java.home}"/>
<arg value="stop-domain" />
</exec>
<echo message="Starting GlassFish in suspended mode, waiting on port 9009" />
<exec executable="${glassfish.asadmin}" dir="${glassfish.home}/glassfish/bin">
<exec executable="${glassfish.asadmin}" dir="${glassfish.home}/glassfish/bin" failonerror="true">
<env key="AS_JAVA" value="${java.home}"/>
<arg value="start-domain"/>
<arg value="--suspend" if:set="glassfish.suspend"/>
</exec>
Expand All @@ -310,26 +323,29 @@
classpathref="maven.plugin.classpath" />
<echo level="info" message="Start running all tests" />
<exec executable="${ant.home}/bin/ant" dir="${tck.home}/bin" resultproperty="testResult">
<env key="AS_JAVA" value="${java.home}"/>
<env key="JAVA_HOME" value="${java.home}"/>
<arg value="-Dmultiple.tests=${run.test}" if:set="run.test" />
<arg value="runclient.nobinaryfinder" if:set="run.test" />
<arg value="run.all" unless:set="run.test" />
<env key="LC_ALL" value="C" />
</exec>

<exec executable="${glassfish.asadmin}" dir="${glassfish.home}/glassfish/bin">
<env key="AS_JAVA" value="${java.home}"/>
<arg value="stop-domain" />
</exec>

<if>
<not>
<equals arg1="${testResult}" arg2="0" />
</not>
<then>
<echo message="Running tests failed." />
<loadfile property="contents" srcFile="${glassfish.home}/glassfish/domains/domain1/logs/server.log" />
<echo message="${contents}" />
<fail status="${testResult}" message="${contents}" />
</then>
</if>

<exec executable="${glassfish.asadmin}" dir="${glassfish.home}/glassfish/bin">
<arg value="stop-domain" />
</exec>
</target>
</configuration>
</execution>
Expand Down

0 comments on commit 21f48d0

Please sign in to comment.