incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mnutt...@apache.org
Subject svn commit: r1027887 - /incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverAdvancedTest.java
Date Wed, 27 Oct 2010 10:21:35 GMT
Author: mnuttall
Date: Wed Oct 27 10:21:35 2010
New Revision: 1027887

URL: http://svn.apache.org/viewvc?rev=1027887&view=rev
Log:
ARIES-470: Fix build break. Patch by Emily Jiang.

Modified:
    incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverAdvancedTest.java

Modified: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverAdvancedTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverAdvancedTest.java?rev=1027887&r1=1027886&r2=1027887&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverAdvancedTest.java
(original)
+++ incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverAdvancedTest.java
Wed Oct 27 10:21:35 2010
@@ -398,7 +398,7 @@ public class OBRResolverAdvancedTest ext
     /* 
      * HelloWorldManager hwm = getOsgiService(HelloWorldManager.class);
      * int numberOfServices = hwm.getNumOfHelloServices();
-     * assertEquals(numberOfServices, 2); 
+     * assertEquals(2, numberOfServices); 
      */
     ctx.stop();
     manager.uninstall(ctx);
@@ -417,6 +417,7 @@ public class OBRResolverAdvancedTest ext
       repositoryAdmin.removeRepository(repo.getURI());
     }
 
+    
     // Use the superclasses' getUrlToEba() method instead of the pax-exam mavenBundle() method
because pax-exam is running in a
     // diffference bundle which doesn't have visibility to the META-INF/maven/dependencies.properties
file used to figure out the
     // version of the maven artifact.
@@ -426,15 +427,23 @@ public class OBRResolverAdvancedTest ext
     AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
     repositoryAdmin.addRepository("http://sigil.codecauldron.org/spring-external.obr");
     AriesApplication app = manager.createApplication(twitterEbaUrl);
-    //installing requires a valid url for the bundle in repository.xml
-
     app = manager.resolve(app);
-
     DeploymentMetadata depMeta = app.getDeploymentMetadata();
     List<DeploymentContent> provision = depMeta.getApplicationProvisionBundles();
     Collection<DeploymentContent> useBundles = depMeta.getDeployedUseBundle();
     Collection<DeploymentContent> appContent = depMeta.getApplicationDeploymentContents();
-    assertEquals(provision.toString(), 2, provision.size());
+    // We cannot be sure whether there are two or three provision bundles pulled in by Felix
OBR as there is an outstanding defect
+    // https://issues.apache.org/jira/browse/FELIX-2672
+    // The workaround is to check we get the two bunldes we are looking for, instead of insisting
on just having two bundles.
+    
+    List<String> provisionBundleSymbolicNames = new ArrayList<String>();
+    for (DeploymentContent dep : provision) {
+       provisionBundleSymbolicNames.add(dep.getContentName());
+    }
+    String provision_bundle1 = "com.springsource.org.apache.commons.lang";
+    String provision_bundle2 = "twitter4j";
+    assertTrue("Bundle " + provision_bundle1 + " not found.", provisionBundleSymbolicNames.contains(provision_bundle1));
+    assertTrue("Bundle " + provision_bundle2 + " not found.", provisionBundleSymbolicNames.contains(provision_bundle2));
     assertEquals(useBundles.toString(), 0, useBundles.size());
     assertEquals(appContent.toString(), 1, appContent.size());
     AriesApplicationContext ctx = manager.install(app);



Mime
View raw message