You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by ve...@apache.org on 2010/09/05 18:15:13 UTC
svn commit: r992812 - in
/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect:
DialectTest.java GetTextInPrologTestCase.java
Author: veithen
Date: Sun Sep 5 16:15:13 2010
New Revision: 992812
URL: http://svn.apache.org/viewvc?rev=992812&view=rev
Log:
Increased test coverage of BEA dialect.
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/GetTextInPrologTestCase.java (with props)
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTest.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTest.java?rev=992812&r1=992811&r2=992812&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTest.java Sun Sep 5 16:15:13 2010
@@ -51,6 +51,7 @@ public class DialectTest extends TestSui
addDialectTest(new GetEncodingFromDetectionTestCase("UnicodeLittleUnmarked", "UTF-16LE"));
addDialectTest(new GetEncodingTestCase());
addDialectTest(new GetEncodingWithCharacterStreamTestCase());
+ addDialectTest(new GetTextInPrologTestCase());
addDialectTest(new GetVersionTestCase());
addDialectTest(new IsCharactersOnCDATASectionTestCase());
addDialectTest(new IsStandaloneTestCase());
Added: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/GetTextInPrologTestCase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/GetTextInPrologTestCase.java?rev=992812&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/GetTextInPrologTestCase.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/GetTextInPrologTestCase.java Sun Sep 5 16:15:13 2010
@@ -0,0 +1,38 @@
+/*
+ * 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 org.apache.axiom.util.stax.dialect;
+
+import java.io.StringReader;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+public class GetTextInPrologTestCase extends DialectTestCase {
+ protected void runTest() throws Throwable {
+ XMLInputFactory factory = newNormalizedXMLInputFactory();
+ XMLStreamReader reader = factory.createXMLStreamReader(
+ new StringReader("<?xml version=\"1.0\"?>\r\n<root/>"));
+ if (reader.next() == XMLStreamReader.START_ELEMENT) {
+ System.out.println("Warning: " + getDialect().getName()
+ + " doesn't report character data in prolog");
+ } else {
+ assertEquals("\n", reader.getText());
+ }
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/GetTextInPrologTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native