[jboss-cvs] JBossAS SVN: r93663 - in projects/jboss-osgi/trunk/testsuite: example/src/test/java/org/jboss/test/osgi/example/blueprint and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 17 18:55:20 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-09-17 18:55:20 -0400 (Thu, 17 Sep 2009)
New Revision: 93663

Modified:
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintStressTestCase.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/blueprint/example-blueprint.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java
   projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
[JBOSGI-155] OutOfMemoryError on repeated install/unstall bundle
Restore -Xmx1024m for jbossmc
Still seeing uncollected Capabilities

Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintStressTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintStressTestCase.java	2009-09-17 22:43:31 UTC (rev 93662)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintStressTestCase.java	2009-09-17 22:55:20 UTC (rev 93663)
@@ -32,7 +32,6 @@
 import org.jboss.osgi.spi.testing.OSGiTestHelper;
 import org.jboss.test.osgi.example.blueprint.bundle.ServiceA;
 import org.jboss.test.osgi.example.blueprint.bundle.ServiceB;
-import org.jboss.virtual.VirtualFile;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.osgi.service.blueprint.container.BlueprintContainer;
@@ -45,8 +44,6 @@
  */
 public class BlueprintStressTestCase
 {
-   private static int RUN_COUNT = 100;
-
    @Test
    @Ignore
    public void testBlueprintBundleInstall() throws Exception
@@ -56,7 +53,7 @@
       try
       {
          long lastTime = System.currentTimeMillis();
-         for (int i = 0; i < RUN_COUNT; i++)
+         for (int i = 0; i < 100; i++)
          {
             runtime.addCapability(blueprintCapability);
 
@@ -76,9 +73,9 @@
             runtime.removeCapability(blueprintCapability);
 
             long currTime = System.currentTimeMillis();
-            //System.out.println("#" + (i + 1) + " " + (currTime - lastTime) + "ms " + VirtualFile.getCount());
+            System.out.println("#" + (i + 1) + " " + (currTime - lastTime) + "ms ");
 
-            Thread.sleep(3000);
+            //Thread.sleep(2000);
             lastTime = currTime;
          }
       }

Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/blueprint/example-blueprint.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/blueprint/example-blueprint.bnd	2009-09-17 22:43:31 UTC (rev 93662)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/blueprint/example-blueprint.bnd	2009-09-17 22:55:20 UTC (rev 93663)
@@ -7,12 +7,12 @@
 Import-Package: \
 	javax.management, \
 	org.jboss.osgi.blueprint, \
-	org.jboss.osgi.husky;resolution=optional, \
-	org.jboss.osgi.husky.annotation;resolution=optional, \
+	org.jboss.osgi.husky, \
+	org.jboss.osgi.husky.annotation, \
 	org.jboss.osgi.spi.capability, \
 	org.jboss.osgi.spi.testing, \
 	org.jboss.virtual, \
-	org.junit;resolution=optional, \
+	org.junit, \
 	org.osgi.framework, \
 	org.osgi.service.blueprint.* 
 

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java	2009-09-17 22:43:31 UTC (rev 93662)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java	2009-09-17 22:55:20 UTC (rev 93663)
@@ -29,7 +29,6 @@
 import org.jboss.osgi.spi.testing.OSGiBundle;
 import org.jboss.osgi.spi.testing.OSGiRuntime;
 import org.jboss.osgi.spi.testing.OSGiTestHelper;
-import org.jboss.virtual.VirtualFile;
 import org.junit.Test;
 import org.osgi.framework.Bundle;
 
@@ -51,25 +50,14 @@
       try
       {
          runtime.addCapability(logCapability);
-         
-         long lastTime = System.currentTimeMillis();
-         for (int i = 0; i < 1; i++)
-         {
-            
-            OSGiBundle bundleA = runtime.installBundle("jbosgi99-bundleA.jar");
-            assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
 
-            bundleA.start();
-            assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
+         OSGiBundle bundleA = runtime.installBundle("jbosgi99-bundleA.jar");
+         assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
 
-            bundleA.uninstall();
-            
-            long currTime = System.currentTimeMillis();
-            //System.out.println("#" + (i + 1) + " " + (currTime - lastTime) + "ms " + VirtualFile.getCount());
+         bundleA.start();
+         assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
 
-            //Thread.sleep(10000);
-            lastTime = currTime;
-         }
+         bundleA.uninstall();
       }
       finally
       {

Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml	2009-09-17 22:43:31 UTC (rev 93662)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml	2009-09-17 22:55:20 UTC (rev 93663)
@@ -246,6 +246,16 @@
           <scope>provided</scope>
         </dependency>
       </dependencies>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <argLine>-Xmx1024m</argLine>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
     </profile>
     <profile>
       <id>framework-default</id>
@@ -267,7 +277,7 @@
           <plugin>
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
-              <!-- argLine>-agentlib:yjpagent</argLine -->
+              <!--argLine>-agentlib:yjpagent</argLine-->
             </configuration>
           </plugin>
         </plugins>




More information about the jboss-cvs-commits mailing list