Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

Commit 44a9822

Browse files
committed
Zerodep in container TCK
Added tests for the zerodep implementation to use the Arquillian Reactive Streams TCK test to run the tests in a container (Thorntail, but should be straight forward to switch to anything else).
1 parent bba4029 commit 44a9822

File tree

7 files changed

+170
-2
lines changed

7 files changed

+170
-2
lines changed

bin/buildDeps.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
22

33
# This should be set to the commit hash that is being tracked. Needed even if TRACKING_PR is set.
4-
TRACKING_COMMIT="0d0c4f50"
4+
TRACKING_COMMIT="4a1ee95"
55
# To track a particular pull request, put it's number here, otherwise comment it out.
6-
# TRACKING_PR="67"
6+
TRACKING_PR="84"
77

88
set -e
99

pom.xml

+6
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
<modules>
6363
<module>akka</module>
6464
<module>zerodep</module>
65+
<module>zerodep-cdi</module>
6566
</modules>
6667

6768
<dependencyManagement>
@@ -76,6 +77,11 @@
7677
<artifactId>microprofile-reactive-streams-operators-tck</artifactId>
7778
<version>${microprofile.reactive.streams.version}</version>
7879
</dependency>
80+
<dependency>
81+
<groupId>org.eclipse.microprofile.reactive.streams</groupId>
82+
<artifactId>microprofile-reactive-streams-operators-tck-arquillian</artifactId>
83+
<version>${microprofile.reactive.streams.version}</version>
84+
</dependency>
7985
<dependency>
8086
<groupId>com.typesafe.akka</groupId>
8187
<artifactId>akka-actor_2.12</artifactId>

zerodep-cdi/pom.xml

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
4+
-->
5+
6+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
8+
<modelVersion>4.0.0</modelVersion>
9+
10+
<parent>
11+
<groupId>com.lightbend.microprofile.reactive.streams</groupId>
12+
<artifactId>lightbend-microprofile-reactive-streams-parent</artifactId>
13+
<version>1.0-SNAPSHOT</version>
14+
</parent>
15+
16+
<artifactId>lightbend-microprofile-reactive-streams-zerodep-cdi</artifactId>
17+
<name>Lightbend MicroProfile Reactive Streams Operators Zero Dependency CDI</name>
18+
<description>Lightbend MicroProfile Reactive Streams Operators :: Zero Dependency CDI Integration</description>
19+
<dependencies>
20+
<dependency>
21+
<groupId>${project.groupId}</groupId>
22+
<artifactId>lightbend-microprofile-reactive-streams-zerodep</artifactId>
23+
<version>${project.version}</version>
24+
</dependency>
25+
<dependency>
26+
<groupId>javax.enterprise</groupId>
27+
<artifactId>cdi-api</artifactId>
28+
</dependency>
29+
<dependency>
30+
<groupId>org.eclipse.microprofile.reactive.streams</groupId>
31+
<artifactId>microprofile-reactive-streams-operators-tck-arquillian</artifactId>
32+
<scope>test</scope>
33+
</dependency>
34+
<dependency>
35+
<groupId>io.thorntail</groupId>
36+
<artifactId>arquillian</artifactId>
37+
<exclusions>
38+
<exclusion>
39+
<groupId>org.jboss.arquillian.junit</groupId>
40+
<artifactId>arquillian-junit-container</artifactId>
41+
</exclusion>
42+
</exclusions>
43+
<scope>test</scope>
44+
</dependency>
45+
</dependencies>
46+
47+
<dependencyManagement>
48+
<dependencies>
49+
<dependency>
50+
<groupId>javax.enterprise</groupId>
51+
<artifactId>cdi-api</artifactId>
52+
<version>2.0</version>
53+
</dependency>
54+
<dependency>
55+
<groupId>org.jboss.arquillian</groupId>
56+
<artifactId>arquillian-bom</artifactId>
57+
<version>1.1.15.Final</version>
58+
<scope>import</scope>
59+
<type>pom</type>
60+
</dependency>
61+
<dependency>
62+
<groupId>io.thorntail</groupId>
63+
<artifactId>bom</artifactId>
64+
<version>2.0.0.Final</version>
65+
<scope>import</scope>
66+
<type>pom</type>
67+
</dependency>
68+
</dependencies>
69+
</dependencyManagement>
70+
71+
<build>
72+
<plugins>
73+
<plugin>
74+
<groupId>org.apache.maven.plugins</groupId>
75+
<artifactId>maven-javadoc-plugin</artifactId>
76+
<executions>
77+
<execution>
78+
<id>attach-javadocs</id>
79+
<goals>
80+
<goal>jar</goal>
81+
</goals>
82+
</execution>
83+
</executions>
84+
</plugin>
85+
<plugin>
86+
<groupId>org.apache.maven.plugins</groupId>
87+
<artifactId>maven-source-plugin</artifactId>
88+
<executions>
89+
<execution>
90+
<id>attach-sources</id>
91+
<goals>
92+
<goal>jar</goal>
93+
</goals>
94+
</execution>
95+
</executions>
96+
</plugin>
97+
</plugins>
98+
</build>
99+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
3+
*/
4+
package com.lightbend.microprofile.reactive.streams.zerodep.cdi;
5+
6+
import org.eclipse.microprofile.reactive.streams.tck.arquillian.ReactiveStreamsArquillianTck;
7+
8+
/**
9+
* This class exists purely to bring in the TCK so that it gets automatically picked up by surefire, and can be run by
10+
* IntelliJ.
11+
*/
12+
public class ReactiveStreamsArquillianTckTest extends ReactiveStreamsArquillianTck {
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
3+
*/
4+
package com.lightbend.microprofile.reactive.streams.zerodep.cdi;
5+
6+
import com.lightbend.microprofile.reactive.streams.zerodep.ReactiveStreamsEngineImpl;
7+
import org.eclipse.microprofile.reactive.streams.ReactiveStreams;
8+
import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveAppender;
9+
import org.jboss.shrinkwrap.api.Archive;
10+
import org.jboss.shrinkwrap.api.ShrinkWrap;
11+
import org.jboss.shrinkwrap.api.spec.JavaArchive;
12+
import org.reactivestreams.Publisher;
13+
14+
/**
15+
* Adds the Reactive Streams operators API as well as the zerodep implementation to Thorntail.
16+
*/
17+
public class ZeroDepArchiveAppender implements AuxiliaryArchiveAppender {
18+
@Override
19+
public Archive<?> createAuxiliaryArchive() {
20+
return ShrinkWrap.create(JavaArchive.class)
21+
.addPackages(true, ReactiveStreams.class.getPackage())
22+
.addPackages(true, Publisher.class.getPackage())
23+
// For some reason, Thorntail automatically creates a bean for this, and I don't know why.
24+
// When I tried to add another application scoped bean that @Produces this, it failed with
25+
// an ambiguous dependency because both that, and the one that Thorntail automatically
26+
// created, existed. I have no idea how that's happening.
27+
.addPackages(true, ReactiveStreamsEngineImpl.class.getPackage());
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
3+
*/
4+
package com.lightbend.microprofile.reactive.streams.zerodep.cdi;
5+
6+
import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveAppender;
7+
import org.jboss.arquillian.core.spi.LoadableExtension;
8+
9+
/**
10+
* Arquillian extension to register the archive appender.
11+
*/
12+
public class ZeroDepExtension implements LoadableExtension {
13+
@Override
14+
public void register(ExtensionBuilder extensionBuilder) {
15+
extensionBuilder.service(AuxiliaryArchiveAppender.class, ZeroDepArchiveAppender.class);
16+
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#
2+
# Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
3+
#
4+
com.lightbend.microprofile.reactive.streams.zerodep.cdi.ZeroDepExtension

0 commit comments

Comments
 (0)