[jboss-osgi-commits] JBoss-OSGI SVN: r100114 - projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Fri Jan 29 03:13:06 EST 2010


Author: thomas.diesler at jboss.com
Date: 2010-01-29 03:13:06 -0500 (Fri, 29 Jan 2010)
New Revision: 100114

Modified:
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGi99TestCase.java
Log:
[JBOSGI-210] Bundle installed but not started with hot deploy
Use atomic move instead of copy

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	2010-01-29 07:51:03 UTC (rev 100113)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGi99TestCase.java	2010-01-29 08:13:06 UTC (rev 100114)
@@ -131,6 +131,7 @@
    }
 
    @Test
+   // [JBOSGI-210] Bundle installed but not started with hot deploy
    public void testHotDeploy() throws Exception
    {
       if (runtime.isRemoteRuntime() == false)
@@ -138,11 +139,15 @@
 
       File inFile = getTestArchiveFile("jbosgi99-allgood.jar");
 
-      // Copy the bundle to the deploy directory
-      String outPath = runtime.getBundle(0).getDataFile("dummy").getAbsolutePath();
+      // Copy the bundle to the data directory
+      String outPath = runtime.getBundle(0).getDataFile("jbosgi99-allgood.jar").getAbsolutePath();
+      File outFile = new File(outPath);
+      copyfile(inFile, outFile);
+      
+      // Move the bundle to the deploy directory
       outPath = outPath.substring(0, outPath.indexOf("data/osgi-store"));
-      File outFile = new File(outPath + "deploy/jbosgi99-allgood.jar");
-      copyfile(inFile, outFile);
+      File deployFile = new File(outPath + "deploy/jbosgi99-allgood.jar");
+      outFile.renameTo(deployFile);
 
       int timeout = 5000;
       OSGiBundle bundle = null;
@@ -160,7 +165,7 @@
       assertBundleState(Bundle.ACTIVE, bundle.getState());
 
       // Delete the bundle from the deploy directory
-      outFile.delete();
+      deployFile.delete();
 
       timeout = 5000;
       while (timeout > 0)



More information about the jboss-osgi-commits mailing list