You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jo...@apache.org on 2017/09/14 02:28:22 UTC
geronimo-safeguard git commit: GERONIMO-6582 - Adding initial TCK
test suite.
Repository: geronimo-safeguard
Updated Branches:
refs/heads/master 7c93e2983 -> 315543e9d
GERONIMO-6582 - Adding initial TCK test suite.
Project: http://git-wip-us.apache.org/repos/asf/geronimo-safeguard/repo
Commit: http://git-wip-us.apache.org/repos/asf/geronimo-safeguard/commit/315543e9
Tree: http://git-wip-us.apache.org/repos/asf/geronimo-safeguard/tree/315543e9
Diff: http://git-wip-us.apache.org/repos/asf/geronimo-safeguard/diff/315543e9
Branch: refs/heads/master
Commit: 315543e9d32d42699665b0e82a0a605aac85ad33
Parents: 7c93e29
Author: John D. Ament <jo...@apache.org>
Authored: Wed Sep 13 22:28:13 2017 -0400
Committer: John D. Ament <jo...@apache.org>
Committed: Wed Sep 13 22:28:13 2017 -0400
----------------------------------------------------------------------
pom.xml | 47 +++++++++++++++++++-
safeguard-impl/pom.xml | 39 ----------------
.../impl/cdi/SafeguardInterceptor.java | 2 +
.../javax.enterprise.inject.spi.Extension | 19 ++++++++
safeguard-tck-tests/pom.xml | 45 ++++++++++++++++++-
.../safeguard/ft/tck/ArchiveAppender.java | 47 ++++++++++++++++++++
.../safeguard/ft/tck/SafeguardTCKExtension.java | 30 +++++++++++++
....jboss.arquillian.core.spi.LoadableExtension | 20 +++++++++
8 files changed, 207 insertions(+), 42 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/geronimo-safeguard/blob/315543e9/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f42c820..2f1468d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,7 +53,7 @@
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
- <microprofile-fault-tolerance.version>1.1-SNAPSHOT</microprofile-fault-tolerance.version>
+ <microprofile-fault-tolerance.version>1.0-SNAPSHOT</microprofile-fault-tolerance.version>
<owb.version>2.0.1</owb.version>
<arquillian.version>1.1.13.Final</arquillian.version>
<arquillian-weld-embedded.version>2.0.0.Beta5</arquillian-weld-embedded.version>
@@ -94,7 +94,13 @@
<dependency>
<groupId>org.eclipse.microprofile.fault-tolerance</groupId>
<artifactId>microprofile-fault-tolerance-api</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>${microprofile-fault-tolerance.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.microprofile.fault-tolerance</groupId>
+ <artifactId>microprofile-fault-tolerance-tck</artifactId>
+ <version>${microprofile-fault-tolerance.version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
@@ -177,5 +183,42 @@
</repository>
</repositories>
</profile>
+ <profile>
+ <id>OWB2</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-el_2.2_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans.arquillian</groupId>
+ <artifactId>owb-arquillian-standalone</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>Weld3</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.weld.se</groupId>
+ <artifactId>weld-se-shaded</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-weld-embedded</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
</profiles>
</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/geronimo-safeguard/blob/315543e9/safeguard-impl/pom.xml
----------------------------------------------------------------------
diff --git a/safeguard-impl/pom.xml b/safeguard-impl/pom.xml
index 4f5f200..ddeb37d 100644
--- a/safeguard-impl/pom.xml
+++ b/safeguard-impl/pom.xml
@@ -68,43 +68,4 @@
<artifactId>assertj-core</artifactId>
</dependency>
</dependencies>
- <profiles>
- <profile>
- <id>OWB2</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-el_2.2_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.openwebbeans</groupId>
- <artifactId>openwebbeans-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.openwebbeans</groupId>
- <artifactId>openwebbeans-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.openwebbeans.arquillian</groupId>
- <artifactId>owb-arquillian-standalone</artifactId>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>Weld3</id>
- <dependencies>
- <dependency>
- <groupId>org.jboss.weld.se</groupId>
- <artifactId>weld-se-shaded</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.arquillian.container</groupId>
- <artifactId>arquillian-weld-embedded</artifactId>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/geronimo-safeguard/blob/315543e9/safeguard-impl/src/main/java/org/apache/safeguard/impl/cdi/SafeguardInterceptor.java
----------------------------------------------------------------------
diff --git a/safeguard-impl/src/main/java/org/apache/safeguard/impl/cdi/SafeguardInterceptor.java b/safeguard-impl/src/main/java/org/apache/safeguard/impl/cdi/SafeguardInterceptor.java
index 0a785a2..00d98bf 100644
--- a/safeguard-impl/src/main/java/org/apache/safeguard/impl/cdi/SafeguardInterceptor.java
+++ b/safeguard-impl/src/main/java/org/apache/safeguard/impl/cdi/SafeguardInterceptor.java
@@ -26,6 +26,7 @@ import org.eclipse.microprofile.faulttolerance.CircuitBreaker;
import org.eclipse.microprofile.faulttolerance.Retry;
import javax.annotation.Priority;
+import javax.enterprise.context.Dependent;
import javax.inject.Inject;
import javax.interceptor.AroundInvoke;
import javax.interceptor.Interceptor;
@@ -35,6 +36,7 @@ import java.lang.reflect.Method;
@Interceptor
@SafeguardEnabled
@Priority(400)
+@Dependent
public class SafeguardInterceptor {
@Inject
private FailsafeExecutionManager failsafeExecutionManager;
http://git-wip-us.apache.org/repos/asf/geronimo-safeguard/blob/315543e9/safeguard-impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
----------------------------------------------------------------------
diff --git a/safeguard-impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/safeguard-impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
index 0eae66c..f938390 100644
--- a/safeguard-impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
+++ b/safeguard-impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
@@ -1 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
org.apache.safeguard.impl.cdi.SafeguardExtension
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/geronimo-safeguard/blob/315543e9/safeguard-tck-tests/pom.xml
----------------------------------------------------------------------
diff --git a/safeguard-tck-tests/pom.xml b/safeguard-tck-tests/pom.xml
index 422f238..d859603 100644
--- a/safeguard-tck-tests/pom.xml
+++ b/safeguard-tck-tests/pom.xml
@@ -30,5 +30,48 @@
<artifactId>safeguard-tck-tests</artifactId>
-
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.microprofile.fault-tolerance</groupId>
+ <artifactId>microprofile-fault-tolerance-tck</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.safeguard</groupId>
+ <artifactId>safeguard-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jcdi_2.0_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-atinject_1.0_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-annotation_1.3_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-interceptor_1.2_spec</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.20</version>
+ <configuration>
+ <dependenciesToScan>
+ <dependency>org.eclipse.microprofile.fault-tolerance:microprofile-fault-tolerance-tck</dependency>
+ </dependenciesToScan>
+ <includes>
+ <include>org.eclipse.microprofile.fault.tolerance.tck.RetryTest</include>
+ <include>org.eclipse.microprofile.fault.tolerance.tck.RetryConditionTest</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/geronimo-safeguard/blob/315543e9/safeguard-tck-tests/src/test/java/org/apache/safeguard/ft/tck/ArchiveAppender.java
----------------------------------------------------------------------
diff --git a/safeguard-tck-tests/src/test/java/org/apache/safeguard/ft/tck/ArchiveAppender.java b/safeguard-tck-tests/src/test/java/org/apache/safeguard/ft/tck/ArchiveAppender.java
new file mode 100644
index 0000000..afbd1dd
--- /dev/null
+++ b/safeguard-tck-tests/src/test/java/org/apache/safeguard/ft/tck/ArchiveAppender.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.safeguard.ft.tck;
+
+import org.apache.safeguard.api.SafeguardEnabled;
+import org.apache.safeguard.impl.cdi.FailsafeExecutionManagerProvider;
+import org.apache.safeguard.impl.cdi.SafeguardExtension;
+import org.apache.safeguard.impl.cdi.SafeguardInterceptor;
+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.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+import javax.enterprise.inject.spi.Extension;
+
+public class ArchiveAppender implements ApplicationArchiveProcessor {
+ private static final StringAsset BEANS_XML = new StringAsset("<beans version=\"1.1\" bean-discovery-mode=\"annotated\"/>");
+
+ @Override
+ public void process(Archive<?> archive, TestClass testClass) {
+ JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "safeguard.jar")
+ .addClasses(SafeguardEnabled.class, SafeguardExtension.class, FailsafeExecutionManagerProvider.class, SafeguardInterceptor.class)
+ .addAsServiceProvider(Extension.class, SafeguardExtension.class)
+ .addAsManifestResource(BEANS_XML, "beans.xml");
+ archive.as(WebArchive.class).addAsLibrary(jar);
+ }
+}
http://git-wip-us.apache.org/repos/asf/geronimo-safeguard/blob/315543e9/safeguard-tck-tests/src/test/java/org/apache/safeguard/ft/tck/SafeguardTCKExtension.java
----------------------------------------------------------------------
diff --git a/safeguard-tck-tests/src/test/java/org/apache/safeguard/ft/tck/SafeguardTCKExtension.java b/safeguard-tck-tests/src/test/java/org/apache/safeguard/ft/tck/SafeguardTCKExtension.java
new file mode 100644
index 0000000..6d57660
--- /dev/null
+++ b/safeguard-tck-tests/src/test/java/org/apache/safeguard/ft/tck/SafeguardTCKExtension.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.safeguard.ft.tck;
+
+import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
+import org.jboss.arquillian.core.spi.LoadableExtension;
+
+public class SafeguardTCKExtension implements LoadableExtension {
+ @Override
+ public void register(ExtensionBuilder extensionBuilder) {
+ extensionBuilder.service(ApplicationArchiveProcessor.class, ArchiveAppender.class);
+ }
+}
http://git-wip-us.apache.org/repos/asf/geronimo-safeguard/blob/315543e9/safeguard-tck-tests/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension
----------------------------------------------------------------------
diff --git a/safeguard-tck-tests/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/safeguard-tck-tests/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension
new file mode 100644
index 0000000..65b7838
--- /dev/null
+++ b/safeguard-tck-tests/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension
@@ -0,0 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+org.apache.safeguard.ft.tck.SafeguardTCKExtension
\ No newline at end of file