You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2014/02/08 09:01:46 UTC

svn commit: r1565937 - /webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/SystemDepsTest.java

Author: veithen
Date: Sat Feb  8 08:01:45 2014
New Revision: 1565937

URL: http://svn.apache.org/r1565937
Log:
Added a test that checks that Axiom works properly if the Activation and StAX APIs are resolved from the framework bundle (i.e. from the JRE).

Added:
    webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/SystemDepsTest.java   (with props)

Added: webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/SystemDepsTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/SystemDepsTest.java?rev=1565937&view=auto
==============================================================================
--- webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/SystemDepsTest.java (added)
+++ webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/SystemDepsTest.java Sat Feb  8 08:01:45 2014
@@ -0,0 +1,63 @@
+/*
+ * 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.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 if the Activation and StAX APIs are resolved from the framework
+ * bundle (i.e. from the JRE). This also tests that Axiom works with the StAX implementation from
+ * the JRE.
+ * <p>
+ * Note that this test relies on the fact that the Maven build requires at least Java 1.6.
+ */
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class SystemDepsTest {
+    @Configuration
+    public static Option[] configuration() {
+        return options(
+                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());
+    }
+    
+    @Test
+    public void testCreateOMBuilder() throws Exception {
+        OMElement element = OMXMLBuilderFactory.createOMBuilder(new StringReader(
+                "<root/>")).getDocumentElement();
+        assertEquals("root", element.getLocalName());
+    }
+}

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