ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1796616 - in /webservices/axiom/trunk/systests/osgi-tests: ./ src/test/java/org/apache/axiom/test/ src/test/resources/ src/test/resources/OSGI-INF/ src/test/resources/OSGI-INF/blueprint/
Date Mon, 29 May 2017 12:05:08 GMT
Author: veithen
Date: Mon May 29 12:05:08 2017
New Revision: 1796616

URL: http://svn.apache.org/viewvc?rev=1796616&view=rev
Log:
Add an OSGi Blueprint test.

Added:
    webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/BlueprintTest.java
  (with props)
    webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/TestService.java
  (with props)
    webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/TestServiceImpl.java
  (with props)
    webservices/axiom/trunk/systests/osgi-tests/src/test/resources/
    webservices/axiom/trunk/systests/osgi-tests/src/test/resources/OSGI-INF/
    webservices/axiom/trunk/systests/osgi-tests/src/test/resources/OSGI-INF/blueprint/
    webservices/axiom/trunk/systests/osgi-tests/src/test/resources/OSGI-INF/blueprint/blueprint.xml
  (with props)
Modified:
    webservices/axiom/trunk/systests/osgi-tests/pom.xml

Modified: webservices/axiom/trunk/systests/osgi-tests/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/osgi-tests/pom.xml?rev=1796616&r1=1796615&r2=1796616&view=diff
==============================================================================
--- webservices/axiom/trunk/systests/osgi-tests/pom.xml (original)
+++ webservices/axiom/trunk/systests/osgi-tests/pom.xml Mon May 29 12:05:08 2017
@@ -87,6 +87,18 @@
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.aries.blueprint</groupId>
+            <artifactId>org.apache.aries.blueprint.core</artifactId>
+            <version>1.8.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries.proxy</groupId>
+            <artifactId>org.apache.aries.proxy</artifactId>
+            <version>1.1.1</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>

Added: webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/BlueprintTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/BlueprintTest.java?rev=1796616&view=auto
==============================================================================
--- webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/BlueprintTest.java
(added)
+++ webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/BlueprintTest.java
Mon May 29 12:05:08 2017
@@ -0,0 +1,58 @@
+/*
+ * 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.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.url;
+
+import javax.inject.Inject;
+
+import org.junit.Assert;
+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;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class BlueprintTest {
+    @Configuration
+    public static Option[] configuration() {
+        return options(
+                url("link:classpath:org.apache.aries.proxy.api.link"),
+                url("link:classpath:org.apache.aries.proxy.link"),
+                url("link:classpath:org.apache.aries.blueprint.core.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-dom.link"),
+                junitBundles());
+    }
+    
+    @Inject
+    private TestService testService;
+
+    @Test
+    public void test() throws Exception {
+        Assert.assertEquals("<test/>", testService.doSomething());
+    }
+}

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

Added: webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/TestService.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/TestService.java?rev=1796616&view=auto
==============================================================================
--- webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/TestService.java
(added)
+++ webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/TestService.java
Mon May 29 12:05:08 2017
@@ -0,0 +1,23 @@
+/*
+ * 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;
+
+public interface TestService {
+    String doSomething() throws Exception;
+}

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

Added: webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/TestServiceImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/TestServiceImpl.java?rev=1796616&view=auto
==============================================================================
--- webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/TestServiceImpl.java
(added)
+++ webservices/axiom/trunk/systests/osgi-tests/src/test/java/org/apache/axiom/test/TestServiceImpl.java
Mon May 29 12:05:08 2017
@@ -0,0 +1,37 @@
+/*
+ * 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 org.apache.axiom.om.OMMetaFactory;
+import org.w3c.dom.Document;
+
+public class TestServiceImpl implements TestService {
+    private OMMetaFactory metaFactory;
+
+    public void setMetaFactory(OMMetaFactory metaFactory) {
+        this.metaFactory = metaFactory;
+    }
+
+    @Override
+    public String doSomething() throws Exception {
+        // TODO: casting metaFactory to DOMMetaFactory doesn't work because the reference
is a proxy
+        Document document = (Document)metaFactory.getOMFactory().createOMDocument();
+        return document.createElementNS(null, "test").toString();
+    }
+}

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

Added: webservices/axiom/trunk/systests/osgi-tests/src/test/resources/OSGI-INF/blueprint/blueprint.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/osgi-tests/src/test/resources/OSGI-INF/blueprint/blueprint.xml?rev=1796616&view=auto
==============================================================================
--- webservices/axiom/trunk/systests/osgi-tests/src/test/resources/OSGI-INF/blueprint/blueprint.xml
(added)
+++ webservices/axiom/trunk/systests/osgi-tests/src/test/resources/OSGI-INF/blueprint/blueprint.xml
Mon May 29 12:05:08 2017
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+    <reference id="metaFactory" interface="org.apache.axiom.om.OMMetaFactory" filter="(implementationName=doom)"/>
+    <service interface="org.apache.axiom.test.TestService">
+        <bean class="org.apache.axiom.test.TestServiceImpl">
+            <property name="metaFactory" ref="metaFactory"/>
+        </bean>
+    </service>
+</blueprint>

Propchange: webservices/axiom/trunk/systests/osgi-tests/src/test/resources/OSGI-INF/blueprint/blueprint.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message