cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [1/2] cxf-xjc-utils git commit: Added failing test for NPE issue
Date Thu, 22 Oct 2015 09:06:23 GMT
Repository: cxf-xjc-utils
Updated Branches:
  refs/heads/master 52debe6f6 -> d41ade480


Added failing test for NPE issue


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

Branch: refs/heads/master
Commit: 4cfb27c9d423b8afe4a9f21c823f31bab37c233a
Parents: 52debe6
Author: Lauro Schuck <lauroschuck@gmail.com>
Authored: Wed Oct 21 21:35:54 2015 -0200
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Thu Oct 22 10:04:21 2015 +0100

----------------------------------------------------------------------
 .../cxf/xjc/javadoc/JavadocPluginTest.java      | 10 ++++++
 .../anonymousEnum-javadoc-bindings.xjb          | 30 +++++++++++++++++
 javadoc/src/test/resources/anonymousEnum.xsd    | 34 ++++++++++++++++++++
 3 files changed, 74 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-xjc-utils/blob/4cfb27c9/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java
----------------------------------------------------------------------
diff --git a/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java b/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java
index dcad141..101f668 100644
--- a/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java
+++ b/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java
@@ -156,6 +156,16 @@ public class JavadocPluginTest extends Assert {
         assertThat(getterJavadoc, javadocContains("Documentation of attribute"));
     }
 
+    @Test
+    public void testAnonymousEnum() throws Exception {
+        String fileName = "anonymousEnum.xsd";
+        assertProcessedSuccessful(fileName, "-b", getAbsolutePath("anonymousEnum-javadoc-bindings.xjb"));
+
+        CompilationUnit compilationUnit = parseSourceFile("AnonymousTypesafeEnumClass.java");
+        Javadoc topLevelTypeJavadoc = getTopLevelEnum(compilationUnit).getJavadoc();
+        assertThat(topLevelTypeJavadoc, javadocContains("Documentation of anonymous enum
simpleType"));
+    }
+
     private void assertProcessedSuccessful(String fileName, String... params) throws Exception
{
         String xsdPath = getAbsolutePath(fileName);
         List<String> args = new ArrayList<String>(Arrays.asList(xsdPath, "-Xjavadoc",
"-d", OUTPUT_DIR));

http://git-wip-us.apache.org/repos/asf/cxf-xjc-utils/blob/4cfb27c9/javadoc/src/test/resources/anonymousEnum-javadoc-bindings.xjb
----------------------------------------------------------------------
diff --git a/javadoc/src/test/resources/anonymousEnum-javadoc-bindings.xjb b/javadoc/src/test/resources/anonymousEnum-javadoc-bindings.xjb
new file mode 100644
index 0000000..c78147f
--- /dev/null
+++ b/javadoc/src/test/resources/anonymousEnum-javadoc-bindings.xjb
@@ -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.
+ -->
+ <jaxb:bindings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+	xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
+	jaxb:version="2.1" schemaLocation="anonymousEnum.xsd"
+	node="/xs:schema">
+		
+	<jaxb:bindings node="./xs:element[@name='someElement']/xs:simpleType">
+		<jaxb:typesafeEnumClass name="AnonymousTypesafeEnumClass" />
+	</jaxb:bindings>
+
+</jaxb:bindings>

http://git-wip-us.apache.org/repos/asf/cxf-xjc-utils/blob/4cfb27c9/javadoc/src/test/resources/anonymousEnum.xsd
----------------------------------------------------------------------
diff --git a/javadoc/src/test/resources/anonymousEnum.xsd b/javadoc/src/test/resources/anonymousEnum.xsd
new file mode 100644
index 0000000..39e02d4
--- /dev/null
+++ b/javadoc/src/test/resources/anonymousEnum.xsd
@@ -0,0 +1,34 @@
+<?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.
+ -->
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.example.org/xjc-javadoc-plugin/"
+ 	targetNamespace="http://www.example.org/xjc-javadoc-plugin/">
+
+	<element name="someElement">
+		<simpleType>
+			<annotation>
+				<documentation>Documentation of anonymous enum simpleType</documentation>
+			</annotation>
+			<restriction base="token">
+				<enumeration value="ONE"/>
+			</restriction>
+		</simpleType>
+	</element>
+
+</schema>


Mime
View raw message