cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6446] Adding a test for JavaDocs built with Java 8
Date Thu, 11 Jun 2015 15:33:26 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 4180bb26a -> a7f8a6325


[CXF-6446] Adding a test for JavaDocs built with Java 8


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

Branch: refs/heads/master
Commit: a7f8a632563ae8768a0b93359219c0760098509b
Parents: 4180bb2
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Thu Jun 11 16:33:11 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Thu Jun 11 16:33:11 2015 +0100

----------------------------------------------------------------------
 .../cxf/jaxrs/model/wadl/JavaDocProvider.java       |  12 ++++++++----
 .../cxf/jaxrs/model/wadl/JavaDocProviderTest.java   |  15 ++++++++-------
 .../test/resources/javadocs/pet-store-javadoc18.jar | Bin 0 -> 4046 bytes
 3 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/a7f8a632/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/JavaDocProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/JavaDocProvider.java
b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/JavaDocProvider.java
index e411459..bcfd5be 100644
--- a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/JavaDocProvider.java
+++ b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/JavaDocProvider.java
@@ -189,8 +189,10 @@ public class JavaDocProvider implements DocumentationProvider {
                 if (endOfOpSigIndex == startOfOpSigIndex && paramLen == 0) {
                     break;
                 } else if (endOfOpSigIndex > startOfOpSigIndex + 1) {
+                    
                     String[] opBits = 
-                        classDoc.getClassDoc().substring(operMarkerIndex, endOfOpSigIndex).split(",");
+                        classDoc.getClassDoc().substring(operMarkerIndex, endOfOpSigIndex)
+                            .split(getOperationParamSeparator());
                     if (opBits.length == paramLen) {
                         break;
                     }
@@ -296,12 +298,14 @@ public class JavaDocProvider implements DocumentationProvider {
     }
     
     protected String getOperationMarkerOpen() {
-        return javaDocsBuiltByVersion == JAVA_VERSION_18 ? "--" : "(";
+        return javaDocsBuiltByVersion == JAVA_VERSION_18 ? "-" : "(";
     }
     protected String getOperationMarkerClose() {
-        return javaDocsBuiltByVersion == JAVA_VERSION_18 ? "--" : ")";
+        return javaDocsBuiltByVersion == JAVA_VERSION_18 ? "-" : ")";
+    }
+    protected String getOperationParamSeparator() {
+        return javaDocsBuiltByVersion == JAVA_VERSION_18 ? "-" : ",";
     }
-    
     public void setJavaDocsBuiltByVersion(String version) {
         javaDocsBuiltByVersion = Double.valueOf(version);
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/a7f8a632/rt/rs/description/src/test/java/org/apache/cxf/jaxrs/model/wadl/JavaDocProviderTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/description/src/test/java/org/apache/cxf/jaxrs/model/wadl/JavaDocProviderTest.java
b/rt/rs/description/src/test/java/org/apache/cxf/jaxrs/model/wadl/JavaDocProviderTest.java
index 83e0686..486e7f1 100644
--- a/rt/rs/description/src/test/java/org/apache/cxf/jaxrs/model/wadl/JavaDocProviderTest.java
+++ b/rt/rs/description/src/test/java/org/apache/cxf/jaxrs/model/wadl/JavaDocProviderTest.java
@@ -31,20 +31,21 @@ public class JavaDocProviderTest extends Assert {
 
     @Test
     public void testJava6Docs() throws Exception {
-        if (JavaDocProvider.JAVA_VERSION == JavaDocProvider.JAVA_VERSION_16) {
-            doTestJavaDocs("classpath:/javadocs/pet-store-javadoc16.jar");
-        }
+        doTestJavaDocs("classpath:/javadocs/pet-store-javadoc16.jar", "1.6");
     }
     
     @Test
     public void testJava7Docs() throws Exception {
-        if (JavaDocProvider.JAVA_VERSION != JavaDocProvider.JAVA_VERSION_16) {
-            doTestJavaDocs("classpath:/javadocs/pet-store-javadoc17.jar");
-        }
+        doTestJavaDocs("classpath:/javadocs/pet-store-javadoc17.jar", "1.7");
+    }
+    @Test
+    public void testJava8Docs() throws Exception {
+        doTestJavaDocs("classpath:/javadocs/pet-store-javadoc18.jar", "1.8");
     }
     
-    private void doTestJavaDocs(String path) throws Exception {
+    private void doTestJavaDocs(String path, String version) throws Exception {
         JavaDocProvider p = new JavaDocProvider(path);
+        p.setJavaDocsBuiltByVersion(version);
         ClassResourceInfo cri = 
             ResourceUtils.createClassResourceInfo(PetStore.class, PetStore.class, true, true);
         String classDoc = p.getClassDoc(cri);

http://git-wip-us.apache.org/repos/asf/cxf/blob/a7f8a632/rt/rs/description/src/test/resources/javadocs/pet-store-javadoc18.jar
----------------------------------------------------------------------
diff --git a/rt/rs/description/src/test/resources/javadocs/pet-store-javadoc18.jar b/rt/rs/description/src/test/resources/javadocs/pet-store-javadoc18.jar
new file mode 100644
index 0000000..8a6bb65
Binary files /dev/null and b/rt/rs/description/src/test/resources/javadocs/pet-store-javadoc18.jar
differ


Mime
View raw message