You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jg...@apache.org on 2018/08/15 15:42:10 UTC

[19/26] tomee git commit: Added MP Rest Client.

Added MP Rest Client.


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/474b9596
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/474b9596
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/474b9596

Branch: refs/heads/master
Commit: 474b9596314df5cb02e851d89229102892c94b51
Parents: b24bf91
Author: Roberto Cortez <ra...@yahoo.com>
Authored: Thu Aug 2 20:17:28 2018 +0100
Committer: Roberto Cortez <ra...@yahoo.com>
Committed: Mon Aug 13 16:36:35 2018 +0100

----------------------------------------------------------------------
 pom.xml                                         |   2 +
 tck/microprofile-tck/pom.xml                    |   1 +
 tck/microprofile-tck/rest-client/pom.xml        | 124 +++++++++++++++++++
 ...croProfileRestClientTCKArchiveProcessor.java |  71 +++++++++++
 .../MicroProfileRestClientTCKExtension.java     |  27 ++++
 ....jboss.arquillian.core.spi.LoadableExtension |   1 +
 .../src/test/resources/arquillian.xml           |  40 ++++++
 tomee/tomee-microprofile-webapp/pom.xml         |  12 ++
 8 files changed, 278 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/474b9596/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e73e12b..8ab5092 100644
--- a/pom.xml
+++ b/pom.xml
@@ -204,6 +204,8 @@
     <microprofile.health.impl.version>1.0.0</microprofile.health.impl.version>
     <microprofile.metrics.version>1.1</microprofile.metrics.version>
     <microprofile.metrics.impl.version>1.0.0</microprofile.metrics.impl.version>
+    <microprofile.rest-client.version>1.0</microprofile.rest-client.version>
+    <microprofile.rest-client.impl.version>${cxf.version}</microprofile.rest-client.impl.version>
   </properties>
 
   <build>

http://git-wip-us.apache.org/repos/asf/tomee/blob/474b9596/tck/microprofile-tck/pom.xml
----------------------------------------------------------------------
diff --git a/tck/microprofile-tck/pom.xml b/tck/microprofile-tck/pom.xml
index 15433c7..412f3ea 100644
--- a/tck/microprofile-tck/pom.xml
+++ b/tck/microprofile-tck/pom.xml
@@ -36,6 +36,7 @@
     <module>fault-tolerance</module>
     <module>health</module>
     <module>metrics</module>
+    <module>rest-client</module>
   </modules>
 
 </project>

http://git-wip-us.apache.org/repos/asf/tomee/blob/474b9596/tck/microprofile-tck/rest-client/pom.xml
----------------------------------------------------------------------
diff --git a/tck/microprofile-tck/rest-client/pom.xml b/tck/microprofile-tck/rest-client/pom.xml
new file mode 100644
index 0000000..91bfb8f
--- /dev/null
+++ b/tck/microprofile-tck/rest-client/pom.xml
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+  -->
+<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/maven-v4_0_0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.tomee</groupId>
+    <artifactId>microprofile-tck</artifactId>
+    <version>8.0.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>microprofile-rest-client-tck</artifactId>
+  <name>OpenEJB :: TCK :: MicroProfile Rest Client TCK</name>
+
+  <build>
+    <plugins>
+
+      <plugin>
+        <groupId>uk.co.deliverymind</groupId>
+        <artifactId>wiremock-maven-plugin</artifactId>
+        <version>2.7.0</version>
+        <executions>
+          <execution>
+            <phase>generate-test-sources</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <dir>target/classes</dir>
+              <params>&#45;&#45;port=8765 &#45;&#45;verbose</params>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.22.0</version>
+        <configuration>
+          <dependenciesToScan>
+            <dependency>org.eclipse.microprofile.rest.client:microprofile-rest-client-tck</dependency>
+          </dependenciesToScan>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.eclipse.microprofile.rest.client</groupId>
+      <artifactId>microprofile-rest-client-api</artifactId>
+      <version>${microprofile.rest-client.version}</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.eclipse.microprofile.rest.client</groupId>
+      <artifactId>microprofile-rest-client-tck</artifactId>
+      <version>${microprofile.rest-client.version}</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>apache-tomee</artifactId>
+      <version>${project.version}</version>
+      <type>zip</type>
+      <classifier>microprofile</classifier>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.testng</groupId>
+      <artifactId>testng</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>com.github.tomakehurst</groupId>
+      <artifactId>wiremock</artifactId>
+      <version>2.10.1</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-rs-mp-client</artifactId>
+      <version>${microprofile.rest-client.impl.version}</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.johnzon</groupId>
+      <artifactId>johnzon-core</artifactId>
+      <version>${johnzon.version}</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>arquillian-tomee-remote</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/tomee/blob/474b9596/tck/microprofile-tck/rest-client/src/test/java/com/apache/openejb/tck/microprofile/rest/client/MicroProfileRestClientTCKArchiveProcessor.java
----------------------------------------------------------------------
diff --git a/tck/microprofile-tck/rest-client/src/test/java/com/apache/openejb/tck/microprofile/rest/client/MicroProfileRestClientTCKArchiveProcessor.java b/tck/microprofile-tck/rest-client/src/test/java/com/apache/openejb/tck/microprofile/rest/client/MicroProfileRestClientTCKArchiveProcessor.java
new file mode 100644
index 0000000..f8692ab
--- /dev/null
+++ b/tck/microprofile-tck/rest-client/src/test/java/com/apache/openejb/tck/microprofile/rest/client/MicroProfileRestClientTCKArchiveProcessor.java
@@ -0,0 +1,71 @@
+/*
+ * 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 com.apache.openejb.tck.microprofile.rest.client;
+
+import org.eclipse.microprofile.rest.client.tck.WiremockArquillianTest;
+import org.eclipse.microprofile.rest.client.tck.interfaces.BaseClient;
+import org.eclipse.microprofile.rest.client.tck.interfaces.ChildClient;
+import org.eclipse.microprofile.rest.client.tck.interfaces.CustomHttpMethod;
+import org.eclipse.microprofile.rest.client.tck.interfaces.InterfaceUsingBeanParam;
+import org.eclipse.microprofile.rest.client.tck.interfaces.MissingPathParam;
+import org.eclipse.microprofile.rest.client.tck.interfaces.MissingPathParamSub;
+import org.eclipse.microprofile.rest.client.tck.interfaces.MissingUriTemplate;
+import org.eclipse.microprofile.rest.client.tck.interfaces.MultipleHTTPMethodAnnotations;
+import org.eclipse.microprofile.rest.client.tck.interfaces.MyBean;
+import org.eclipse.microprofile.rest.client.tck.interfaces.RootResource;
+import org.eclipse.microprofile.rest.client.tck.interfaces.SubResource;
+import org.eclipse.microprofile.rest.client.tck.interfaces.TemplateMismatch;
+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.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+public class MicroProfileRestClientTCKArchiveProcessor implements ApplicationArchiveProcessor {
+    @Override
+    public void process(final Archive<?> archive, final TestClass testClass) {
+        if (archive instanceof WebArchive) {
+            final WebArchive war = WebArchive.class.cast(archive);
+
+            // TODO - this could be fixed in the TCK by adding the missing classes in the test archives
+            JavaArchive restClientJar = ShrinkWrap
+                    .create(JavaArchive.class, "rest-client-tck-additional.jar")
+                    .addClass(WiremockArquillianTest.class)
+                    // missing in BeanParamTest
+                    .addClass(MyBean.class)
+                    .addClass(InterfaceUsingBeanParam.class)
+                    // missing in CustomHttpMethodTest
+                    .addClass(CustomHttpMethod.class)
+                    // missing in InheritanceTest
+                    .addClass(BaseClient.class)
+                    .addClass(ChildClient.class)
+                    // missing in InvalidInterfaceTest
+                    .addClass(MultipleHTTPMethodAnnotations.class)
+                    .addClass(MissingPathParam.class)
+                    .addClass(MissingPathParamSub.class)
+                    .addClass(MissingUriTemplate.class)
+                    .addClass(TemplateMismatch.class)
+                    // missing in SubResourceTest
+                    .addClass(RootResource.class)
+                    .addClass(SubResource.class)
+                    ;
+
+            war.addAsLibraries(restClientJar);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/474b9596/tck/microprofile-tck/rest-client/src/test/java/com/apache/openejb/tck/microprofile/rest/client/MicroProfileRestClientTCKExtension.java
----------------------------------------------------------------------
diff --git a/tck/microprofile-tck/rest-client/src/test/java/com/apache/openejb/tck/microprofile/rest/client/MicroProfileRestClientTCKExtension.java b/tck/microprofile-tck/rest-client/src/test/java/com/apache/openejb/tck/microprofile/rest/client/MicroProfileRestClientTCKExtension.java
new file mode 100644
index 0000000..80bdf39
--- /dev/null
+++ b/tck/microprofile-tck/rest-client/src/test/java/com/apache/openejb/tck/microprofile/rest/client/MicroProfileRestClientTCKExtension.java
@@ -0,0 +1,27 @@
+/*
+ * 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 com.apache.openejb.tck.microprofile.rest.client;
+
+import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
+import org.jboss.arquillian.core.spi.LoadableExtension;
+
+public class MicroProfileRestClientTCKExtension implements LoadableExtension {
+    @Override
+    public void register(final LoadableExtension.ExtensionBuilder extensionBuilder) {
+        extensionBuilder.service(ApplicationArchiveProcessor.class, MicroProfileRestClientTCKArchiveProcessor.class);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/474b9596/tck/microprofile-tck/rest-client/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension
----------------------------------------------------------------------
diff --git a/tck/microprofile-tck/rest-client/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/tck/microprofile-tck/rest-client/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension
new file mode 100644
index 0000000..1af67c7
--- /dev/null
+++ b/tck/microprofile-tck/rest-client/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension
@@ -0,0 +1 @@
+com.apache.openejb.tck.microprofile.rest.client.MicroProfileRestClientTCKExtension

http://git-wip-us.apache.org/repos/asf/tomee/blob/474b9596/tck/microprofile-tck/rest-client/src/test/resources/arquillian.xml
----------------------------------------------------------------------
diff --git a/tck/microprofile-tck/rest-client/src/test/resources/arquillian.xml b/tck/microprofile-tck/rest-client/src/test/resources/arquillian.xml
new file mode 100644
index 0000000..2791939
--- /dev/null
+++ b/tck/microprofile-tck/rest-client/src/test/resources/arquillian.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+    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.
+-->
+<arquillian xmlns="http://jboss.org/schema/arquillian"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="
+              http://jboss.org/schema/arquillian
+              http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+  <container qualifier="tomee-remote" default="true">
+    <configuration>
+      <property name="debug">false</property>
+      <property name="httpPort">-1</property>
+      <property name="ajpPort">-1</property>
+      <property name="stopPort">-1</property>
+      <property name="classifier">microprofile</property>
+      <property name="conf">src/test/conf</property>
+      <property name="dir">target/tomee</property>
+      <property name="appWorkingDir">target/workdir</property>
+      <property name="cleanOnStartUp">true</property>
+      <property name="additionalLibs">
+        mvn:com.github.tomakehurst:wiremock-standalone:2.10.1
+      </property>
+    </configuration>
+  </container>
+</arquillian>

http://git-wip-us.apache.org/repos/asf/tomee/blob/474b9596/tomee/tomee-microprofile-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/tomee/tomee-microprofile-webapp/pom.xml b/tomee/tomee-microprofile-webapp/pom.xml
index dfe1d2f..972fd69 100644
--- a/tomee/tomee-microprofile-webapp/pom.xml
+++ b/tomee/tomee-microprofile-webapp/pom.xml
@@ -101,6 +101,18 @@
       <artifactId>geronimo-metrics</artifactId>
       <version>${microprofile.metrics.impl.version}</version>
     </dependency>
+
+    <dependency>
+      <groupId>org.eclipse.microprofile.rest.client</groupId>
+      <artifactId>microprofile-rest-client-api</artifactId>
+      <version>${microprofile.rest-client.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-rs-mp-client</artifactId>
+      <version>${microprofile.rest-client.impl.version}</version>
+    </dependency>
   </dependencies>
 
   <build>