incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mnutt...@apache.org
Subject svn commit: r1049545 - /incubator/aries/trunk/jndi/jndi-url-itest/src/test/java/org/apache/aries/jndi/itests/JndiUrlIntegrationTest.java
Date Wed, 15 Dec 2010 13:34:45 GMT
Author: mnuttall
Date: Wed Dec 15 13:34:45 2010
New Revision: 1049545

URL: http://svn.apache.org/viewvc?rev=1049545&view=rev
Log:
ARIES-512: Explicitly start bundles and add a short wait in order to make it more likely that
the blueprint and web containers will be initialised before we drive a web request in. 

Modified:
    incubator/aries/trunk/jndi/jndi-url-itest/src/test/java/org/apache/aries/jndi/itests/JndiUrlIntegrationTest.java

Modified: incubator/aries/trunk/jndi/jndi-url-itest/src/test/java/org/apache/aries/jndi/itests/JndiUrlIntegrationTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jndi/jndi-url-itest/src/test/java/org/apache/aries/jndi/itests/JndiUrlIntegrationTest.java?rev=1049545&r1=1049544&r2=1049545&view=diff
==============================================================================
--- incubator/aries/trunk/jndi/jndi-url-itest/src/test/java/org/apache/aries/jndi/itests/JndiUrlIntegrationTest.java
(original)
+++ incubator/aries/trunk/jndi/jndi-url-itest/src/test/java/org/apache/aries/jndi/itests/JndiUrlIntegrationTest.java
Wed Dec 15 13:34:45 2010
@@ -37,14 +37,29 @@ import org.osgi.framework.Bundle;
 @RunWith(JUnit4TestRunner.class)
 public class JndiUrlIntegrationTest extends AbstractIntegrationTest {
 
+  /**
+   * This test exercises the blueprint:comp/ jndi namespace by driving
+   * a Servlet which then looks up some blueprint components from its own
+   * bundle, including a reference which it uses to call a service from a 
+   * second bundle.  
+   * @throws Exception
+   */
   @Test
-  public void sniffTest() throws Exception { 
+  public void testBlueprintCompNamespaceWorks() throws Exception { 
+
+    Bundle bBiz = getInstalledBundle("org.apache.aries.jndi.url.itest.biz");
+    assertNotNull(bBiz);
+    bBiz.start();
     
     Bundle bweb = getInstalledBundle("org.apache.aries.jndi.url.itest.web");
     assertNotNull(bweb);
+    bweb.start();
 
-    Bundle bBiz = getInstalledBundle("org.apache.aries.jndi.url.itest.web");
-    assertNotNull(bBiz);
+    // Short wait in order to give the blueprint and web containers a chance
+    // to initialise
+    try { 
+      Thread.sleep(5000);
+    } catch (InterruptedException ix) {}
     
     System.out.println("In test and trying to get connection....");
     HttpURLConnection conn = makeConnection("http://localhost:8080/org.apache.aries.jndi.url.itest.web/ITestServlet");



Mime
View raw message