Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Arquillian adapter #2481

Merged
merged 1 commit into from
May 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,11 @@
<artifactId>quarkus-junit5</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arquillian</artifactId>
<version>${project.version}</version>
</dependency>

<!-- External dependencies -->

Expand Down
4 changes: 4 additions & 0 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
<!-- These 2 properties are used by CreateProjectMojo to add the Maven Wrapper -->
<proposed-maven-vesion>3.6.1</proposed-maven-vesion>
<maven-wrapper.version>0.7.6</maven-wrapper.version>

<!-- MicroProfile TCK versions -->
<microprofile-health-api.version>1.0</microprofile-health-api.version>
<microprofile-config-api.version>1.3</microprofile-config-api.version>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,13 @@ public void validateConfigProperties(Map<String, Set<String>> properties) {
if (propertyClass.isArray() || propertyClass.getTypeParameters().length > 0) {
propertyClass = String.class;
}
if (!config.getOptionalValue(entry.getKey(), propertyClass).isPresent()) {
throw new DeploymentException(
"No config value of type " + entry.getValue() + " exists for: " + entry.getKey());
try {
if (!config.getOptionalValue(entry.getKey(), propertyClass).isPresent()) {
throw new DeploymentException(
"No config value of type " + entry.getValue() + " exists for: " + entry.getKey());
}
} catch (IllegalArgumentException e) {
throw new DeploymentException(e);
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,17 @@
</plugins>
</build>
</profile>
<profile>
<id>tcks</id>
<activation>
<property>
<name>tcks</name>
</property>
</activation>
<modules>
<module>tcks</module>
</modules>
</profile>
</profiles>

</project>
57 changes: 57 additions & 0 deletions tcks/microprofile-config/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<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">
<parent>
<artifactId>quarkus-tck-parent</artifactId>
<groupId>io.quarkus</groupId>
<version>999-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>quarkus-tck-microprofile-config</artifactId>
<name>Quarkus - TCK - MicroProfile Config</name>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>tck-suite.xml</suiteXmlFile>
</suiteXmlFiles>
<!-- These env variables are required for org.eclipse.microprofile.config.tck.CDIPropertyNameMatchingTest -->
<environmentVariables>
<my_int_property>45</my_int_property>
<MY_BOOLEAN_PROPERTY>true</MY_BOOLEAN_PROPERTY>
<my_string_property>haha</my_string_property>
<MY_STRING_PROPERTY>woohoo</MY_STRING_PROPERTY>
</environmentVariables>
<systemPropertyVariables>
<!-- Disable quarkus optimization -->
<quarkus.arc.remove-unused-beans>false</quarkus.arc.remove-unused-beans>
</systemPropertyVariables>
<!-- This workaround allows us to run a single test using
the "test" system property -->
<!-- https://issues.apache.org/jira/browse/SUREFIRE-569 -->
<dependenciesToScan>
<dependency>org.eclipse.microprofile.config:microprofile-config-tck</dependency>
</dependenciesToScan>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arquillian</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-tck</artifactId>
<version>${microprofile-config-api.version}</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package io.quarkus.tck.config;

// We need this class so that target/test-classes is added to the class path?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What breaks if target/test-classes isn't on the classpath?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it seems that surefire does not create a test classloader and I think we need this because of how framework classes are loaded. But I can try it again since I changed the code to use the BootstrapClassLoaderFactory...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fails without the dummy class. Maybe @stuartwdouglas or @aloubyansky would know why?

public class Dummy {

}
38 changes: 38 additions & 0 deletions tcks/microprofile-config/tck-suite.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="microprofile-config-TCK" verbose="2"
configfailurepolicy="continue">

<test name="microprofile-config 1.2 TCK">
<packages>
<package
name="org.eclipse.microprofile.config.tck.*">
</package>
</packages>

<classes>
<!-- Custom converters -->
<class
name="org.eclipse.microprofile.config.tck.ArrayConverterTest">
<methods>
<exclude name=".*" />
</methods>
</class>
<class
name="org.eclipse.microprofile.config.tck.ConfigProviderTest">
<methods>
<!-- io.quarkus.runtime.configuration.ExpandingConfigSource
is not serializable -->
<exclude
name="testInjectedConfigSerializable" />
<!-- The property MAVEN_CMD_LINE_ARGS did not have the
expected value. expected [clean test] but found [ clean test] -->
<exclude name="testEnvironmentConfigSource" />
<!-- expected [clean test] but found [ clean test] -->
<exclude name="testPropertyConfigSource" />
</methods>
</class>

</classes>
</test>

</suite>
56 changes: 56 additions & 0 deletions tcks/microprofile-health/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<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">
<parent>
<artifactId>quarkus-tck-parent</artifactId>
<groupId>io.quarkus</groupId>
<version>999-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>quarkus-tck-microprofile-health</artifactId>
<name>Quarkus - TCK - MicroProfile Health</name>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>tck-suite.xml</suiteXmlFile>
</suiteXmlFiles>
<!-- This workaround allows us to run a single test using
the "test" system property -->
<!-- https://issues.apache.org/jira/browse/SUREFIRE-569 -->
<dependenciesToScan>
<dependency>org.eclipse.microprofile.health:microprofile-health-tck</dependency>
</dependenciesToScan>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arquillian</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-health</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.health</groupId>
<artifactId>microprofile-health-tck</artifactId>
<version>${microprofile-health-api.version}</version>
<exclusions>
<exclusion>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package io.quarkus.tck.health;

// We need this class so that target/test-classes is added to the class path?
public class Dummy {

}
14 changes: 14 additions & 0 deletions tcks/microprofile-health/tck-suite.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="microprofile-config-TCK" verbose="2"
configfailurepolicy="continue">

<test name="microprofile-health 1.0 TCK">
<packages>
<package
name="org.eclipse.microprofile.health.tck.*">
</package>
</packages>

</test>

</suite>
38 changes: 38 additions & 0 deletions tcks/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<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">
<parent>
<artifactId>quarkus-build-parent</artifactId>
<groupId>io.quarkus</groupId>
<version>999-SNAPSHOT</version>
<relativePath>../build-parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>quarkus-tck-parent</artifactId>
<name>Quarkus - TCK - Parent</name>
<packaging>pom</packaging>

<modules>
<module>microprofile-config</module>
<module>microprofile-health</module>
</modules>

<properties>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus-staging-maven-plugin.version}</version>
<configuration>
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
</configuration>
</plugin>
</plugins>
</build>

</project>
81 changes: 81 additions & 0 deletions test-framework/arquillian/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2019 Red Hat, Inc.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<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>io.quarkus</groupId>
<artifactId>quarkus-test-framework</artifactId>
<version>999-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

<artifactId>quarkus-arquillian</artifactId>
<name>Quarkus - Arquillian Adapter</name>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.4.1.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bootstrap-core</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-test-common</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-spi</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-test-spi</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-test-impl-base</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.quarkus.arquillian;

import org.jboss.arquillian.container.spi.ConfigurationException;
import org.jboss.arquillian.container.spi.client.container.ContainerConfiguration;

public class QuarkusConfiguration implements ContainerConfiguration {

@Override
public void validate() throws ConfigurationException {
}

}
Loading