Return-Path: X-Original-To: apmail-groovy-commits-archive@minotaur.apache.org Delivered-To: apmail-groovy-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9458418B4D for ; Thu, 3 Mar 2016 22:14:09 +0000 (UTC) Received: (qmail 41142 invoked by uid 500); 3 Mar 2016 22:14:09 -0000 Delivered-To: apmail-groovy-commits-archive@groovy.apache.org Received: (qmail 41077 invoked by uid 500); 3 Mar 2016 22:14:09 -0000 Mailing-List: contact commits-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list commits@groovy.apache.org Received: (qmail 41049 invoked by uid 99); 3 Mar 2016 22:14:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2016 22:14:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 026FDE78F6; Thu, 3 Mar 2016 22:14:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: pascalschumacher@apache.org To: commits@groovy.apache.org Date: Thu, 03 Mar 2016 22:14:08 -0000 Message-Id: <45579e3a48b9448e885812103b4d67e9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/5] groovy git commit: add XmlJavadocAssertionTest and enable testing of some groovy-xml javadoc examples Repository: groovy Updated Branches: refs/heads/GROOVY_2_4_X 342451759 -> c1dda9d86 add XmlJavadocAssertionTest and enable testing of some groovy-xml javadoc examples Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/0c830952 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/0c830952 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/0c830952 Branch: refs/heads/GROOVY_2_4_X Commit: 0c83095287b84a59c252cd5d2fdec9cc982bc4a5 Parents: 3424517 Author: pascalschumacher Authored: Thu Mar 3 21:33:45 2016 +0100 Committer: pascalschumacher Committed: Thu Mar 3 23:13:55 2016 +0100 ---------------------------------------------------------------------- .../main/groovy/groovy/xml/StaxBuilder.groovy | 9 ++++--- .../src/main/java/groovy/util/XmlParser.java | 2 +- .../src/main/java/groovy/util/XmlSlurper.java | 4 +-- .../groovy/util/slurpersupport/GPathResult.java | 6 +++-- .../groovy/xml/XmlJavadocAssertionTest.groovy | 27 ++++++++++++++++++++ 5 files changed, 39 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/0c830952/subprojects/groovy-xml/src/main/groovy/groovy/xml/StaxBuilder.groovy ---------------------------------------------------------------------- diff --git a/subprojects/groovy-xml/src/main/groovy/groovy/xml/StaxBuilder.groovy b/subprojects/groovy-xml/src/main/groovy/groovy/xml/StaxBuilder.groovy index 9ed2879..91dac1e 100644 --- a/subprojects/groovy-xml/src/main/groovy/groovy/xml/StaxBuilder.groovy +++ b/subprojects/groovy-xml/src/main/groovy/groovy/xml/StaxBuilder.groovy @@ -21,19 +21,20 @@ package groovy.xml /** * A Groovy builder that works with Stax processors. * A typical usage is as follows: - *
+ * 
+ * import javax.xml.stream.XMLOutputFactory
  * def factory = XMLOutputFactory.newInstance()
  * def writer = new StringWriter()
- * def builder = new StaxBuilder(factory.createXMLStreamWriter(writer))
+ * def builder = new groovy.xml.StaxBuilder(factory.createXMLStreamWriter(writer))
  * builder.root1(a:5, b:7) {
  *     elem1('hello1')
  *     elem2('hello2')
  *     elem3(x:7)
  * }
- * assert writer.toString() == 'hello1hello2'
+ * assert writer.toString() == 'hello1hello2'
  * 
* Or an external library such as Jettison can be used as follows: - *
+ * 
  * @Grab('org.codehaus.jettison:jettison:1.2')
  * import org.codehaus.jettison.mapped.*
  * import javax.xml.stream.XMLStreamException

http://git-wip-us.apache.org/repos/asf/groovy/blob/0c830952/subprojects/groovy-xml/src/main/java/groovy/util/XmlParser.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-xml/src/main/java/groovy/util/XmlParser.java b/subprojects/groovy-xml/src/main/java/groovy/util/XmlParser.java
index 2733e22..40eecb9 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/util/XmlParser.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/util/XmlParser.java
@@ -57,7 +57,7 @@ import java.util.Map;
  * most simple use cases of processing XML.
  * 

* Example usage: - *

+ * 
  * def xml = '<root><one a1="uno!"/><two>Some text!</two></root>'
  * def rootNode = new XmlParser().parseText(xml)
  * assert rootNode.name() == 'root'

http://git-wip-us.apache.org/repos/asf/groovy/blob/0c830952/subprojects/groovy-xml/src/main/java/groovy/util/XmlSlurper.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-xml/src/main/java/groovy/util/XmlSlurper.java b/subprojects/groovy-xml/src/main/java/groovy/util/XmlSlurper.java
index 49ff017..209167f 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/util/XmlSlurper.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/util/XmlSlurper.java
@@ -56,7 +56,7 @@ import org.xml.sax.helpers.DefaultHandler;
 /**
  * Parse XML into a document tree that may be traversed similar to XPath
  * expressions.  For example:
- * 
+ * 
  * def rootNode = new XmlSlurper().parseText(
  *    '<root><one a1="uno!"/><two>Some text!</two></root>' )
  *
@@ -68,7 +68,7 @@ import org.xml.sax.helpers.DefaultHandler;
  * 

* Note that in some cases, a 'selector' expression may not resolve to a * single node. For example: - *

+ * 
  * def rootNode = new XmlSlurper().parseText(
  *    '''<root>
  *         <a>one!</a>

http://git-wip-us.apache.org/repos/asf/groovy/blob/0c830952/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java b/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java
index 72ab4fd..4bebe67 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java
@@ -374,7 +374,8 @@ public abstract class GPathResult extends GroovyObjectSupport implements Writabl
 
     /**
      * Supports the subscript operator for a GPathResult.
-     * 
+     * 
+     * import groovy.util.slurpersupport.*
      * def text = """
      * <characterList>
      *   <character/>
@@ -416,7 +417,8 @@ public abstract class GPathResult extends GroovyObjectSupport implements Writabl
 
     /**
      * Supports the range subscript operator for a GPathResult.
-     * 
+     * 
+     * import groovy.util.slurpersupport.*
      * def text = """
      * <characterList>
      *   <character>Wallace</character>

http://git-wip-us.apache.org/repos/asf/groovy/blob/0c830952/subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlJavadocAssertionTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlJavadocAssertionTest.groovy b/subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlJavadocAssertionTest.groovy
new file mode 100644
index 0000000..812cd87
--- /dev/null
+++ b/subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlJavadocAssertionTest.groovy
@@ -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 groovy.json
+
+import org.junit.runners.Suite
+import org.junit.runner.RunWith
+
+@RunWith(Suite)
+@Suite.SuiteClasses(JavadocAssertionTestSuite)
+class XmlJavadocAssertionTest {
+}