Repository: eclipse/microprofile-open-api
Pull request #54 (2017-11-24 17:07:56)

Cleaned up tck's pom.xml + Fixed compile issue in ModelConstructionTest + Added readme for TCK
- Cleaned up tck's pom.xml: Removed container related dependencies, modified artifactId, removed unused dependencies, fixed indentation issues
- ModelConstructionTest: Fixed compile issue, fixed formatting issue
- Added readme for TCK: added an empty readme file


Patch:
diff --git a/tck/pom.xml b/tck/pom.xml
index 970e890..442e1d4 100644
--- a/tck/pom.xml
+++ b/tck/pom.xml
@@ -14,7 +14,7 @@
     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/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
+    <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <!-- This is just for now and will not work if the API has a separate release cycle than the rest. -->
@@ -23,21 +23,22 @@
         <version>1.0-SNAPSHOT</version>
     </parent>
 
-	<artifactId>microprofile-openapi-api-tck</artifactId>
-	<name>MicroProfile OpenAPI API-TCK</name>
-	<description>MicroProfile OpenAPI API :: TCK</description>
+    <artifactId>microprofile-openapi-tck</artifactId>
+    <name>MicroProfile OpenAPI - TCK</name>
+    <description>MicroProfile OpenAPI :: TCK</description>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.3.2</version>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                </configuration>
+            </plugin>
 
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-compiler-plugin</artifactId>
-				<version>2.3.2</version>
-				<configuration>
-					<source>1.8</source>
-					<target>1.8</target>
-				</configuration>
-			</plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
@@ -50,6 +51,7 @@
                     </execution>
                 </executions>
             </plugin>
+
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-source-plugin</artifactId>
@@ -62,63 +64,40 @@
                     </execution>
                 </executions>
             </plugin>
-			<plugin>
-				<artifactId>maven-surefire-plugin</artifactId>
-				<version>2.17</version>
-			</plugin>
-		</plugins>
-	</build>
-	<dependencyManagement>
-		<dependencies>
-			<dependency>
-				<groupId>org.jboss.arquillian</groupId>
-				<artifactId>arquillian-bom</artifactId>
-				<version>1.1.8.Final</version>
-				<scope>import</scope>
-				<type>pom</type>
-			</dependency>
-		</dependencies>
-	</dependencyManagement>
+        </plugins>
+    </build>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.jboss.arquillian</groupId>
+                <artifactId>arquillian-bom</artifactId>
+                <version>1.1.8.Final</version>
+                <scope>import</scope>
+                <type>pom</type>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
 
-	<dependencies>
-		<!-- mp-openapi dependencies: -->
+    <dependencies>
         <dependency>
             <groupId>org.eclipse.microprofile.openapi</groupId>
             <artifactId>microprofile-openapi-api</artifactId>
             <version>1.0-SNAPSHOT</version>
             <scope>provided</scope>
         </dependency>
+
         <dependency>
-            <groupId>javax.enterprise</groupId>
-            <artifactId>cdi-api</artifactId>
-            <version>1.2</version>
-            <scope>provided</scope>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.12</version>
+            <scope>compile</scope>
         </dependency>
+
         <dependency>
-            <groupId>org.hamcrest</groupId>
-            <artifactId>hamcrest-integration</artifactId>
-            <version>1.2.1</version>
+            <groupId>org.jboss.arquillian.junit</groupId>
+            <artifactId>arquillian-junit-container</artifactId>
+            <scope>compile</scope>
         </dependency>
-
-		<!-- Arquillian dependencies  -->
-		<dependency>
-			<groupId>junit</groupId>
-			<artifactId>junit</artifactId>
-			<version>4.12</version>
-			<scope>compile</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.jboss.arquillian.junit</groupId>
-			<artifactId>arquillian-junit-container</artifactId>
-			<scope>compile</scope>
-		</dependency>
-
-		<!-- Container adapters: -->
-		<dependency>
-			<groupId>org.jboss.arquillian.container</groupId>
-			<artifactId>arquillian-wlp-managed-8.5</artifactId>
-			<version>1.0.0.Beta2</version>
-		</dependency>
-
-	</dependencies>
+    </dependencies>
 </project>
diff --git a/tck/running_the_tck.asciidoc b/tck/running_the_tck.asciidoc
new file mode 100644
index 0000000..772383d
--- /dev/null
+++ b/tck/running_the_tck.asciidoc
@@ -0,0 +1,19 @@
+//
+// Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+//
+// Licensed 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.
+//
+
+= Running the Microprofile OpenAPI TCK
+
+Any Microprofile 1.3 and higher release must pass this test suite.
\ No newline at end of file


Test patch:
diff --git a/tck/src/main/java/org/eclipse/microprofile/openapi/tck/ModelConstructionTest.java b/tck/src/main/java/org/eclipse/microprofile/openapi/tck/ModelConstructionTest.java
index 99a4125..aa771e1 100644
--- a/tck/src/main/java/org/eclipse/microprofile/openapi/tck/ModelConstructionTest.java
+++ b/tck/src/main/java/org/eclipse/microprofile/openapi/tck/ModelConstructionTest.java
@@ -72,8 +72,8 @@ import org.eclipse.microprofile.openapi.models.parameters.Parameter;
 import org.eclipse.microprofile.openapi.models.parameters.PathParameter;
 import org.eclipse.microprofile.openapi.models.parameters.QueryParameter;
 import org.eclipse.microprofile.openapi.models.parameters.RequestBody;
-import org.eclipse.microprofile.openapi.models.responses.ApiResponse;
-import org.eclipse.microprofile.openapi.models.responses.ApiResponses;
+import org.eclipse.microprofile.openapi.models.responses.APIResponse;
+import org.eclipse.microprofile.openapi.models.responses.APIResponses;
 import org.eclipse.microprofile.openapi.models.security.OAuthFlow;
 import org.eclipse.microprofile.openapi.models.security.OAuthFlows;
 import org.eclipse.microprofile.openapi.models.security.Scopes;
@@ -132,7 +132,8 @@ public class ModelConstructionTest {
         public Object invokeGetter(Object target) {
             try {
                 return getter.invoke(target);
-            } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+            }
+            catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
                 Assert.fail("Invocation of getter method \"" + getter.getName() + "\" failed: " + e.getMessage());
                 throw new RuntimeException(e);
             }
@@ -140,7 +141,8 @@ public class ModelConstructionTest {
         public void invokeSetter(Object target, Object value) {
             try {
                 setter.invoke(target, value);
-            } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+            }
+            catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
                 Assert.fail("Invocation of setter method \"" + setter.getName() + "\" failed: " + e.getMessage());
                 throw new RuntimeException(e);
             }
@@ -148,7 +150,8 @@ public class ModelConstructionTest {
         public Object invokeBuilder(Object target, Object value) {
             try {
                 return builder.invoke(target, value);
-            } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+            }
+            catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
                 Assert.fail("Invocation of builder method \"" + builder.getName() + "\" failed: " + e.getMessage());
                 throw new RuntimeException(e);
             }
@@ -361,12 +364,12 @@ public class ModelConstructionTest {
     
     @Test
     public void apiResponseTest() {
-        processConstructible(ApiResponse.class);
+        processConstructible(APIResponse.class);
     }
     
     @Test
     public void apiResponsesTest() {
-        processConstructible(ApiResponses.class);
+        processConstructible(APIResponses.class);
     }
     
     @Test
@@ -453,8 +456,10 @@ public class ModelConstructionTest {
         Assert.assertEquals("The extensions map is expected to contain two entries.", 2, map.size());
         Assert.assertTrue("The extensions map is expected to contain the key: " + extensionName1, map.containsKey(extensionName1));
         Assert.assertTrue("The extensions map is expected to contain the key: " + extensionName2, map.containsKey(extensionName2));
-        Assert.assertSame("The value associated with the key: " + extensionName1 + " is expected to be the same one that was added.", obj1, map.get(extensionName1));
-        Assert.assertSame("The value associated with the key: " + extensionName2 + " is expected to be the same one that was added.", obj2, map.get(extensionName2));
+        Assert.assertSame("The value associated with the key: " + extensionName1 + " is expected to be the same one that was added.",
+                obj1, map.get(extensionName1));
+        Assert.assertSame("The value associated with the key: " + extensionName2 + " is expected to be the same one that was added.",
+                obj2, map.get(extensionName2));
         // Check that the extension map can be replaced with the setter and that it is returned by the getter.
         final Map<String, Object> newMap = new HashMap<>();
         e.setExtensions(newMap);
@@ -569,7 +574,7 @@ public class ModelConstructionTest {
     
     private String createReference(Reference<?> r, String v) {
         final StringBuilder sb = new StringBuilder();
-        if (r instanceof ApiResponse) {
+        if (r instanceof APIResponse) {
             sb.append("#/components/responses/");
         }
         else if (r instanceof Callback) {