blob: 6e982fab3344b2b7ce67b06834e10f7f9dc9c3b0 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2021 Contributors to the Eclipse Foundation. 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
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.glassfish.main.tests</groupId>
<artifactId>tests.tck</artifactId>
<version>6.2.1</version>
</parent>
<artifactId>glassfish-external-tck-authorization</artifactId>
<packaging>pom</packaging>
<name>GlassFish Tests - TCK - Authorization</name>
<properties>
<ant.home>${project.build.directory}/ant</ant.home>
<ant.zip.url>https://archive.apache.org/dist/ant/binaries/apache-ant-${ant.version}-bin.zip</ant.zip.url>
<tck.home>${project.build.directory}/tck</tck.home>
<glassfish.home>${tck.home}/glassfish6</glassfish.home>
<glassfish.version>${project.version}</glassfish.version>
<tck.tests.home>${tck.home}/src/com/sun/ts/tests</tck.tests.home>
<tck.tests.url>https://download.eclipse.org/ee4j/jakartaee-tck/jakartaee9-eftl/promoted/jakarta-authorization-tck-2.0.1.zip</tck.tests.url>
</properties>
<dependencies>
<dependency>
<groupId>org.glassfish.main.distributions</groupId>
<artifactId>glassfish</artifactId>
<version>${glassfish.version}</version>
<type>zip</type>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>Grab-Glassfish</id>
<phase>pre-integration-test</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.glassfish.main.distributions</groupId>
<artifactId>glassfish</artifactId>
<version>${glassfish.version}</version>
<type>zip</type>
<outputDirectory>${tck.home}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>${ant.version}</version>
</dependency>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>1.0b3</version>
<exclusions>
<exclusion>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<executions>
<execution>
<id>Grab-TCK-ANT-Configure-ts</id>
<phase>pre-integration-test</phase>
<configuration>
<target>
<!-- Grab TCK - download, unzip and rename TCK -->
<get src="${tck.tests.url}" dest="${project.build.directory}/tck.zip" skipexisting="true" />
<unzip src="${project.build.directory}/tck.zip" dest="${project.build.directory}" />
<move file="${project.build.directory}/authorization-tck"
tofile="${project.build.directory}/tck" />
<!-- Grab ANT - download, unzip, rename and chmod Ant -->
<get src="${ant.zip.url}" dest="${project.build.directory}/ant.zip" skipexisting="true" />
<unzip src="${project.build.directory}/ant.zip" dest="${project.build.directory}" />
<move file="${project.build.directory}/apache-ant-${ant.version}"
tofile="${project.build.directory}/ant" />
<chmod dir="${ant.home}/bin" perm="ugo+rx" includes="*" />
<!-- Change configuration -->
<copy file="${tck.home}/bin/ts.jte.jdk11" tofile="${tck.home}/bin/ts.jte" overwrite="true" />
<replaceregexp file="${tck.home}/bin/ts.jte" byline="true"
match="orb\.port=.*"
replace="orb\.port=3699" />
<replaceregexp file="${tck.home}/bin/ts.jte" byline="true"
match="javaee\.level=.*"
replace="javaee\.level=full" />
<replaceregexp file="${tck.home}/bin/ts.jte" byline="true"
match="jacc\.home=.*"
replace="jacc\.home=${tck.home}/glassfish6/glassfish" />
<replaceregexp file="${tck.home}/bin/ts.jte" byline="true"
match="report\.dir=.*"
replace="report\.dir=${tck.home}/jacctckreport/jacctck" />
<replaceregexp file="${tck.home}/bin/ts.jte" byline="true"
match="work\.dir=.*"
replace="work\.dir=${tck.home}/jacctckwork/jacctck" />
<!-- Run just selected subset tests -->
<replaceregexp file="${tck.home}/bin/build.xml" byline="true"
match="&lt;/project&gt;"
replace="&lt;property name=&quot;all.test.dir&quot; value=&quot;com/sun/ts/tests/jacc/,com/sun/ts/tests/signaturetest/jacc,com/sun/ts/tests/common/vehicle/&quot; /&gt; &lt;/project&gt;" />
<mkdir dir="${tck.home}/jacctckreport"/>
<mkdir dir="${tck.home}/jacctckreport/jacctck"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>Configure-TCK</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpathref="maven.plugin.classpath" />
<!-- If domain fails to start, we don't want to wait 10 minutes -->
<limit maxwait="30" failonerror="true">
<exec executable="${glassfish.home}/glassfish/bin/asadmin"
dir="${glassfish.home}/glassfish/bin">
<arg value="start-domain"/>
</exec>
</limit>
<exec executable="${ant.home}/bin/ant" dir="${tck.home}/bin">
<arg value="config.vi" />
<env key="tck.home" value="${tck.home}"/>
</exec>
<exec executable="${ant.home}/bin/ant" dir="${tck.home}/bin">
<arg value="enable.jacc" />
<env key="tck.home" value="${tck.home}"/>
</exec>
</target>
</configuration>
</execution>
<execution>
<id>Run-TCK-tests</id>
<phase>integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpathref="maven.plugin.classpath" />
<exec executable="${glassfish.home}/glassfish/bin/asadmin"
dir="${glassfish.home}/glassfish/bin">
<arg value="stop-domain"/>
</exec>
<exec executable="${glassfish.home}/glassfish/bin/asadmin"
dir="${glassfish.home}/glassfish/bin">
<arg value="start-domain"/>
</exec>
<echo message="Start running all tests" />
<exec executable="${ant.home}/bin/ant"
dir="${tck.tests.home}" resultproperty="testResult">
<arg value="deploy"/>
<arg value="run.all"/>
<env key="LC_ALL" value="C" />
</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}" />
</then>
</if>
<exec executable="${glassfish.home}/glassfish/bin/asadmin" dir="${glassfish.home}/glassfish/bin">
<arg value="stop-domain" />
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>