You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by jb...@apache.org on 2010/11/02 18:38:05 UTC
svn commit: r1030142 [2/2] - in
/incubator/aries/sandbox/jbohn/interceptor-proto:
application/application-itest-twitter/twitter-bundle/
application/application-runtime-framework-management/src/main/java/org/apache/aries/application/runtime/framework/ma...
Modified: incubator/aries/sandbox/jbohn/interceptor-proto/quiesce/quiesce-manager-itest/src/test/java/org/apache/aries/quiesce/manager/itest/QuiesceManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/quiesce/quiesce-manager-itest/src/test/java/org/apache/aries/quiesce/manager/itest/QuiesceManagerTest.java?rev=1030142&r1=1030141&r2=1030142&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/quiesce/quiesce-manager-itest/src/test/java/org/apache/aries/quiesce/manager/itest/QuiesceManagerTest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/quiesce/quiesce-manager-itest/src/test/java/org/apache/aries/quiesce/manager/itest/QuiesceManagerTest.java Tue Nov 2 17:38:00 2010
@@ -99,7 +99,7 @@ public class QuiesceManagerTest {
public void testNoParticipants() throws Exception {
bundleList = new ArrayList<Bundle>();
bundleList.add(b1);
- assertTrue("Bundle "+b1.getSymbolicName()+" should be in active state", b1.getState() == Bundle.ACTIVE);
+ assertEquals("Bundle "+b1.getSymbolicName()+" should be in active state", Bundle.ACTIVE, b1.getState());
//Try quiescing one bundle with no participants
manager.quiesceWithFuture(2000, bundleList).get(5000, TimeUnit.MILLISECONDS);
@@ -114,11 +114,11 @@ public class QuiesceManagerTest {
//Register a mock participant which will report back quiesced immediately
bundleContext.registerService(QuiesceParticipant.class.getName(), participant1, null);
//Try quiescing the bundle with immediate return
- assertTrue("Bundle "+b1.getSymbolicName()+" should be in active state", b1.getState() == Bundle.ACTIVE);
+ assertEquals("Bundle "+b1.getSymbolicName()+" should be in active state", Bundle.ACTIVE, b1.getState());
manager.quiesceWithFuture(1000,bundleList).get(5000, TimeUnit.MILLISECONDS);
- assertTrue("Participant should have finished once", participant1.getFinishedCount() == 1);
+ assertEquals("Participant should have finished once", 1, participant1.getFinishedCount());
assertTrue("Bundle "+b1.getSymbolicName()+" should not be in active state", b1.getState() != Bundle.ACTIVE);
}
@@ -131,15 +131,15 @@ public class QuiesceManagerTest {
bundleList.add(b1);
//Try quiescing the bundle with no return
- assertTrue("Bundle "+b1.getSymbolicName()+" should be in active state", b1.getState() == Bundle.ACTIVE);
+ assertEquals("Bundle "+b1.getSymbolicName()+" should be in active state", Bundle.ACTIVE, b1.getState());
manager.quiesce(1000,bundleList);
timeoutTime = System.currentTimeMillis()+5000;
while (System.currentTimeMillis() < timeoutTime && b1.getState() == Bundle.ACTIVE){
Thread.sleep(500);
}
- assertTrue("Participant should have started once", participant2.getStartedCount() == 1);
- assertTrue("Participant should not have finished", participant2.getFinishedCount() == 0);
+ assertEquals("Participant should have started once", 1, participant2.getStartedCount());
+ assertEquals("Participant should not have finished", 0, participant2.getFinishedCount());
assertTrue("Bundle "+b1.getSymbolicName()+" should not be in active state", b1.getState() != Bundle.ACTIVE);
}
@@ -151,13 +151,13 @@ public class QuiesceManagerTest {
bundleList = new ArrayList<Bundle>();
bundleList.add(b1);
- assertTrue("Bundle "+b1.getSymbolicName()+" should be in active state", b1.getState() == Bundle.ACTIVE);
+ assertEquals("Bundle "+b1.getSymbolicName()+" should be in active state", Bundle.ACTIVE, b1.getState());
// we should be finishing in about 5000 millis not 10000
manager.quiesceWithFuture(10000,bundleList).get(7000, TimeUnit.MILLISECONDS);
- assertTrue("Participant should have started once", participant3.getStartedCount() == 1);
- assertTrue("Participant should finished once", participant3.getFinishedCount() == 1);
+ assertEquals("Participant should have started once", 1, participant3.getStartedCount());
+ assertEquals("Participant should finished once", 1, participant3.getFinishedCount());
assertTrue("Bundle "+b1.getSymbolicName()+" should not be in active state", b1.getState() != Bundle.ACTIVE);
}
@@ -170,16 +170,16 @@ public class QuiesceManagerTest {
//recreate the list as it may have been emptied
bundleList = new ArrayList<Bundle>();
bundleList.add(b1);
- assertTrue("Bundle "+b1.getSymbolicName()+" should be in active state", b1.getState() == Bundle.ACTIVE);
+ assertEquals("Bundle "+b1.getSymbolicName()+" should be in active state", Bundle.ACTIVE, b1.getState());
manager.quiesceWithFuture(10000,bundleList).get(15000, TimeUnit.MILLISECONDS);
- assertTrue("Participant 1 should have started once", participant1.getStartedCount() == 1);
- assertTrue("Participant 1 should finished once", participant1.getFinishedCount() == 1);
- assertTrue("Participant 2 should have started once", participant2.getStartedCount() == 1);
- assertTrue("Participant 2 should not have finished", participant2.getFinishedCount() == 0);
- assertTrue("Participant 3 should have started once", participant3.getStartedCount() == 1);
- assertTrue("Participant 3 should finished once", participant3.getFinishedCount() == 1);
+ assertEquals("Participant 1 should have started once", 1, participant1.getStartedCount());
+ assertEquals("Participant 1 should finished once", 1, participant1.getFinishedCount());
+ assertEquals("Participant 2 should have started once", 1, participant2.getStartedCount());
+ assertEquals("Participant 2 should not have finished", 0, participant2.getFinishedCount());
+ assertEquals("Participant 3 should have started once", 1, participant3.getStartedCount());
+ assertEquals("Participant 3 should finished once", 1, participant3.getFinishedCount());
assertTrue("Bundle "+b1.getSymbolicName()+" should not be in active state", b1.getState() != Bundle.ACTIVE);
}
@@ -189,7 +189,7 @@ public class QuiesceManagerTest {
bundleContext.registerService(QuiesceParticipant.class.getName(), participant3, null);
bundleList = new ArrayList<Bundle>();
bundleList.add(b1);
- assertTrue("Bundle "+b1.getSymbolicName()+" should be in active state", b1.getState() == Bundle.ACTIVE);
+ assertEquals("Bundle "+b1.getSymbolicName()+" should be in active state", Bundle.ACTIVE, b1.getState());
Future<?> future = manager.quiesceWithFuture(2000, Arrays.asList(b1));
@@ -208,7 +208,7 @@ public class QuiesceManagerTest {
bundleContext.registerService(QuiesceParticipant.class.getName(), participant3, null);
bundleList = new ArrayList<Bundle>();
bundleList.add(b1);
- assertTrue("Bundle "+b1.getSymbolicName()+" should be in active state", b1.getState() == Bundle.ACTIVE);
+ assertEquals("Bundle "+b1.getSymbolicName()+" should be in active state", Bundle.ACTIVE, b1.getState());
Future<?> future = manager.quiesceWithFuture(2000, Arrays.asList(b1));
@@ -224,7 +224,7 @@ public class QuiesceManagerTest {
assertEquals("Participant 2 has finished", 0, participant2.getFinishedCount());
assertEquals("Participant 3 has started", 1, participant3.getStartedCount());
assertEquals("Participant 3 has finished", 0, participant3.getFinishedCount());
- assertTrue("Bundle "+b1.getSymbolicName()+" should still be active, because we did not wait long enough", b1.getState() == Bundle.ACTIVE);
+ assertEquals("Bundle "+b1.getSymbolicName()+" should still be active, because we did not wait long enough", Bundle.ACTIVE, b1.getState());
}
@Test
@@ -237,17 +237,17 @@ public class QuiesceManagerTest {
bundleList = new ArrayList<Bundle>();
bundleList.add(b1);
bundleList.add(b2);
- assertTrue("Bundle "+b1.getSymbolicName()+" should be in active state", b1.getState() == Bundle.ACTIVE);
- assertTrue("Bundle "+b2.getSymbolicName()+" should be in active state", b2.getState() == Bundle.ACTIVE);
+ assertEquals("Bundle "+b1.getSymbolicName()+" should be in active state", Bundle.ACTIVE, b1.getState());
+ assertEquals("Bundle "+b2.getSymbolicName()+" should be in active state", Bundle.ACTIVE, b2.getState());
manager.quiesceWithFuture(10000,bundleList).get(15000, TimeUnit.MILLISECONDS);
- assertTrue("Participant 1 should have started once", participant1.getStartedCount() == 1);
- assertTrue("Participant 1 should finished once", participant1.getFinishedCount() == 1);
- assertTrue("Participant 2 should have started once", participant2.getStartedCount() == 1);
- assertTrue("Participant 2 should not have finished", participant2.getFinishedCount() == 0);
- assertTrue("Participant 3 should have started once", participant3.getStartedCount() == 1);
- assertTrue("Participant 3 should finished once", participant3.getFinishedCount() == 1);
+ assertEquals("Participant 1 should have started once", 1, participant1.getStartedCount());
+ assertEquals("Participant 1 should finished once", 1, participant1.getFinishedCount());
+ assertEquals("Participant 2 should have started once", 1, participant2.getStartedCount());
+ assertEquals("Participant 2 should not have finished", 0, participant2.getFinishedCount());
+ assertEquals("Participant 3 should have started once", 1, participant3.getStartedCount());
+ assertEquals("Participant 3 should finished once", 1, participant3.getFinishedCount());
assertTrue("Bundle "+b1.getSymbolicName()+" should not be in active state", b1.getState() != Bundle.ACTIVE);
assertTrue("Bundle "+b2.getSymbolicName()+" should not be in active state", b2.getState() != Bundle.ACTIVE);
}
@@ -263,9 +263,9 @@ public class QuiesceManagerTest {
bundleList = new ArrayList<Bundle>();
bundleList.add(b1);
bundleList.add(b2);
- assertTrue("Bundle "+b1.getSymbolicName()+" should be in active state", b1.getState() == Bundle.ACTIVE);
- assertTrue("Bundle "+b2.getSymbolicName()+" should be in active state", b2.getState() == Bundle.ACTIVE);
- assertTrue("Bundle "+b3.getSymbolicName()+" should be in active state", b3.getState() == Bundle.ACTIVE);
+ assertEquals("Bundle "+b1.getSymbolicName()+" should be in active state", Bundle.ACTIVE, b1.getState());
+ assertEquals("Bundle "+b2.getSymbolicName()+" should be in active state", Bundle.ACTIVE, b2.getState());
+ assertEquals("Bundle "+b3.getSymbolicName()+" should be in active state", Bundle.ACTIVE, b3.getState());
manager.quiesce(2000,bundleList);
bundleList = new ArrayList<Bundle>();
bundleList.add(b2);
@@ -275,12 +275,12 @@ public class QuiesceManagerTest {
while (System.currentTimeMillis() < timeoutTime && (b1.getState() == Bundle.ACTIVE || b2.getState() == Bundle.ACTIVE || b3.getState() == Bundle.ACTIVE)) {
Thread.sleep(500);
}
- assertTrue("Participant 1 should have started twice as it has been asked to quiesce twice", participant1.getStartedCount() == 2);
- assertTrue("Participant 1 should finished twice as it should have returned from two quiesce requests immediately", participant1.getFinishedCount() == 2);
- assertTrue("Participant 2 should have started twice as it has been asked to quiesce twice", participant2.getStartedCount() == 2);
- assertTrue("Participant 2 should not have finished as it should never return from it's two quiesce requests", participant2.getFinishedCount() == 0);
- assertTrue("Participant 3 should have started twice as it has been asked to quiesce twice", participant3.getStartedCount() == 2);
- assertTrue("Participant 3 should finished twice as it should have waited a short time before returning from it's two quiesce requests", participant3.getFinishedCount() == 2);
+ assertEquals("Participant 1 should have started twice as it has been asked to quiesce twice", 2, participant1.getStartedCount());
+ assertEquals("Participant 1 should finished twice as it should have returned from two quiesce requests immediately", 2, participant1.getFinishedCount());
+ assertEquals("Participant 2 should have started twice as it has been asked to quiesce twice", 2, participant2.getStartedCount());
+ assertEquals("Participant 2 should not have finished as it should never return from it's two quiesce requests", 0, participant2.getFinishedCount());
+ assertEquals("Participant 3 should have started twice as it has been asked to quiesce twice", 2, participant3.getStartedCount());
+ assertEquals("Participant 3 should finished twice as it should have waited a short time before returning from it's two quiesce requests", 2, participant3.getFinishedCount());
assertTrue("Bundle "+b1.getSymbolicName()+" should not be in active state", b1.getState() != Bundle.ACTIVE);
assertTrue("Bundle "+b2.getSymbolicName()+" should not be in active state", b2.getState() != Bundle.ACTIVE);
assertTrue("Bundle "+b3.getSymbolicName()+" should not be in active state", b3.getState() != Bundle.ACTIVE);
Propchange: incubator/aries/sandbox/jbohn/interceptor-proto/samples/blog/blog-assembly/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Nov 2 17:38:00 2010
@@ -1,2 +1,4 @@
target
.project
+.classpath
+.settings
Propchange: incubator/aries/sandbox/jbohn/interceptor-proto/samples/blueprint/helloworld/helloworld-assembly/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Nov 2 17:38:00 2010
@@ -1 +1,4 @@
target
+.classpath
+.project
+.settings
Propchange: incubator/aries/sandbox/jbohn/interceptor-proto/samples/blueprint/idverifier/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Nov 2 17:38:00 2010
@@ -1 +1,4 @@
target
+.classpath
+.project
+.settings
Propchange: incubator/aries/sandbox/jbohn/interceptor-proto/samples/blueprint/idverifier/idverifier-assembly/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Nov 2 17:38:00 2010
@@ -1 +1,4 @@
target
+.classpath
+.project
+.settings
Modified: incubator/aries/sandbox/jbohn/interceptor-proto/samples/goat/goat-web/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/samples/goat/goat-web/pom.xml?rev=1030142&r1=1030141&r2=1030142&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/samples/goat/goat-web/pom.xml (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/samples/goat/goat-web/pom.xml Tue Nov 2 17:38:00 2010
@@ -90,7 +90,7 @@
<instructions>
<Bundle-ClassPath>.,WEB-INF/lib</Bundle-ClassPath>
<Include-Resource>{maven-resources},target/dojo/dojo-1.4.2</Include-Resource>
- <Web-ContextPath>/</Web-ContextPath>
+ <Web-ContextPath>/goat</Web-ContextPath>
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
<Private-Package>org.apache.aries.samples.goat.web.*</Private-Package>
<Import-Package>
Modified: incubator/aries/sandbox/jbohn/interceptor-proto/samples/goat/goat-web/src/main/resources/web/index.html
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/samples/goat/goat-web/src/main/resources/web/index.html?rev=1030142&r1=1030141&r2=1030142&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/samples/goat/goat-web/src/main/resources/web/index.html (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/samples/goat/goat-web/src/main/resources/web/index.html Tue Nov 2 17:38:00 2010
@@ -58,7 +58,7 @@ body, html {
<script type='text/javascript'>
- dojo.registerModulePath("goat", "/org.apache.aries.samples.goat.web/web/goat");
+ dojo.registerModulePath("goat", "../web/goat");
dojo.require("dojox.gfx");
dojo.require("dojox.gfx.move");
Propchange: incubator/aries/sandbox/jbohn/interceptor-proto/spi-fly/spi-fly-core/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Nov 2 17:38:00 2010
@@ -1 +1,4 @@
target
+.classpath
+.project
+.settings
Propchange: incubator/aries/sandbox/jbohn/interceptor-proto/spi-fly/spi-fly-itests/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Nov 2 17:38:00 2010
@@ -1 +1,4 @@
target
+.classpath
+.project
+.settings
Modified: incubator/aries/sandbox/jbohn/interceptor-proto/util/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/util/pom.xml?rev=1030142&r1=1030141&r2=1030142&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/util/pom.xml (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/util/pom.xml Tue Nov 2 17:38:00 2010
@@ -48,6 +48,9 @@
!org.apache.aries.util*,
org.osgi.framework.launch;resolution:=optional,
org.osgi.service.framework;resolution:=optional,
+ org.eclipse.osgi.internal.loader;resolution:=optional,
+ org.eclipse.osgi.framework.internal.core;resolution:=optional,
+ org.eclipse.osgi.framework.adaptor;resolution:=optional,
*
</aries.osgi.import.pkg>
<aries.osgi.private.pkg>
Modified: incubator/aries/sandbox/jbohn/interceptor-proto/util/src/main/java/org/apache/aries/util/BundleToClassLoaderAdapter.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/util/src/main/java/org/apache/aries/util/BundleToClassLoaderAdapter.java?rev=1030142&r1=1030141&r2=1030142&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/util/src/main/java/org/apache/aries/util/BundleToClassLoaderAdapter.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/util/src/main/java/org/apache/aries/util/BundleToClassLoaderAdapter.java Tue Nov 2 17:38:00 2010
@@ -32,6 +32,10 @@ import java.util.Enumeration;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleReference;
+/**
+ * @deprecated Please use AriesFrameworkUtil.getClassLoader to get a class loader for a bundle instead of this method
+ */
+@Deprecated
public class BundleToClassLoaderAdapter extends ClassLoader implements BundleReference
{
private Bundle b;
Propchange: incubator/aries/sandbox/jbohn/interceptor-proto/web/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Nov 2 17:38:00 2010
@@ -1 +1,4 @@
target
+.project
+.classpath
+.settings