cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r738454 - in /cxf/sandbox/dosgi/systests: common/src/main/java/org/apache/cxf/dosgi/systests/common/ multi_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/multibundle/ single_bundle_distro/src/test/java/org/apache/cxf/dosgi/systes...
Date Wed, 28 Jan 2009 11:22:29 GMT
Author: davidb
Date: Wed Jan 28 11:22:25 2009
New Revision: 738454

URL: http://svn.apache.org/viewvc?rev=738454&view=rev
Log:
Refactored system tests so that they actually take the files from the (multi|single) bundle
distribution directory and exercise these.

Added:
    cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractDosgiSystemTest.java
  (with props)
Removed:
    cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/Dependency.java
Modified:
    cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractBasicPublishHookTest.java
    cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractListenerHookServiceListenerTest.java
    cxf/sandbox/dosgi/systests/multi_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/multibundle/BasicPublishHookTest.java
    cxf/sandbox/dosgi/systests/multi_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/multibundle/ListenerHookServiceListenerTest.java
    cxf/sandbox/dosgi/systests/multi_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/multibundle/MultiBundleDistributionResolver.java
    cxf/sandbox/dosgi/systests/single_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/singlebundle/BasicPublishHookTest.java
    cxf/sandbox/dosgi/systests/single_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/singlebundle/ListenerHookServiceListenerTest.java
    cxf/sandbox/dosgi/systests/single_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/singlebundle/SingleBundleDistributionResolver.java

Modified: cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractBasicPublishHookTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractBasicPublishHookTest.java?rev=738454&r1=738453&r2=738454&view=diff
==============================================================================
--- cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractBasicPublishHookTest.java
(original)
+++ cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractBasicPublishHookTest.java
Wed Jan 28 11:22:25 2009
@@ -22,50 +22,26 @@
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.net.URL;
-import java.util.ArrayList;
 import java.util.Dictionary;
 import java.util.Hashtable;
-import java.util.List;
 import java.util.Map;
-import java.util.jar.Manifest;
 
 import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.dosgi.samples.greeter.GreeterException;
 import org.apache.cxf.dosgi.samples.greeter.GreeterService;
 import org.apache.cxf.dosgi.samples.greeter.GreetingPhrase;
 import org.apache.cxf.frontend.ClientProxyFactoryBean;
-import org.apache.servicemix.kernel.testing.support.AbstractIntegrationTest;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.cm.ManagedService;
 
-public abstract class AbstractBasicPublishHookTest extends AbstractIntegrationTest  {
-    protected Manifest getManifest() {
-        // let the testing framework create/load the manifest
-        Manifest mf = super.getManifest();
-        String importP = mf.getMainAttributes().getValue(Constants.IMPORT_PACKAGE);
-        mf.getMainAttributes().putValue(Constants.IMPORT_PACKAGE, importP);
-        mf.getMainAttributes().putValue(Constants.DYNAMICIMPORT_PACKAGE, "*");
-
-        return mf;
-    }
-    
+public abstract class AbstractBasicPublishHookTest extends AbstractDosgiSystemTest  {
     @Override
     protected String[] getTestBundlesNames() {
-        List<String> deps = new ArrayList<String>();
-        
-        for (Dependency d : getDistributionBundles()) {
-            deps.add(getBundle(d.getGroupId(), d.getArtifactId()));
-        }
-
-        // ones needed by the test
-        deps.add(getBundle("org.apache.cxf", "cxf-dosgi-ri-systests-common"));
-        deps.add(getBundle("org.apache.cxf", "cxf-dosgi-ri-samples-greeter-interface"));
-
-        return deps.toArray(new String [deps.size()]);
+        return new String [] {
+            getBundle("org.apache.cxf", "cxf-dosgi-ri-systests-common"),
+            getBundle("org.apache.cxf", "cxf-dosgi-ri-samples-greeter-interface")};
     }
-    
-    protected abstract Dependency [] getDistributionBundles();
 
     public void testBasicInvocation() throws Exception {
         

Added: cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractDosgiSystemTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractDosgiSystemTest.java?rev=738454&view=auto
==============================================================================
--- cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractDosgiSystemTest.java
(added)
+++ cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractDosgiSystemTest.java
Wed Jan 28 11:22:25 2009
@@ -0,0 +1,71 @@
+/** 
+  * 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.cxf.dosgi.systests.common;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.jar.Manifest;
+
+import org.apache.servicemix.kernel.testing.support.AbstractIntegrationTest;
+import org.osgi.framework.Constants;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.core.io.Resource;
+
+public abstract class AbstractDosgiSystemTest extends AbstractIntegrationTest {
+    protected Manifest getManifest() {
+        // let the testing framework create/load the manifest
+        Manifest mf = super.getManifest();
+        String importP = mf.getMainAttributes().getValue(Constants.IMPORT_PACKAGE);
+        mf.getMainAttributes().putValue(Constants.IMPORT_PACKAGE, importP);
+        mf.getMainAttributes().putValue(Constants.DYNAMICIMPORT_PACKAGE, "*");
+
+        return mf;
+    }       
+        
+    @Override
+    protected Resource[] getTestBundles() {
+        // Return the bundles for the current distribution, filtering out the 
+        // ones that are already installed as part of the testing framework.
+        // At the end the test subclass is called to obtain the test bundles.
+        
+        List<String> frameworkBundleNames = new ArrayList<String>();
+        for (Resource r : getTestFrameworkBundles()) {
+            frameworkBundleNames.add(r.getFilename());
+        }
+
+        
+        try {
+            List<Resource> resources = new ArrayList<Resource>();
+            for (File file : getDistributionBundles()) {
+                if (!frameworkBundleNames.contains(file.getName())) {
+                    resources.add(new FileSystemResource(file));
+                }
+            }
+            
+            resources.addAll(Arrays.asList(super.getTestBundles()));
+            return resources.toArray(new Resource[resources.size()]);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    protected abstract File [] getDistributionBundles() throws Exception;
+}

Propchange: cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractDosgiSystemTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractDosgiSystemTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractListenerHookServiceListenerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractListenerHookServiceListenerTest.java?rev=738454&r1=738453&r2=738454&view=diff
==============================================================================
--- cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractListenerHookServiceListenerTest.java
(original)
+++ cxf/sandbox/dosgi/systests/common/src/main/java/org/apache/cxf/dosgi/systests/common/AbstractListenerHookServiceListenerTest.java
Wed Jan 28 11:22:25 2009
@@ -19,12 +19,13 @@
 package org.apache.cxf.dosgi.systests.common;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.Callable;
 import java.util.concurrent.FutureTask;
-import java.util.jar.Manifest;
 
 import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.dosgi.samples.greeter.GreeterException;
@@ -33,40 +34,33 @@
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.frontend.ClientProxyFactoryBean;
 import org.apache.cxf.frontend.ServerFactoryBean;
-import org.apache.servicemix.kernel.testing.support.AbstractIntegrationTest;
-import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 import org.osgi.util.tracker.ServiceTracker;
+import org.springframework.core.io.Resource;
 
-public abstract class AbstractListenerHookServiceListenerTest extends AbstractIntegrationTest
 {       
+public abstract class AbstractListenerHookServiceListenerTest extends AbstractDosgiSystemTest
 {       
     private FutureTask<Map<GreetingPhrase, String>> task;
-        
-    protected Manifest getManifest() {
-        // let the testing framework create/load the manifest
-        Manifest mf = super.getManifest();
-        String importP = mf.getMainAttributes().getValue(Constants.IMPORT_PACKAGE);
-        mf.getMainAttributes().putValue(Constants.IMPORT_PACKAGE, importP);
-        mf.getMainAttributes().putValue(Constants.DYNAMICIMPORT_PACKAGE, "*");
 
-        return mf;
+    @Override
+    protected String[] getTestBundlesNames() {
+        return new String [] {
+            getBundle("org.apache.cxf", "cxf-dosgi-ri-systests-common"),
+            getBundle("org.apache.cxf", "cxf-dosgi-ri-samples-greeter-interface")};
     }
     
     @Override
-    protected String[] getTestBundlesNames() {
-        List<String> deps = new ArrayList<String>();
-        
-        for (Dependency d : getDistributionBundles()) {
-            deps.add(getBundle(d.getGroupId(), d.getArtifactId()));
+    protected Resource[] getTestBundles() {
+        // Remove the CXF DSW bundle for this test as we'll be installing it later in the

+        // test itself        
+        List<Resource> resources = new ArrayList<Resource>(Arrays.asList(super.getTestBundles()));
+        for (Iterator<Resource> it = resources.iterator(); it.hasNext(); ) {
+            String fn = it.next().getFilename();
+            if (fn.startsWith("cxf-dosgi-ri-dsw-cxf") && fn.endsWith(".jar")) {
+                it.remove();
+            }
         }
-
-        // ones needed by the test
-        deps.add(getBundle("org.apache.cxf", "cxf-dosgi-ri-systests-common"));
-        deps.add(getBundle("org.apache.cxf", "cxf-dosgi-ri-samples-greeter-interface"));
-
-        return deps.toArray(new String [deps.size()]);
+        return resources.toArray(new Resource[resources.size()]);
     }
-    
-    protected abstract Dependency [] getDistributionBundles();
 
     public void testBasicInvocation() throws Exception {
 

Modified: cxf/sandbox/dosgi/systests/multi_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/multibundle/BasicPublishHookTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/systests/multi_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/multibundle/BasicPublishHookTest.java?rev=738454&r1=738453&r2=738454&view=diff
==============================================================================
--- cxf/sandbox/dosgi/systests/multi_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/multibundle/BasicPublishHookTest.java
(original)
+++ cxf/sandbox/dosgi/systests/multi_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/multibundle/BasicPublishHookTest.java
Wed Jan 28 11:22:25 2009
@@ -18,11 +18,12 @@
   */
 package org.apache.cxf.dosgi.systests.multibundle;
 
+import java.io.File;
+
 import org.apache.cxf.dosgi.systests.common.AbstractBasicPublishHookTest;
-import org.apache.cxf.dosgi.systests.common.Dependency;
 
 public class BasicPublishHookTest extends AbstractBasicPublishHookTest  {
-    protected Dependency [] getDistributionBundles() {
+    protected File [] getDistributionBundles() throws Exception {
         return MultiBundleDistributionResolver.getDistribution();
     }
 }

Modified: cxf/sandbox/dosgi/systests/multi_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/multibundle/ListenerHookServiceListenerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/systests/multi_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/multibundle/ListenerHookServiceListenerTest.java?rev=738454&r1=738453&r2=738454&view=diff
==============================================================================
--- cxf/sandbox/dosgi/systests/multi_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/multibundle/ListenerHookServiceListenerTest.java
(original)
+++ cxf/sandbox/dosgi/systests/multi_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/multibundle/ListenerHookServiceListenerTest.java
Wed Jan 28 11:22:25 2009
@@ -18,11 +18,12 @@
   */
 package org.apache.cxf.dosgi.systests.multibundle;
 
+import java.io.File;
+
 import org.apache.cxf.dosgi.systests.common.AbstractListenerHookServiceListenerTest;
-import org.apache.cxf.dosgi.systests.common.Dependency;
 
 public class ListenerHookServiceListenerTest extends AbstractListenerHookServiceListenerTest
 {       
-    protected Dependency [] getDistributionBundles() {
+    protected File [] getDistributionBundles() throws Exception {
         return MultiBundleDistributionResolver.getDistribution();
     }
 }

Modified: cxf/sandbox/dosgi/systests/multi_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/multibundle/MultiBundleDistributionResolver.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/systests/multi_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/multibundle/MultiBundleDistributionResolver.java?rev=738454&r1=738453&r2=738454&view=diff
==============================================================================
--- cxf/sandbox/dosgi/systests/multi_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/multibundle/MultiBundleDistributionResolver.java
(original)
+++ cxf/sandbox/dosgi/systests/multi_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/multibundle/MultiBundleDistributionResolver.java
Wed Jan 28 11:22:25 2009
@@ -18,43 +18,40 @@
   */
 package org.apache.cxf.dosgi.systests.multibundle;
 
-import org.apache.cxf.dosgi.systests.common.Dependency;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 class MultiBundleDistributionResolver {
     private MultiBundleDistributionResolver() {}
 
-    static Dependency [] getDistribution() {
-        return new Dependency [] {
-            new Dependency("org.apache.geronimo.specs", "geronimo-javamail_1.4_spec"),
-            new Dependency("org.apache.geronimo.specs", "geronimo-activation_1.1_spec"),
-            new Dependency("org.apache.geronimo.specs", "geronimo-annotation_1.0_spec"),
-            new Dependency("org.apache.geronimo.specs", "geronimo-ws-metadata_2.0_spec"),
-            new Dependency("org.apache.geronimo.specs", "geronimo-servlet_2.5_spec"),
-            
-            new Dependency("org.apache.commons", "com.springsource.org.apache.commons.logging"),
-            new Dependency("org.jdom", "com.springsource.org.jdom"),
-    
-            new Dependency("org.mortbay.jetty", "jetty"),
-            new Dependency("org.mortbay.jetty", "jetty-util"),
-            
-            new Dependency("org.apache.servicemix.specs", "org.apache.servicemix.specs.locator"),
-            
-            new Dependency("org.apache.servicemix.specs", "org.apache.servicemix.specs.saaj-api-1.3"),
-            new Dependency("org.apache.servicemix.specs", "org.apache.servicemix.specs.stax-api-1.0"),
-            new Dependency("org.apache.servicemix.specs", "org.apache.servicemix.specs.jaxb-api-2.1"),
-            new Dependency("org.apache.servicemix.specs", "org.apache.servicemix.specs.jaxws-api-2.1"),
-            
-            new Dependency("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.woodstox"),
-            new Dependency("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.xmlsec"),
-            new Dependency("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.wss4j"),
-            new Dependency("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.wsdl4j"),

-            new Dependency("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.xmlresolver"),
-            new Dependency("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.neethi"),
-            new Dependency("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.asm"),
-            new Dependency("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jaxb-impl"),
-            new Dependency("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.xmlschema"),
-            new Dependency("org.apache.cxf", "cxf-bundle-minimal"),
-            new Dependency("org.apache.cxf", "cxf-dosgi-ri-dsw-cxf"),            
-        };
+    // Read the distribution from the distribution/multi-bundle module
+    static File [] getDistribution() throws Exception {
+        File distroRoot = new File(System.getProperty("basedir") + "/../../distribution/multi-bundle");

+        File distroFile = new File(distroRoot, "src/main/resources/distro_bundles.xml");
+        
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder builder = factory.newDocumentBuilder();
+        Document doc = builder.parse(distroFile);
+        
+        List<File> files = new ArrayList<File>();        
+        NodeList nodes = doc.getDocumentElement().getChildNodes();
+        for (int i = 0; i < nodes.getLength(); i++) {
+            Node n = nodes.item(i);
+            if ("bundle".equals(n.getNodeName())) {
+                String location = n.getTextContent();
+                File bundleFile = new File(distroRoot, "target/" + location);
+                files.add(bundleFile.getCanonicalFile());
+            }
+        }
+        
+        return files.toArray(new File[files.size()]);
     }
 }

Modified: cxf/sandbox/dosgi/systests/single_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/singlebundle/BasicPublishHookTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/systests/single_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/singlebundle/BasicPublishHookTest.java?rev=738454&r1=738453&r2=738454&view=diff
==============================================================================
--- cxf/sandbox/dosgi/systests/single_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/singlebundle/BasicPublishHookTest.java
(original)
+++ cxf/sandbox/dosgi/systests/single_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/singlebundle/BasicPublishHookTest.java
Wed Jan 28 11:22:25 2009
@@ -18,11 +18,12 @@
   */
 package org.apache.cxf.dosgi.systests.singlebundle;
 
+import java.io.File;
+
 import org.apache.cxf.dosgi.systests.common.AbstractBasicPublishHookTest;
-import org.apache.cxf.dosgi.systests.common.Dependency;
 
 public class BasicPublishHookTest extends AbstractBasicPublishHookTest  {
-    protected Dependency [] getDistributionBundles() {
+    protected File [] getDistributionBundles() throws Exception {
         return SingleBundleDistributionResolver.getDistribution();
     }
 }

Modified: cxf/sandbox/dosgi/systests/single_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/singlebundle/ListenerHookServiceListenerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/systests/single_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/singlebundle/ListenerHookServiceListenerTest.java?rev=738454&r1=738453&r2=738454&view=diff
==============================================================================
--- cxf/sandbox/dosgi/systests/single_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/singlebundle/ListenerHookServiceListenerTest.java
(original)
+++ cxf/sandbox/dosgi/systests/single_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/singlebundle/ListenerHookServiceListenerTest.java
Wed Jan 28 11:22:25 2009
@@ -18,11 +18,12 @@
   */
 package org.apache.cxf.dosgi.systests.singlebundle;
 
+import java.io.File;
+
 import org.apache.cxf.dosgi.systests.common.AbstractListenerHookServiceListenerTest;
-import org.apache.cxf.dosgi.systests.common.Dependency;
 
 public class ListenerHookServiceListenerTest extends AbstractListenerHookServiceListenerTest
 {       
-    protected Dependency [] getDistributionBundles() {
+    protected File [] getDistributionBundles() throws Exception {
         return SingleBundleDistributionResolver.getDistribution();
     }
 }

Modified: cxf/sandbox/dosgi/systests/single_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/singlebundle/SingleBundleDistributionResolver.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/systests/single_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/singlebundle/SingleBundleDistributionResolver.java?rev=738454&r1=738453&r2=738454&view=diff
==============================================================================
--- cxf/sandbox/dosgi/systests/single_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/singlebundle/SingleBundleDistributionResolver.java
(original)
+++ cxf/sandbox/dosgi/systests/single_bundle_distro/src/test/java/org/apache/cxf/dosgi/systests/singlebundle/SingleBundleDistributionResolver.java
Wed Jan 28 11:22:25 2009
@@ -18,14 +18,21 @@
   */
 package org.apache.cxf.dosgi.systests.singlebundle;
 
-import org.apache.cxf.dosgi.systests.common.Dependency;
+import java.io.File;
+import java.io.FilenameFilter;
 
 class SingleBundleDistributionResolver {
     private SingleBundleDistributionResolver() {}
 
-    static Dependency [] getDistribution() {
-        return new Dependency [] {
-            new Dependency("org.apache.cxf", "cxf-dosgi-ri-singlebundle-distribution"),
-        };
+    static File [] getDistribution() throws Exception {
+        File distroRoot = new File(System.getProperty("basedir") + 
+            "/../../distribution/single-bundle").getCanonicalFile();
+        
+        return new File(distroRoot, "target").listFiles(new FilenameFilter() {
+            public boolean accept(File dir, String name) {
+                return name.startsWith("cxf-dosgi-ri-singlebundle-distribution") &&
+                       name.endsWith(".jar");
+            }            
+        });
     }
 }



Mime
View raw message