ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1523458 - in /webservices/axiom/trunk: modules/axiom-api/pom.xml systests/osgi-tests/pom.xml systests/osgi-tests/src/test/java/org/apache/axiom/test/SJSXPTest.java
Date Sun, 15 Sep 2013 16:55:33 GMT
Author: veithen
Date: Sun Sep 15 16:55:33 2013
New Revision: 1523458

URL: http://svn.apache.org/r1523458
Log:
AXIOM-454: Made org.codehaus.stax2 an optional import.

Added:
    webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/SJSXPTest.java
  (with props)
Modified:
    webservices/axiom/trunk/modules/axiom-api/pom.xml
    webservices/axiom/trunk/systests/osgi-tests/pom.xml

Modified: webservices/axiom/trunk/modules/axiom-api/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/pom.xml?rev=1523458&r1=1523457&r2=1523458&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/pom.xml (original)
+++ webservices/axiom/trunk/modules/axiom-api/pom.xml Sun Sep 15 16:55:33 2013
@@ -207,7 +207,11 @@
                         <_nouses>true</_nouses>
                         <_removeheaders>Private-Package</_removeheaders>
                         <Export-Package>*;-noimport:=true</Export-Package>
-                        <Import-Package>org.jaxen.*;resolution:=optional,*</Import-Package>
+                        <Import-Package>
+                            org.jaxen.*;resolution:=optional,
+                            org.codehaus.stax2;resolution:=optional,
+                            *
+                        </Import-Package>
                         <Bundle-Activator>org.apache.axiom.locator.Activator</Bundle-Activator>
                     </instructions>
                 </configuration>

Modified: webservices/axiom/trunk/systests/osgi-tests/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/osgi-tests/pom.xml?rev=1523458&r1=1523457&r2=1523458&view=diff
==============================================================================
--- webservices/axiom/trunk/systests/osgi-tests/pom.xml (original)
+++ webservices/axiom/trunk/systests/osgi-tests/pom.xml Sun Sep 15 16:55:33 2013
@@ -36,6 +36,12 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <!-- Contains SJSXP -->
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.jaxp-ri</artifactId>
+            <version>1.4.5_1</version>
+        </dependency>
+        <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>axiom-api</artifactId>
             <version>${project.version}</version>

Added: webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/SJSXPTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/SJSXPTest.java?rev=1523458&view=auto
==============================================================================
--- webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/SJSXPTest.java
(added)
+++ webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/SJSXPTest.java
Sun Sep 15 16:55:33 2013
@@ -0,0 +1,68 @@
+/*
+ * 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.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.ops4j.pax.exam.CoreOptions.frameworkProperty;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.url;
+
+import java.io.StringReader;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+
+/**
+ * Tests that Axiom works properly with SJSXP (instead of Woodstox) in an OSGi environment.
In
+ * particular, this is a regression test for <a
+ * href="https://issues.apache.org/jira/browse/AXIOM-454">AXIOM-454</a>; it checks
that the
+ * <code>org.codehaus.stax2</code> import is optional.
+ */
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class SJSXPTest {
+    @Configuration
+    public static Option[] configuration() {
+        return options(
+                url("link:classpath:org.apache.geronimo.specs.geronimo-activation_1.1_spec.link"),
+                url("link:classpath:org.apache.servicemix.specs.stax-api-1.0.link"),
+                url("link:classpath:org.apache.servicemix.bundles.jaxp-ri.link"),
+                url("link:classpath:org.apache.james.apache-mime4j-core.link"),
+                url("link:classpath:org.apache.ws.commons.axiom.axiom-api.link"),
+                url("link:classpath:org.apache.ws.commons.axiom.axiom-impl.link"),
+                junitBundles(),
+                frameworkProperty("foo").value("bar"));
+    }
+    
+    @Test
+    public void testCreateOMBuilder() throws Exception {
+        OMElement oe = OMXMLBuilderFactory.createOMBuilder(new StringReader(
+                "<a:testElement xmlns:a=\"http://test/namespace\"/>")).getDocumentElement();
+        assertEquals("testElement",oe.getLocalName());
+        assertEquals("http://test/namespace", oe.getNamespace().getNamespaceURI());
+    }
+}

Propchange: webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/SJSXPTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message