diff --git a/bin/buildDeps.sh b/bin/buildDeps.sh index 34f69ce..35d0fb7 100755 --- a/bin/buildDeps.sh +++ b/bin/buildDeps.sh @@ -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 diff --git a/pom.xml b/pom.xml index 5d4c06e..1ae0b31 100644 --- a/pom.xml +++ b/pom.xml @@ -62,6 +62,7 @@ akka zerodep + zerodep-cdi @@ -76,6 +77,11 @@ microprofile-reactive-streams-operators-tck ${microprofile.reactive.streams.version} + + org.eclipse.microprofile.reactive.streams + microprofile-reactive-streams-operators-tck-arquillian + ${microprofile.reactive.streams.version} + com.typesafe.akka akka-actor_2.12 diff --git a/zerodep-cdi/pom.xml b/zerodep-cdi/pom.xml new file mode 100644 index 0000000..23685ff --- /dev/null +++ b/zerodep-cdi/pom.xml @@ -0,0 +1,99 @@ + + + + + 4.0.0 + + + com.lightbend.microprofile.reactive.streams + lightbend-microprofile-reactive-streams-parent + 1.0-SNAPSHOT + + + lightbend-microprofile-reactive-streams-zerodep-cdi + Lightbend MicroProfile Reactive Streams Operators Zero Dependency CDI + Lightbend MicroProfile Reactive Streams Operators :: Zero Dependency CDI Integration + + + ${project.groupId} + lightbend-microprofile-reactive-streams-zerodep + ${project.version} + + + javax.enterprise + cdi-api + + + org.eclipse.microprofile.reactive.streams + microprofile-reactive-streams-operators-tck-arquillian + test + + + io.thorntail + arquillian + + + org.jboss.arquillian.junit + arquillian-junit-container + + + test + + + + + + + javax.enterprise + cdi-api + 2.0 + + + org.jboss.arquillian + arquillian-bom + 1.1.15.Final + import + pom + + + io.thorntail + bom + 2.0.0.Final + import + pom + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + + \ No newline at end of file diff --git a/zerodep-cdi/src/test/java/com/lightbend/microprofile/reactive/streams/zerodep/cdi/ReactiveStreamsArquillianTckTest.java b/zerodep-cdi/src/test/java/com/lightbend/microprofile/reactive/streams/zerodep/cdi/ReactiveStreamsArquillianTckTest.java new file mode 100644 index 0000000..9c1b487 --- /dev/null +++ b/zerodep-cdi/src/test/java/com/lightbend/microprofile/reactive/streams/zerodep/cdi/ReactiveStreamsArquillianTckTest.java @@ -0,0 +1,13 @@ +/* + * Copyright (C) 2018 Lightbend Inc. + */ +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 { +} diff --git a/zerodep-cdi/src/test/java/com/lightbend/microprofile/reactive/streams/zerodep/cdi/ZeroDepArchiveAppender.java b/zerodep-cdi/src/test/java/com/lightbend/microprofile/reactive/streams/zerodep/cdi/ZeroDepArchiveAppender.java new file mode 100644 index 0000000..9b76e91 --- /dev/null +++ b/zerodep-cdi/src/test/java/com/lightbend/microprofile/reactive/streams/zerodep/cdi/ZeroDepArchiveAppender.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2018 Lightbend Inc. + */ +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()); + } +} diff --git a/zerodep-cdi/src/test/java/com/lightbend/microprofile/reactive/streams/zerodep/cdi/ZeroDepExtension.java b/zerodep-cdi/src/test/java/com/lightbend/microprofile/reactive/streams/zerodep/cdi/ZeroDepExtension.java new file mode 100644 index 0000000..4d44abe --- /dev/null +++ b/zerodep-cdi/src/test/java/com/lightbend/microprofile/reactive/streams/zerodep/cdi/ZeroDepExtension.java @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2018 Lightbend Inc. + */ +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); + } +} diff --git a/zerodep-cdi/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/zerodep-cdi/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension new file mode 100644 index 0000000..5f347a4 --- /dev/null +++ b/zerodep-cdi/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension @@ -0,0 +1,4 @@ +# +# Copyright (C) 2018 Lightbend Inc. +# +com.lightbend.microprofile.reactive.streams.zerodep.cdi.ZeroDepExtension \ No newline at end of file