summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-02-15 14:51:28 (EST)
committerEike Stepper2007-02-15 14:51:28 (EST)
commit016c747478962c782bdedbca9bb83a8a0611cc5b (patch)
tree6f1d5cd2218e0d65e3004dc07c42ce213cede19a
parent6bc40c97e03599fb218a5909d61c905b9b0d4d5f (diff)
downloadcdo-016c747478962c782bdedbca9bb83a8a0611cc5b.zip
cdo-016c747478962c782bdedbca9bb83a8a0611cc5b.tar.gz
cdo-016c747478962c782bdedbca9bb83a8a0611cc5b.tar.bz2
Develop CDO2 - http://www.eclipse.org/emft/projects/cdo/#cdo
-rw-r--r--plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractOMTest.java46
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTCPTest.java6
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/DefaultContainer.java4
4 files changed, 50 insertions, 8 deletions
diff --git a/plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF
index 962d92b..da07909 100644
--- a/plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF
@@ -5,7 +5,7 @@ Bundle-SymbolicName: org.eclipse.net4j.tcp
Bundle-Version: 0.8.0.qualifier
Bundle-Activator: org.eclipse.net4j.internal.tcp.bundle.Activator
Bundle-Vendor: %providerName
-Require-Bundle: org.eclipse.net4j
+Require-Bundle: org.eclipse.net4j;visibility:=reexport
Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Import-Package: org.osgi.framework;version="1.3.0";resolution:=optional
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractOMTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractOMTest.java
index 06f033a..d6cb364 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractOMTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractOMTest.java
@@ -21,6 +21,8 @@ import junit.framework.TestCase;
*/
public abstract class AbstractOMTest extends TestCase
{
+ private static boolean consoleEnabled;
+
protected AbstractOMTest()
{
}
@@ -29,21 +31,55 @@ public abstract class AbstractOMTest extends TestCase
protected void setUp() throws Exception
{
super.setUp();
- System.out.print("================================= ");
- System.out.print(getName());
- System.out.println(" =================================");
+ System.out.println("************************************************");
+ System.out.println("START " + getName());
+ System.out.println("************************************************");
OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
OMPlatform.INSTANCE.setDebugging(true);
+ enableConsole();
}
@Override
protected void tearDown() throws Exception
{
- System.out.println();
- System.out.println();
Thread.sleep(20);
super.tearDown();
+ System.out.println();
+ System.out.println();
+ }
+
+ protected void enableConsole()
+ {
+ if (!consoleEnabled)
+ {
+ PrintTraceHandler.CONSOLE.setShortContext(true);
+ OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
+ OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
+ OMPlatform.INSTANCE.setDebugging(true);
+ consoleEnabled = true;
+ }
+ }
+
+ @SuppressWarnings("unused")
+ protected void disableConsole()
+ {
+ if (consoleEnabled)
+ {
+ consoleEnabled = false;
+ OMPlatform.INSTANCE.setDebugging(false);
+ OMPlatform.INSTANCE.removeTraceHandler(PrintTraceHandler.CONSOLE);
+ OMPlatform.INSTANCE.removeLogHandler(PrintLogHandler.CONSOLE);
+ }
+ }
+
+ protected static void msg(String m)
+ {
+ if (consoleEnabled)
+ {
+ System.out.println();
+ System.out.println("--> " + m);
+ }
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTCPTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTCPTest.java
index 517e0fc..1217a6c 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTCPTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTCPTest.java
@@ -73,7 +73,11 @@ public abstract class AbstractTCPTest extends AbstractOMTest
protected Container createContainer()
{
Container container = ContainerUtil.createContainer();
- container.register(new TCPContainerAdapterFactoryImpl());
+ if (container != null)
+ {
+ container.register(new TCPContainerAdapterFactoryImpl());
+ }
+
return container;
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/DefaultContainer.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/DefaultContainer.java
index f490c1c..daaf4f9 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/DefaultContainer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/DefaultContainer.java
@@ -32,7 +32,9 @@ public class DefaultContainer extends ContainerImpl
{
public Thread newThread(Runnable r)
{
- return new Thread(r);
+ Thread thread = new Thread(r);
+ thread.setDaemon(true);
+ return thread;
}
};