You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2011/01/19 18:37:08 UTC
svn commit: r1060882 -
/felix/trunk/framework/src/test/java/org/apache/felix/framework/StartStopBundleTest.java
Author: rickhall
Date: Wed Jan 19 17:37:07 2011
New Revision: 1060882
URL: http://svn.apache.org/viewvc?rev=1060882&view=rev
Log:
Reformat to match Felix style.
Modified:
felix/trunk/framework/src/test/java/org/apache/felix/framework/StartStopBundleTest.java
Modified: felix/trunk/framework/src/test/java/org/apache/felix/framework/StartStopBundleTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/test/java/org/apache/felix/framework/StartStopBundleTest.java?rev=1060882&r1=1060881&r2=1060882&view=diff
==============================================================================
--- felix/trunk/framework/src/test/java/org/apache/felix/framework/StartStopBundleTest.java (original)
+++ felix/trunk/framework/src/test/java/org/apache/felix/framework/StartStopBundleTest.java Wed Jan 19 17:37:07 2011
@@ -38,10 +38,9 @@ import org.osgi.framework.BundleExceptio
import org.osgi.framework.Constants;
import org.osgi.framework.launch.Framework;
-public class StartStopBundleTest extends TestCase {
-
+public class StartStopBundleTest extends TestCase
+{
public static final int DELAY = 1000;
-
private File cacheDir;
public void testStartStopBundle() throws Exception
@@ -74,11 +73,16 @@ public class StartStopBundleTest extends
final Bundle bundle = f.getBundleContext().installBundle(bundleFile.toURI().toString());
final CountDownLatch latch = new CountDownLatch(1);
- new Thread() {
- public void run() {
- try {
+ new Thread()
+ {
+ public void run()
+ {
+ try
+ {
bundle.start();
- } catch (BundleException e) {
+ }
+ catch (BundleException e)
+ {
e.printStackTrace();
}
}
@@ -89,15 +93,20 @@ public class StartStopBundleTest extends
long t1 = System.currentTimeMillis();
assertEquals(Bundle.RESOLVED, bundle.getState());
- assertTrue((t1 -t0) > DELAY / 2);
+ assertTrue((t1 - t0) > DELAY / 2);
bundle.start();
- new Thread() {
- public void run() {
- try {
+ new Thread()
+ {
+ public void run()
+ {
+ try
+ {
bundle.stop();
- } catch (BundleException e) {
+ }
+ catch (BundleException e)
+ {
e.printStackTrace();
}
}
@@ -108,7 +117,7 @@ public class StartStopBundleTest extends
t1 = System.currentTimeMillis();
assertEquals(Bundle.ACTIVE, bundle.getState());
- assertTrue((t1 -t0) > DELAY / 2);
+ assertTrue((t1 - t0) > DELAY / 2);
}
private static File createBundle(String manifest) throws IOException
@@ -134,13 +143,16 @@ public class StartStopBundleTest extends
return f;
}
- public static class TestBundleActivator implements BundleActivator {
- public void start(BundleContext context) throws Exception {
+ public static class TestBundleActivator implements BundleActivator
+ {
+ public void start(BundleContext context) throws Exception
+ {
Thread.sleep(DELAY);
}
- public void stop(BundleContext context) throws Exception {
+
+ public void stop(BundleContext context) throws Exception
+ {
Thread.sleep(DELAY);
}
}
-
-}
+}
\ No newline at end of file