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

Commit

Permalink
Zerodep in container TCK
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
jroper committed Aug 3, 2018
1 parent bba4029 commit 44a9822
Show file tree
Hide file tree
Showing 7 changed files with 170 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/buildDeps.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

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

set -e

Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<modules>
<module>akka</module>
<module>zerodep</module>
<module>zerodep-cdi</module>
</modules>

<dependencyManagement>
Expand All @@ -76,6 +77,11 @@
<artifactId>microprofile-reactive-streams-operators-tck</artifactId>
<version>${microprofile.reactive.streams.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.reactive.streams</groupId>
<artifactId>microprofile-reactive-streams-operators-tck-arquillian</artifactId>
<version>${microprofile.reactive.streams.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.12</artifactId>
Expand Down
99 changes: 99 additions & 0 deletions zerodep-cdi/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
-->

<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>com.lightbend.microprofile.reactive.streams</groupId>
<artifactId>lightbend-microprofile-reactive-streams-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>lightbend-microprofile-reactive-streams-zerodep-cdi</artifactId>
<name>Lightbend MicroProfile Reactive Streams Operators Zero Dependency CDI</name>
<description>Lightbend MicroProfile Reactive Streams Operators :: Zero Dependency CDI Integration</description>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>lightbend-microprofile-reactive-streams-zerodep</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.reactive.streams</groupId>
<artifactId>microprofile-reactive-streams-operators-tck-arquillian</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>arquillian</artifactId>
<exclusions>
<exclusion>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.15.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>bom</artifactId>
<version>2.0.0.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.microprofile.reactive.streams.zerodep.cdi;

import org.eclipse.microprofile.reactive.streams.tck.arquillian.ReactiveStreamsArquillianTck;

/**
* This class exists purely to bring in the TCK so that it gets automatically picked up by surefire, and can be run by
* IntelliJ.
*/
public class ReactiveStreamsArquillianTckTest extends ReactiveStreamsArquillianTck {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.microprofile.reactive.streams.zerodep.cdi;

import com.lightbend.microprofile.reactive.streams.zerodep.ReactiveStreamsEngineImpl;
import org.eclipse.microprofile.reactive.streams.ReactiveStreams;
import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveAppender;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.reactivestreams.Publisher;

/**
* Adds the Reactive Streams operators API as well as the zerodep implementation to Thorntail.
*/
public class ZeroDepArchiveAppender implements AuxiliaryArchiveAppender {
@Override
public Archive<?> createAuxiliaryArchive() {
return ShrinkWrap.create(JavaArchive.class)
.addPackages(true, ReactiveStreams.class.getPackage())
.addPackages(true, Publisher.class.getPackage())
// For some reason, Thorntail automatically creates a bean for this, and I don't know why.
// When I tried to add another application scoped bean that @Produces this, it failed with
// an ambiguous dependency because both that, and the one that Thorntail automatically
// created, existed. I have no idea how that's happening.
.addPackages(true, ReactiveStreamsEngineImpl.class.getPackage());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.microprofile.reactive.streams.zerodep.cdi;

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

/**
* Arquillian extension to register the archive appender.
*/
public class ZeroDepExtension implements LoadableExtension {
@Override
public void register(ExtensionBuilder extensionBuilder) {
extensionBuilder.service(AuxiliaryArchiveAppender.class, ZeroDepArchiveAppender.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#
# Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
#
com.lightbend.microprofile.reactive.streams.zerodep.cdi.ZeroDepExtension

0 comments on commit 44a9822

Please sign in to comment.