Skip to content

Commit 60f67ef

Browse files
committed
Merge remote-tracking branch 'origin/master' into to-graph
2 parents faa2dde + fbe15bc commit 60f67ef

21 files changed

+1839
-0
lines changed

messaging/pom.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090

9191
<modules>
9292
<module>api</module>
93+
<module>tck</module>
9394
<module>spec</module>
9495
</modules>
9596

@@ -104,6 +105,29 @@
104105
<groupId>org.osgi</groupId>
105106
<artifactId>org.osgi.annotation.versioning</artifactId>
106107
<version>1.0.0</version>
108+
<scope>provided</scope>
109+
</dependency>
110+
<dependency>
111+
<groupId>org.reactivestreams</groupId>
112+
<artifactId>reactive-streams-tck</artifactId>
113+
<version>1.0.2</version>
114+
</dependency>
115+
<dependency>
116+
<groupId>javax.enterprise</groupId>
117+
<artifactId>cdi-api</artifactId>
118+
<version>2.0</version>
119+
</dependency>
120+
<dependency>
121+
<groupId>javax.json.bind</groupId>
122+
<artifactId>javax.json.bind-api</artifactId>
123+
<version>1.0</version>
124+
</dependency>
125+
<dependency>
126+
<groupId>org.jboss.arquillian</groupId>
127+
<artifactId>arquillian-bom</artifactId>
128+
<version>1.4.0.Final</version>
129+
<scope>import</scope>
130+
<type>pom</type>
107131
</dependency>
108132
</dependencies>
109133
</dependencyManagement>

messaging/tck/README.adoc

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//
2+
// Copyright (c) 2018 Contributors to the Eclipse Foundation
3+
//
4+
// See the NOTICE file(s) distributed with this work for additional
5+
// information regarding copyright ownership.
6+
//
7+
// Licensed under the Apache License, Version 2.0 (the "License");
8+
// you may not use this file except in compliance with the License.
9+
// You may obtain a copy of the License at
10+
//
11+
// http://www.apache.org/licenses/LICENSE-2.0
12+
//
13+
// Unless required by applicable law or agreed to in writing, software
14+
// distributed under the License is distributed on an "AS IS" BASIS,
15+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
// See the License for the specific language governing permissions and
17+
// limitations under the License.
18+
//
19+
20+
= MicroProfile Reactive Messaging TCK
21+
22+
This project contains the TCK for MicroProfile Reactive Messaging.
23+
24+
== Running the TCK against an implementation
25+
26+
The TCK uses http://arquillian.org/[Arquillian], so an implementation needs Arquillian container support to run. In addition, the implementation must also implement the TCK's SPI in order to allow the TCK to interact and make assertions on messages sent and received from topics under test.
27+
28+
=== `TckContainer`
29+
30+
The primary entry point into the tck is the `org.eclipse.microprofile.reactive.messaging.tck.spi.TckContainer`. An instance of this must be provided through the JDK `ServiceLoader` mechanism (that is, provide a `META-INF/services/org.eclipse.microprofile.reactive.messaging.tck.spi.TckContainer` file that contains the fully qualified classname of the implementation).
31+
32+
This class provides a number of methods for telling the TCK which parts of the spec this implementation implements, for example, an implementation does not have to provide support for both incoming and outgoing messages, so this can be used to configure which ones it does support. Additionally, it allows the TCK to instruct the container to deploy and prepare topics for being published to and subscribed from.
33+
34+
=== `org.eclipse.microprofile.reactive.messaging.tck.spi.TestEnvironment`
35+
36+
The `TestEnvironment` provides a mechanism for general environment configuration, such as what timeouts to use for various assertions.
37+
38+
=== `TckMessagingPuppet`
39+
40+
The `org.eclipse.microprofile.reactive.messaging.tck.spi.TckMessagingPuppet` is for use in the container. It is the responsiblity of the `TckContainer` to return a deployment from its `createDeployments` method that provides a `TckMessagingPuppet` that can be injected into the tests and beans under test. This is used to trigger the container to send a message to certain queues, and receive messages from queues.
41+
42+
== TCK design
43+
44+
In general, each test class defines a single bean that it returns in a deployment. This bean will generally have one `@Incoming` or `@Outgoing` annotated method per test method, each working with a unique topic name. This ensures isolation between tests. The test class defines an `@Topics` annotation that allows the TCK to discover which topics the test uses, it then passes this list of topics to the SPI implementation to instruct it to create and/or reset the topics before each class is run.
45+
46+
In each test method, `MockedSender` and `MockedReceiver` are used to register the receipt of individual messages, or to create publishers and subscribers to be returned by the method. These then capture messages received, and enqueue messages to be sent, so that the test cases can work with them. A `TckMessagingManager` holds a map of topics to `MockedSender` and `MockedReceiver` instances, so that both the bean and the tests can access them easily.

messaging/tck/pom.xml

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
~ Copyright (c) 2018 Contributors to the Eclipse Foundation
4+
~
5+
~ See the NOTICE file(s) distributed with this work for additional
6+
~ information regarding copyright ownership.
7+
~
8+
~ Licensed under the Apache License, Version 2.0 (the "License");
9+
~ You may not use this file except in compliance with the License.
10+
~ You may obtain a copy of the License at
11+
~
12+
~ http://www.apache.org/licenses/LICENSE-2.0
13+
~
14+
~ Unless required by applicable law or agreed to in writing, software
15+
~ distributed under the License is distributed on an "AS IS" BASIS,
16+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
~ See the License for the specific language governing permissions and
18+
~ limitations under the License.
19+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
20+
21+
<!--
22+
Licensed under the Apache License, Version 2.0 (the
23+
"License"); you may not use this file except in compliance
24+
with the License. You may obtain a copy of the License at
25+
26+
http://www.apache.org/licenses/LICENSE-2.0
27+
28+
Unless required by applicable law or agreed to in writing,
29+
software distributed under the License is distributed on an
30+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
31+
KIND, either express or implied. See the License for the
32+
specific language governing permissions and limitations
33+
under the License.
34+
-->
35+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
36+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
37+
<modelVersion>4.0.0</modelVersion>
38+
39+
<parent>
40+
<groupId>org.eclipse.microprofile.reactive.messaging</groupId>
41+
<artifactId>microprofile-reactive-messaging-parent</artifactId>
42+
<version>1.0-SNAPSHOT</version>
43+
</parent>
44+
45+
<groupId>org.eclipse.microprofile.reactive.messaging</groupId>
46+
<artifactId>microprofile-reactive-messaging-tck</artifactId>
47+
<name>MicroProfile Reactive Messaging TCK</name>
48+
<description>MicroProfile Reactive Messaging :: TCK</description>
49+
50+
<properties>
51+
<checkstyle.methodNameFormat>^_?[a-z][a-zA-Z0-9_]*$</checkstyle.methodNameFormat>
52+
</properties>
53+
54+
<dependencies>
55+
<dependency>
56+
<groupId>org.eclipse.microprofile.reactive.messaging</groupId>
57+
<artifactId>microprofile-reactive-messaging-api</artifactId>
58+
<version>${project.version}</version>
59+
</dependency>
60+
<dependency>
61+
<groupId>org.reactivestreams</groupId>
62+
<artifactId>reactive-streams-tck</artifactId>
63+
</dependency>
64+
<dependency>
65+
<groupId>javax.enterprise</groupId>
66+
<artifactId>cdi-api</artifactId>
67+
</dependency>
68+
<dependency>
69+
<groupId>javax.json.bind</groupId>
70+
<artifactId>javax.json.bind-api</artifactId>
71+
</dependency>
72+
<dependency>
73+
<groupId>org.jboss.arquillian.testng</groupId>
74+
<artifactId>arquillian-testng-container</artifactId>
75+
</dependency>
76+
</dependencies>
77+
78+
<build>
79+
<plugins>
80+
<plugin>
81+
<groupId>org.apache.maven.plugins</groupId>
82+
<artifactId>maven-javadoc-plugin</artifactId>
83+
<executions>
84+
<execution>
85+
<id>attach-javadocs</id>
86+
<goals>
87+
<goal>jar</goal>
88+
</goals>
89+
</execution>
90+
</executions>
91+
</plugin>
92+
<plugin>
93+
<groupId>org.apache.maven.plugins</groupId>
94+
<artifactId>maven-source-plugin</artifactId>
95+
<executions>
96+
<execution>
97+
<id>attach-sources</id>
98+
<goals>
99+
<goal>jar</goal>
100+
</goals>
101+
</execution>
102+
</executions>
103+
</plugin>
104+
</plugins>
105+
</build>
106+
107+
<profiles>
108+
<profile>
109+
<id>eclipse-jarsigner</id>
110+
<build>
111+
<plugins>
112+
<plugin>
113+
<groupId>org.eclipse.cbi.maven.plugins</groupId>
114+
<artifactId>eclipse-jarsigner-plugin</artifactId>
115+
<executions>
116+
<execution>
117+
<goals>
118+
<goal>sign</goal>
119+
</goals>
120+
</execution>
121+
</executions>
122+
</plugin>
123+
</plugins>
124+
</build>
125+
</profile>
126+
<profile>
127+
<id>run-tests</id>
128+
<build>
129+
<plugins>
130+
<plugin>
131+
<groupId>org.apache.maven.plugins</groupId>
132+
<artifactId>maven-surefire-plugin</artifactId>
133+
<version>2.20</version>
134+
<configuration>
135+
<testClassesDirectory>${project.build.outputDirectory}</testClassesDirectory>
136+
<testSourceDirectory>${project.build.sourceDirectory}</testSourceDirectory>
137+
<includes>
138+
<include>**/ReactiveMessagingTck.java</include>
139+
</includes>
140+
</configuration>
141+
</plugin>
142+
</plugins>
143+
</build>
144+
</profile>
145+
<profile>
146+
<id>lightbend-kafka</id>
147+
<dependencies>
148+
<dependency>
149+
<groupId>com.lightbend.microprofile.reactive.messaging</groupId>
150+
<artifactId>lightbend-microprofile-reactive-messaging-kafka-tck</artifactId>
151+
<version>1.0-SNAPSHOT</version>
152+
<scope>test</scope>
153+
</dependency>
154+
</dependencies>
155+
<dependencyManagement>
156+
<dependencies>
157+
<dependency>
158+
<groupId>com.typesafe.akka</groupId>
159+
<artifactId>akka-actor_2.12</artifactId>
160+
<version>${akka.version}</version>
161+
</dependency>
162+
<dependency>
163+
<groupId>com.typesafe.akka</groupId>
164+
<artifactId>akka-stream_2.12</artifactId>
165+
<version>${akka.version}</version>
166+
</dependency>
167+
</dependencies>
168+
</dependencyManagement>
169+
<properties>
170+
<akka.version>2.5.13</akka.version>
171+
</properties>
172+
</profile>
173+
</profiles>
174+
175+
</project>

0 commit comments

Comments
 (0)