Author: veithen Date: Wed Sep 29 19:37:22 2010 New Revision: 1002823 URL: http://svn.apache.org/viewvc?rev=1002823&view=rev Log: Added a test case to check if all XMLStreamReader wrappers used in the dialects correctly implement DelegatingXMLStreamReader.
Added: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/UnwrapTestCase.java (with props) Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTest.java webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTestCase.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=1002823&r1=1002822&r2=1002823&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 Wed Sep 29 19:37:22 2010 @@ -153,6 +153,7 @@ public class DialectTest extends TestSui addDialectTest(new NextAfterEndDocumentTestCase()); addDialectTest(new SetPrefixScopeTestCase()); addDialectTest(new StandaloneSetTestCase()); + addDialectTest(new UnwrapTestCase()); addDialectTest(new WriteStartDocumentWithNullEncodingTestCase()); } @@ -228,4 +229,8 @@ public class DialectTest extends TestSui StAXDialect getDialect() { return dialect; } + + ClassLoader getClassLoader() { + return classLoader; + } } Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTestCase.java URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTestCase.java?rev=1002823&r1=1002822&r2=1002823&view=diff ============================================================================== --- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTestCase.java (original) +++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/DialectTestCase.java Wed Sep 29 19:37:22 2010 @@ -44,4 +44,8 @@ public abstract class DialectTestCase ex protected StAXDialect getDialect() { return test.getDialect(); } + + protected ClassLoader getImplementationClassLoader() { + return test.getClassLoader(); + } } Added: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/UnwrapTestCase.java URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/UnwrapTestCase.java?rev=1002823&view=auto ============================================================================== --- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/UnwrapTestCase.java (added) +++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/UnwrapTestCase.java Wed Sep 29 19:37:22 2010 @@ -0,0 +1,35 @@ +/* + * 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; + +import org.apache.axiom.util.stax.XMLStreamReaderUtils; + +public class UnwrapTestCase extends DialectTestCase { + protected void runTest() throws Throwable { + XMLInputFactory factory = newNormalizedXMLInputFactory(); + XMLStreamReader reader = factory.createXMLStreamReader(new StringReader("<root/>")); + XMLStreamReader originalReader = XMLStreamReaderUtils.getOriginalXMLStreamReader(reader); + assertSame(getImplementationClassLoader(), originalReader.getClass().getClassLoader()); + } +} Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/util/stax/dialect/UnwrapTestCase.java ------------------------------------------------------------------------------ svn:eol-style = native