Skip to content

Commit

Permalink
Module with JDK16 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartisk committed Sep 14, 2021
1 parent 7e1f928 commit 3615e32
Show file tree
Hide file tree
Showing 13 changed files with 474 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11]
java: [8, 11, 16]
name: build with jdk ${{matrix.java}}

steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void setOtherFields(Map<String, JsonValue> otherFields) {

@Override
public String toString() {
String other = otherFields.isEmpty() ? "" : ", otherFields=" + otherFields;
String other = (otherFields == null || otherFields.isEmpty()) ? "" : ", otherFields=" + otherFields;
return "GraphQLError{message=" + message +
", locations=" + locations +
", path=" + Arrays.toString(path) +
Expand Down
16 changes: 16 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -411,5 +411,21 @@
</plugins>
</build>
</profile>
<profile>
<id>jdk16plus</id>
<activation>
<jdk>[16,)</jdk>
</activation>
<modules>
<module>server/integration-tests-jdk16</module>
</modules>
<properties>
<!-- FIXME: hack to allow powerannotations TCK to pass on JDK 16 -->
<powerannotations.tck.argLine>--add-opens java.base/java.util=ALL-UNNAMED</powerannotations.tck.argLine>
<!-- FIXME: find out why Gradle build doesn't work on JDK 16 in GH actions,
but seems to work locally -->
<skip.gradle.build>true</skip.gradle.build>
</properties>
</profile>
</profiles>
</project>
2 changes: 2 additions & 0 deletions power-annotations/tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<groups>!InheritedAnnotationsTestSuite &amp; !TypeToMemberAnnotationsTestSuite</groups>
<!-- FIXME: this is a dirty hack to make the TCK pass on JDK 16 -->
<argLine>${powerannotations.tck.argLine}</argLine>
</configuration>
</plugin>
</plugins>
Expand Down
221 changes: 221 additions & 0 deletions server/integration-tests-jdk16/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>smallrye-graphql-server-parent</artifactId>
<groupId>io.smallrye</groupId>
<version>1.3.4-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>smallrye-graphql-integration-tests-jdk16</artifactId>
<name>SmallRye: GraphQL Server :: Integration Tests :: Java 16+ tests</name>

<properties>
<maven.compiler.target>16</maven.compiler.target>
<maven.compiler.source>16</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-test-spi</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
</dependency>

<!-- Test -->
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>

<!-- Dynamic client -->
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-graphql-client-implementation-vertx</artifactId>
<scope>test</scope>
</dependency>
<!-- The API is copied into SmallRye for now -->
<!-- <dependency>-->
<!-- <groupId>org.eclipse.microprofile.graphql</groupId>-->
<!-- <artifactId>microprofile-graphql-client-api</artifactId>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->

<!-- Container -->
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-jetty-embedded-9</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-deploy</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-annotations</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>javax-websocket-client-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>javax-websocket-server-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.smallrye.config</groupId>
<artifactId>smallrye-config</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.metrics</groupId>
<artifactId>microprofile-metrics-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-metrics</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-mock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-opentracing</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.context-propagation</groupId>
<artifactId>microprofile-context-propagation-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-context-propagation</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>mutiny</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>mutiny-smallrye-context-propagation</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.el</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.graphql</groupId>
<artifactId>microprofile-graphql-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-graphql-servlet</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<configuration>
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<reuseForks>false</reuseForks>
<forkCount>1</forkCount>
</configuration>
</plugin>
<!-- FIXME: There's no version of impsort plugin yet that properly supports
Java 16 sources. Exclude impsort on this module for now. -->
<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>16</release>
</configuration>
</plugin>
</plugins>
</build>


</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package io.smallrye.graphql.tests;

import java.io.File;
import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.Set;

import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
import org.jboss.arquillian.test.spi.TestClass;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.resolver.api.maven.Maven;

/**
* Creates the deployable unit with all the needed dependencies.
*
* @author Phillip Kruger ([email protected])
*/
public class SmallRyeGraphQLArchiveProcessor implements ApplicationArchiveProcessor {

@Override
public void process(Archive<?> applicationArchive, TestClass testClass) {

if (applicationArchive instanceof WebArchive) {
WebArchive testDeployment = (WebArchive) applicationArchive;

final File[] dependencies = Maven.resolver()
.loadPomFromFile("pom.xml")
.resolve("io.smallrye:smallrye-graphql-servlet")
.withoutTransitivity()
.asFile();
// Make sure it's unique
Set<File> dependenciesSet = new LinkedHashSet<>(Arrays.asList(dependencies));
testDeployment.addAsLibraries(dependenciesSet.toArray(new File[] {}));
}

System.out.println(applicationArchive.toString(true));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package io.smallrye.graphql.tests;

import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
import org.jboss.arquillian.core.spi.LoadableExtension;

/**
* Activating the extension
*
* @author Phillip Kruger ([email protected])
*/
public class SmallRyeGraphQLExtension implements LoadableExtension {
@Override
public void register(ExtensionBuilder builder) {
builder.service(ApplicationArchiveProcessor.class, SmallRyeGraphQLArchiveProcessor.class);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
io.smallrye.graphql.tests.SmallRyeGraphQLExtension
Loading

0 comments on commit 3615e32

Please sign in to comment.