cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1517587 - in /cxf/dosgi/trunk: distribution/ distribution/multi-bundle/ distribution/multi-bundle2/ systests2/multi-bundle/ systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/
Date Mon, 26 Aug 2013 16:04:22 GMT
Author: cschneider
Date: Mon Aug 26 16:04:22 2013
New Revision: 1517587

URL: http://svn.apache.org/r1517587
Log:
DOSGI-201 Removing old multi bundle distro, fix tests

Added:
    cxf/dosgi/trunk/distribution/multi-bundle/
      - copied from r1517476, cxf/dosgi/trunk/distribution/multi-bundle2/
Removed:
    cxf/dosgi/trunk/distribution/multi-bundle2/
Modified:
    cxf/dosgi/trunk/distribution/multi-bundle/pom.xml
    cxf/dosgi/trunk/distribution/pom.xml
    cxf/dosgi/trunk/systests2/multi-bundle/pom.xml
    cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/AbstractDosgiTest.java
    cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/MultiBundleTools.java
    cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestImportService.java

Modified: cxf/dosgi/trunk/distribution/multi-bundle/pom.xml
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/distribution/multi-bundle/pom.xml?rev=1517587&r1=1517476&r2=1517587&view=diff
==============================================================================
--- cxf/dosgi/trunk/distribution/multi-bundle/pom.xml (original)
+++ cxf/dosgi/trunk/distribution/multi-bundle/pom.xml Mon Aug 26 16:04:22 2013
@@ -20,8 +20,8 @@
 <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">
 
   <modelVersion>4.0.0</modelVersion>
-  <artifactId>cxf-dosgi-ri-multibundle-distribution2</artifactId>
-  <name>Distributed OSGI Multi-Bundle Distribution2</name>
+  <artifactId>cxf-dosgi-ri-multibundle-distribution</artifactId>
+  <name>Distributed OSGI Multi-Bundle Distribution</name>
   <url>http://cxf.apache.org</url>
 
   <parent>

Modified: cxf/dosgi/trunk/distribution/pom.xml
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/distribution/pom.xml?rev=1517587&r1=1517586&r2=1517587&view=diff
==============================================================================
--- cxf/dosgi/trunk/distribution/pom.xml (original)
+++ cxf/dosgi/trunk/distribution/pom.xml Mon Aug 26 16:04:22 2013
@@ -39,7 +39,7 @@
 
     <modules>
       <module>features</module>
-      <module>multi-bundle2</module>
+      <module>multi-bundle</module>
       <module>sources</module>
     </modules>
 </project>

Modified: cxf/dosgi/trunk/systests2/multi-bundle/pom.xml
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/systests2/multi-bundle/pom.xml?rev=1517587&r1=1517586&r2=1517587&view=diff
==============================================================================
--- cxf/dosgi/trunk/systests2/multi-bundle/pom.xml (original)
+++ cxf/dosgi/trunk/systests2/multi-bundle/pom.xml Mon Aug 26 16:04:22 2013
@@ -62,27 +62,26 @@
             <version>${exam.version}</version>
             <scope>test</scope>
         </dependency>
-        
+
+        <dependency>
+            <groupId>org.eclipse</groupId>
+            <artifactId>org.eclipse.osgi</artifactId>
+            <version>3.8.0.v20120529-1548</version>
+        </dependency>
+<!-- 
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.framework</artifactId>
             <version>${felix.version}</version>
             <scope>test</scope>
         </dependency>
+         -->
 
         <dependency>
             <groupId>org.ops4j.pax.swissbox</groupId>
             <artifactId>pax-swissbox-tinybundles</artifactId>
             <version>1.3.1</version>
         </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-        </dependency>
 
         <dependency>
             <groupId>org.apache.cxf.dosgi.systests</groupId>
@@ -171,40 +170,41 @@
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
+        
     </dependencies>
 
     <build>
         <plugins>
-    <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <executions>
-            <execution>
-                <id>unpack</id>
-                <phase>generate-resources</phase>
-                <goals>
-                    <goal>unpack</goal>
-                </goals>
-                <configuration>
-                    <artifactItems>
-                        <artifactItem>
-                            <groupId>org.apache.cxf.dosgi</groupId>
-                            <artifactId>cxf-dosgi-ri-multibundle-distribution2</artifactId>
-                            <version>1.6-SNAPSHOT</version>
-                            <type>zip</type>
-                            <classifier>dir</classifier>
-                        </artifactItem>
-                    </artifactItems>
-                </configuration>
-            </execution>
-        </executions>
-    </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>unpack</id>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>unpack</goal>
+                        </goals>
+                        <configuration>
+                            <artifactItems>
+                                <artifactItem>
+                                    <groupId>org.apache.cxf.dosgi</groupId>
+                                    <artifactId>cxf-dosgi-ri-multibundle-distribution</artifactId>
+                                    <version>${project.version}</version>
+                                    <type>zip</type>
+                                    <classifier>dir</classifier>
+                                </artifactItem>
+                            </artifactItems>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
 
             <!-- use pax exam maven plugin -->
 
-            <!-- Note: settings and dependencies for the final osgi runtime
-                (TESTS) are just used in TestCases that annotated with this: @RunWith( MavenConfiguredJUnit4TestRunner.class
-                ) All other testcases will use their own settings/provisioning inside @Configure
+            <!-- Note: settings and dependencies for the final osgi runtime 
+                (TESTS) are just used in TestCases that annotated with this: @RunWith( MavenConfiguredJUnit4TestRunner.class

+                ) All other testcases will use their own settings/provisioning inside @Configure

                 Methods. -->
             <plugin>
                 <groupId>org.ops4j.pax.exam</groupId>
@@ -230,7 +230,7 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <systemPropertyVariables>
-                        <!-- <org.apache.cxf.dosgi.test.debug.port>5005</org.apache.cxf.dosgi.test.debug.port>
+                        <!-- <org.apache.cxf.dosgi.test.debug.port>5005</org.apache.cxf.dosgi.test.debug.port>

                             <org.apache.cxf.dosgi.test.serviceWaitTimeout>180</org.apache.cxf.dosgi.test.serviceWaitTimeout>
-->
                         <java.util.logging.config.file>${project.build.directory}/test-classes/logging.properties</java.util.logging.config.file>
                     </systemPropertyVariables>

Modified: cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/AbstractDosgiTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/AbstractDosgiTest.java?rev=1517587&r1=1517586&r2=1517587&view=diff
==============================================================================
--- cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/AbstractDosgiTest.java
(original)
+++ cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/AbstractDosgiTest.java
Mon Aug 26 16:04:22 2013
@@ -61,14 +61,14 @@ public class AbstractDosgiTest {
         Thread.sleep(interval);
     }
 
-    protected <T> ServiceReference<T> waitService(BundleContext bc, Class<T>
cls, String filter, int timeout)
+    protected ServiceReference waitService(BundleContext bc, Class cls, String filter, int
timeout)
         throws Exception {
         System.out.println("Waiting for service: " + cls + " " + filter);
         long startTime = System.currentTimeMillis();
         while (true) {
-            Collection<ServiceReference<T>> refs = bc.getServiceReferences(cls,
filter);
+            Collection refs = bc.getServiceReferences(cls, filter);
             if (refs != null && refs.size() > 0) {
-                return refs.iterator().next();
+                return (ServiceReference)refs.iterator().next();
             }
             sleepOrTimeout(startTime, timeout, "Service not found: " + cls + " " + filter);
         }

Modified: cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/MultiBundleTools.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/MultiBundleTools.java?rev=1517587&r1=1517586&r2=1517587&view=diff
==============================================================================
--- cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/MultiBundleTools.java
(original)
+++ cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/MultiBundleTools.java
Mon Aug 26 16:04:22 2013
@@ -20,6 +20,8 @@ package org.apache.cxf.dosgi.systests2.m
 
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
@@ -37,19 +39,20 @@ public final class MultiBundleTools {
 
     private MultiBundleTools() {
     }
-
-    private static int getDistroBundles(File mdRoot,
-                                        Map<Integer, String> bundles) throws Exception
{
-        File depRoot = new File(mdRoot, "target/dependency");
-        File distroDir = depRoot.listFiles()[0];
-                                
+    
+    private static Properties getProps(File distroDir) throws FileNotFoundException, IOException
{
         Properties p = new Properties();
         File confFile = new File(distroDir, "conf/felix.config.properties.append");
         p.load(new FileInputStream(confFile));
+        return p;
+    }
 
-        int startLevel = Integer.parseInt(p.getProperty("org.osgi.framework.startlevel.beginning"));
+    private static int getDistroBundles(File distroDir,
+                                        Properties props, 
+                                        Map<Integer, String> bundles) throws Exception
{
+        int startLevel = Integer.parseInt(props.getProperty("org.osgi.framework.startlevel.beginning"));
         for (int i = 0; i <= startLevel; i++) {
-            String val = p.getProperty("felix.auto.start." + i);
+            String val = props.getProperty("felix.auto.start." + i);
             if (val != null) {
                 if (val.startsWith("file:")) {
                     File fullDir = new File(distroDir, val.substring("file:".length()));
@@ -77,8 +80,18 @@ public final class MultiBundleTools {
     private static Option[] getDistroBundleOptions() throws Exception {
         Map<Integer, String> bundles = new TreeMap<Integer, String>();
         File root = getRootDirectory();
-        getDistroBundles(root, bundles);
+        File depRoot = new File(root, "target/dependency");
+        File distroDir = depRoot.listFiles()[0];
+        Properties props = getProps(distroDir);
+        getDistroBundles(distroDir, props, bundles);
         List<Option> opts = new ArrayList<Option>();
+        
+        /*
+        String sysPackagesValue = props.getProperty("org.osgi.framework.system.packages");
+        opts.add(CoreOptions.frameworkProperty("org.osgi.framework.system.packages")
+                 .value(sysPackagesValue));
+        */
+
         for (Map.Entry<Integer, String> entry : bundles.entrySet()) {
             String bundleUri = entry.getValue();
             URL bundleURL = new URL(bundleUri);

Modified: cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestImportService.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestImportService.java?rev=1517587&r1=1517586&r2=1517587&view=diff
==============================================================================
--- cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestImportService.java
(original)
+++ cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestImportService.java
Mon Aug 26 16:04:22 2013
@@ -127,7 +127,7 @@ public class TestImportService extends A
             bundleContext.registerService(Object.class.getName(), new Object(), props);
 
             // Wait for the service tracker in the test bundle to register a service with
the test result
-            ServiceReference<String> ref = waitService(bundleContext, String.class,
"(testResult=test1)", 20);
+            ServiceReference ref = waitService(bundleContext, String.class, "(testResult=test1)",
20);
             Assert.assertEquals("HiOSGi;exception", ref.getProperty("result"));
         } finally {
             if (server != null) {



Mime
View raw message