Author: veithen
Date: Wed Mar 12 21:45:11 2014
New Revision: 1576937

URL: http://svn.apache.org/r1576937
Log:
Added integration tests for the Axis2 OSGi bundle. Note that the new module is 
not yet integrated into the build because the tests currently fail because of a 
class loading issue.

Added:
    axis/axis2/java/core/trunk/modules/osgi-tests/
    axis/axis2/java/core/trunk/modules/osgi-tests/pom.xml   (with props)
    axis/axis2/java/core/trunk/modules/osgi-tests/src/
    axis/axis2/java/core/trunk/modules/osgi-tests/src/test/
    axis/axis2/java/core/trunk/modules/osgi-tests/src/test/java/
    axis/axis2/java/core/trunk/modules/osgi-tests/src/test/java/OSGiTest.java   
(with props)

Added: axis/axis2/java/core/trunk/modules/osgi-tests/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/osgi-tests/pom.xml?rev=1576937&view=auto
==============================================================================
--- axis/axis2/java/core/trunk/modules/osgi-tests/pom.xml (added)
+++ axis/axis2/java/core/trunk/modules/osgi-tests/pom.xml Wed Mar 12 21:45:11 
2014
@@ -0,0 +1,181 @@
+<?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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+    <parent>
+        <groupId>org.apache.axis2</groupId>
+        <artifactId>axis2-parent</artifactId>
+        <version>1.7.0-SNAPSHOT</version>
+        <relativePath>../parent/pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>osgi-tests</artifactId>
+    <name>Apache Axis2 - OSGi Tests</name>
+    <url>http://axis.apache.org/axis2/java/core/</url>
+    <scm>
+        
<connection>scm:svn:http://svn.apache.org/repos/asf/axis/axis2/java/core/trunk/modules/osgi-tests</connection>
+        
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/axis/axis2/java/core/trunk/modules/osgi-tests</developerConnection>
+        
<url>http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/osgi-tests</url>
+    </scm>
+    <properties>
+        <exam.version>3.4.0</exam.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-kernel</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <!-- TODO: manage this dependency -->
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jms_1.1_spec</artifactId>
+            <version>1.1.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-javamail_1.4_spec</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <!-- TODO: manage this dependency -->
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+            <version>1.2.2</version>
+            <scope>test</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.framework</artifactId>
+            <version>4.2.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-native</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit4</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.11</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-atinject_1.0_spec</artifactId>
+            <version>1.0</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <pluginRepositories>
+        <pluginRepository>
+            <id>cloudbees-snapshot</id>
+            <url>http://repository-veithen.forge.cloudbees.com/snapshot/</url>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </pluginRepository>
+    </pluginRepositories>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>com.github.veithen.alta</groupId>
+                <artifactId>alta-maven-plugin</artifactId>
+                <version>0.1-SNAPSHOT</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>generate-test-resources</goal>
+                        </goals>
+                        <configuration>
+                            <name>%paxexam.linkName%</name>
+                            <altName>%bundle.symbolicName%.link</altName>
+                            <value>%url%</value>
+                            <dependencySet>
+                                <scope>test</scope>
+                            </dependencySet>
+                            <artifacts>
+                                <artifact>
+                                    <groupId>${project.groupId}</groupId>
+                                    
<artifactId>org.apache.axis2.osgi</artifactId>
+                                    <version>${project.version}</version>
+                                </artifact>
+                                <artifact>
+                                    
<groupId>org.apache.servicemix.bundles</groupId>
+                                    
<artifactId>org.apache.servicemix.bundles.wsdl4j</artifactId>
+                                    <version>1.6.2_6</version>
+                                </artifact>
+                                <artifact>
+                                    
<groupId>org.apache.geronimo.specs</groupId>
+                                    
<artifactId>geronimo-servlet_2.5_spec</artifactId>
+                                    <version>1.2</version>
+                                </artifact>
+                                <artifact>
+                                    
<groupId>org.apache.geronimo.specs</groupId>
+                                    
<artifactId>geronimo-jaxrs_1.1_spec</artifactId>
+                                    <version>1.0</version>
+                                </artifact>
+                                <artifact>
+                                    
<groupId>org.apache.servicemix.specs</groupId>
+                                    
<artifactId>org.apache.servicemix.specs.stax-api-1.0</artifactId>
+                                    <version>2.2.0</version>
+                                </artifact>
+                                <artifact>
+                                    
<groupId>org.apache.servicemix.bundles</groupId>
+                                    
<artifactId>org.apache.servicemix.bundles.commons-httpclient</artifactId>
+                                    <version>3.1_7</version>
+                                </artifact>
+                                <artifact>
+                                    
<groupId>org.apache.servicemix.bundles</groupId>
+                                    
<artifactId>org.apache.servicemix.bundles.commons-codec</artifactId>
+                                    <version>1.3_5</version>
+                                </artifact>
+                                <artifact>
+                                    
<groupId>org.apache.httpcomponents</groupId>
+                                    <artifactId>httpcore-osgi</artifactId>
+                                    <version>4.2.1</version>
+                                </artifact>
+                                <artifact>
+                                    
<groupId>org.apache.httpcomponents</groupId>
+                                    <artifactId>httpclient-osgi</artifactId>
+                                    <version>4.2.1</version>
+                                </artifact>
+                            </artifacts>
+                            <paxExam>${exam.version}</paxExam>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Propchange: axis/axis2/java/core/trunk/modules/osgi-tests/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: axis/axis2/java/core/trunk/modules/osgi-tests/src/test/java/OSGiTest.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/osgi-tests/src/test/java/OSGiTest.java?rev=1576937&view=auto
==============================================================================
--- axis/axis2/java/core/trunk/modules/osgi-tests/src/test/java/OSGiTest.java 
(added)
+++ axis/axis2/java/core/trunk/modules/osgi-tests/src/test/java/OSGiTest.java 
Wed Mar 12 21:45:11 2014
@@ -0,0 +1,84 @@
+/*
+ * 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.
+ */
+import static org.junit.Assert.assertTrue;
+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;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class OSGiTest {
+    @Configuration
+    public static Option[] configuration() {
+        return options(
+                
url("link:classpath:org.apache.servicemix.bundles.wsdl4j.link"),
+                
url("link:classpath:org.apache.geronimo.specs.geronimo-activation_1.1_spec.link"),
 // TODO: should not be necessary on Java 6
+                
url("link:classpath:org.apache.geronimo.specs.geronimo-jms_1.1_spec.link"), // 
TODO: why the heck is this required???
+                
url("link:classpath:org.apache.geronimo.specs.geronimo-ws-metadata_2.0_spec.link"),
+                
url("link:classpath:org.apache.geronimo.specs.geronimo-javamail_1.4_spec.link"),
 // TODO: should no longer be necessary
+                
url("link:classpath:org.apache.geronimo.specs.geronimo-servlet_2.5_spec.link"),
+                
url("link:classpath:org.apache.geronimo.specs.geronimo-jaxrs_1.1_spec.link"), 
// TODO: shouldn't this be optional???
+                
url("link:classpath:org.apache.servicemix.specs.stax-api-1.0.link"),
+                url("link:classpath:stax2-api.link"),
+                url("link:classpath:woodstox-core-asl.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"),
+                url("link:classpath:org.apache.commons.fileupload.link"),
+                url("link:classpath:org.apache.commons.io.link"),
+                
url("link:classpath:org.apache.servicemix.bundles.commons-httpclient.link"), // 
TODO: still necessary???
+                
url("link:classpath:org.apache.servicemix.bundles.commons-codec.link"), // 
TODO: still necessary???
+                url("link:classpath:org.apache.httpcomponents.httpcore.link"),
+                
url("link:classpath:org.apache.httpcomponents.httpclient.link"),
+                url("link:classpath:org.apache.neethi.link"),
+                url("link:classpath:org.apache.woden.core.link"),
+                url("link:classpath:org.apache.ws.xmlschema.core.link"),
+                url("link:classpath:org.apache.axis2.osgi.link"),
+                junitBundles());
+    }
+    
+    @Inject
+    private BundleContext context;
+    
+    @Test
+    public void test() {
+        boolean found = false;
+        for (Bundle bundle : context.getBundles()) {
+            if (bundle.getSymbolicName().equals("org.apache.axis2.osgi")) {
+                found = true;
+                Assert.assertEquals(Bundle.ACTIVE, bundle.getState());
+                break;
+            }
+        }
+        assertTrue(found);
+    }
+}

Propchange: 
axis/axis2/java/core/trunk/modules/osgi-tests/src/test/java/OSGiTest.java
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to