summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-08-24 08:27:05 (EDT)
committerEike Stepper2006-08-24 08:27:05 (EDT)
commit443479f08331c8c6b25bf22b37e58da467ee1d12 (patch)
treea0e0abe1e4fe708c2dde8d9f928ff4f5aee3ab99
parent064885cb1f15f99fd04ccd1b83f3cca7da30d318 (diff)
downloadcdo-443479f08331c8c6b25bf22b37e58da467ee1d12.zip
cdo-443479f08331c8c6b25bf22b37e58da467ee1d12.tar.gz
cdo-443479f08331c8c6b25bf22b37e58da467ee1d12.tar.bz2
[154981] Embedded transport does not work
https://bugs.eclipse.org/bugs/show_bug.cgi?id=154981
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/META-INF/net4j/embedded/net4j-embedded.properties10
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/META-INF/net4j/embedded/net4j-embedded.xml21
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/launches/CDO All Model1 Embedded Tests.launch37
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AdapterTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AllModel1EmbeddedTests.java35
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/AbstractTopologyTest.java29
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientSeparatedServerTopology.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientServerTopology.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientTopology.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/EmbeddedTopology.java24
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopology.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopologyConstants.java32
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/Net4jUtilPlugin.java21
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/PropertiesHelper.java47
14 files changed, 246 insertions, 29 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/META-INF/net4j/embedded/net4j-embedded.properties b/plugins/org.eclipse.emf.cdo.tests/META-INF/net4j/embedded/net4j-embedded.properties
index d527a24..c79f2c2 100644
--- a/plugins/org.eclipse.emf.cdo.tests/META-INF/net4j/embedded/net4j-embedded.properties
+++ b/plugins/org.eclipse.emf.cdo.tests/META-INF/net4j/embedded/net4j-embedded.properties
@@ -1,14 +1,6 @@
# Service
acceptor.listenAddr=0.0.0.0
-acceptor.listenPort=2036
-
-# Authentication
-passiveNegotiator.algorithmName=PBEWithMD5AndDES
-passiveNegotiator.tokenLength=128
-auth.users.file=plugin:/META-INF/auth.users
+acceptor.listenPort=2037
# Internal
-randomizer.algorithm=SHA1PRNG
-bufferPool.bufferSize=4096
-channel.responseTimeoutMillis=2000
connectionManager.maxConnections=50
diff --git a/plugins/org.eclipse.emf.cdo.tests/META-INF/net4j/embedded/net4j-embedded.xml b/plugins/org.eclipse.emf.cdo.tests/META-INF/net4j/embedded/net4j-embedded.xml
index 19e5527..a5751d1 100644
--- a/plugins/org.eclipse.emf.cdo.tests/META-INF/net4j/embedded/net4j-embedded.xml
+++ b/plugins/org.eclipse.emf.cdo.tests/META-INF/net4j/embedded/net4j-embedded.xml
@@ -39,8 +39,25 @@
<!-- ######################################################## -->
<bean id="connector" class="org.eclipse.net4j.embedded.impl.ActiveEmbeddedConnectorImpl">
- <property name="autoStart">
- <value>false</value>
+ <property name="bufferPool">
+ <ref bean="bufferPool"/>
+ </property>
+ <property name="protocolManager">
+ <ref bean="protocolManager"/>
+ </property>
+ </bean>
+
+ <!-- ######################################################## -->
+ <bean id="slave" singleton="false"
+ class="org.eclipse.net4j.embedded.impl.PassiveEmbeddedConnectorImpl">
+ <property name="bufferPool">
+ <ref bean="bufferPool"/>
+ </property>
+ <property name="connectionManager">
+ <ref local="connectionManager"/>
+ </property>
+ <property name="protocolManager">
+ <ref bean="protocolManager"/>
</property>
</bean>
diff --git a/plugins/org.eclipse.emf.cdo.tests/launches/CDO All Model1 Embedded Tests.launch b/plugins/org.eclipse.emf.cdo.tests/launches/CDO All Model1 Embedded Tests.launch
new file mode 100644
index 0000000..288edaf
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/launches/CDO All Model1 Embedded Tests.launch
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<stringAttribute key="bootstrap" value=""/>
+<booleanAttribute key="useProduct" value="false"/>
+<stringAttribute key="deselected_workspace_plugins" value="org.eclipse.net4j.examples.mvc.swt,org.eclipse.net4j.examples.prov.client.ui,org.eclipse.net4j.examples.mvc,org.eclipse.net4j.examples.prov.server,org.eclipse.emf.cdo.dbgen.edit,org.eclipse.emf.cdo.examples.library,org.eclipse.emf.cdo.examples.library.ui,org.eclipse.emf.cdo.analysis.gmf,org.eclipse.emf.cdo.mapping.editor,org.eclipse.net4j.examples.server,org.eclipse.net4j.tests,org.eclipse.emf.cdo.doc,org.eclipse.datatools.enablement.mysql,org.eclipse.net4j.spring.tests,org.eclipse.emf.cdo,org.eclipse.emf.cdo.dbgen.editor,org.eclipse.net4j.examples.prov.edit,org.eclipse.emf.cdo.utilities.migrator,org.eclipse.emf.cdo.analysis,org.eclipse.emf.cdo.examples.server,org.eclipse.datatools.enablement.mysql.dbdefinition,org.eclipse.net4j.examples.prov,org.eclipse.emf.cdo.examples.client,org.eclipse.emf.cdo.examples.ui,org.eclipse.net4j.examples.client.ui,org.eclipse.net4j.examples.client,org.eclipse.net4j.doc,org.eclipse.net4j.examples.prov.client,org.eclipse.net4j.examples.prov.editor,org.eclipse.net4j"/>
+<booleanAttribute key="tracing" value="false"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+</listAttribute>
+<stringAttribute key="selected_target_plugins" value="com.ibm.icu,org.apache.ant,org.eclipse.ant.core,org.eclipse.core.contenttype,org.eclipse.core.expressions,org.eclipse.core.filesystem,org.eclipse.core.filesystem.win32.x86,org.eclipse.core.jobs,org.eclipse.core.resources,org.eclipse.core.resources.compatibility,org.eclipse.core.resources.win32,org.eclipse.core.runtime,org.eclipse.core.runtime.compatibility,org.eclipse.core.runtime.compatibility.auth,org.eclipse.core.runtime.compatibility.registry,org.eclipse.core.variables,org.eclipse.emf.common,org.eclipse.emf.ecore,org.eclipse.emf.ecore.change,org.eclipse.emf.ecore.edit,org.eclipse.emf.ecore.xmi,org.eclipse.emf.edit,org.eclipse.equinox.common,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.osgi,org.eclipse.update.configurator,org.junit"/>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="automaticValidate" value="true"/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<booleanAttribute key="automaticAdd" value="false"/>
+<stringAttribute key="checked" value="[NONE]"/>
+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.emf.cdo.jdbc,org.eclipse.net4j.spring,org.eclipse.net4j.socket,org.eclipse.net4j.core,org.eclipse.net4j.spring.db,org.eclipse.emf.cdo.dbgen,org.eclipse.emf.ocl,org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.mapping,org.eclipse.emf.cdo.core,org.eclipse.emf.cdo.client,org.eclipse.net4j.util,org.eclipse.emf.cdo.server,org.eclipse.emf.cdo.client.ocl,org.eclipse.net4j.embedded,org.eclipse.emf.cdo.jdbc.derby,org.eclipse.emf.cdo.dbgen.derby,org.eclipse.emf.cdo.dbgen.oracle,org.eclipse.emf.cdo.jdbc.hsqldb,org.eclipse.emf.cdo.jdbc.mysql,org.eclipse.emf.cdo.dbgen.ansi92,org.eclipse.emf.cdo.dbgen.mysql,org.eclipse.emf.cdo.dbgen.hsqldb"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="clearws" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.model1.AllModel1EmbeddedTests"/>
+<stringAttribute key="pde.version" value="3.2a"/>
+<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
+<booleanAttribute key="default" value="false"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.tests"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
+</launchConfiguration>
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AdapterTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AdapterTest.java
index 249375d..7900b70 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AdapterTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AdapterTest.java
@@ -22,6 +22,8 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.net4j.util.PropertiesHelper;
+
import testmodel1.TreeNode;
import java.util.Iterator;
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AllModel1EmbeddedTests.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AllModel1EmbeddedTests.java
new file mode 100644
index 0000000..ea60db6
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/AllModel1EmbeddedTests.java
@@ -0,0 +1,35 @@
+/***************************************************************************
+ * Copyright (c) 2004, 2005, 2006 Eike Stepper, Fuggerstr. 39, 10777 Berlin, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.emf.cdo.tests.model1;
+
+
+import org.eclipse.emf.cdo.tests.topology.ITopologyConstants;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+public class AllModel1EmbeddedTests implements ITopologyConstants
+{
+ public static Test suite()
+ {
+ System.setProperty(CDO_TEST_MODE_KEY, EMBEDDED_MODE);
+ TestSuite suite = new TestSuite("Embedded Test for org.eclipse.emf.cdo.tests.model1");
+ suite.addTestSuite(BasicTest.class);
+ suite.addTestSuite(AdapterTest.class);
+ suite.addTestSuite(SerializationTest.class);
+ suite.addTestSuite(NotificationTest.class);
+ suite.addTestSuite(ExtentTest.class);
+ suite.addTestSuite(OCLTest.class);
+ suite.addTestSuite(Bugzilla154389Test.class);
+ return suite;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/AbstractTopologyTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/AbstractTopologyTest.java
index b77c489..42e8b2e 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/AbstractTopologyTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/AbstractTopologyTest.java
@@ -29,18 +29,8 @@ import javax.sql.DataSource;
import junit.framework.TestCase;
-public abstract class AbstractTopologyTest extends TestCase
+public abstract class AbstractTopologyTest extends TestCase implements ITopologyConstants
{
- public static final String CDO_TEST_MODE_KEY = "cdo.test.mode";
-
- public static final String CLIENT_SEPARATED_SERVER_MODE = "client-separated-server";
-
- public static final String CLIENT_SERVER_MODE = "client-server";
-
- public static final String CLIENT_MODE = "client";
-
- public static final String EMBEDDED_MODE = "embedded";
-
private ITopology topology;
@Override
@@ -52,6 +42,7 @@ public abstract class AbstractTopologyTest extends TestCase
super.setUp();
topology = createTopology();
+ System.out.println("Topology: " + topology.getName());
topology.start();
}
@@ -68,6 +59,9 @@ public abstract class AbstractTopologyTest extends TestCase
System.out.println("TC_END " + getName());
System.out.println("=========================================================================");
System.out.println();
+ System.out.println();
+ System.out.println();
+ System.out.println();
}
protected void wipeDatabase(JdbcTemplate jdbc)
@@ -150,32 +144,33 @@ public abstract class AbstractTopologyTest extends TestCase
protected ITopology createTopology()
{
String mode = getMode();
- if (EMBEDDED_MODE.equals(mode))
+ if (EMBEDDED_MODE.equalsIgnoreCase(mode))
{
return new EmbeddedTopology();
}
- if (CLIENT_MODE.equals(mode))
+ if (CLIENT_MODE.equalsIgnoreCase(mode))
{
return new ClientTopology();
}
- if (CLIENT_SERVER_MODE.equals(mode))
+ if (CLIENT_SERVER_MODE.equalsIgnoreCase(mode))
{
return new ClientServerTopology();
}
- if (CLIENT_SEPARATED_SERVER_MODE.equals(mode))
+ if (CLIENT_SEPARATED_SERVER_MODE.equalsIgnoreCase(mode))
{
return new ClientSeparatedServerTopology();
}
- return null;
+ fail("Topology not recognized: " + mode);
+ return null; // Make compiler happy
}
protected String getMode()
{
- return System.getProperty(CDO_TEST_MODE_KEY, EMBEDDED_MODE).toLowerCase();
+ return System.getProperty(CDO_TEST_MODE_KEY, EMBEDDED_MODE);
}
protected void assertTrue(Object object)
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientSeparatedServerTopology.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientSeparatedServerTopology.java
index fc6146e..7b6364c 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientSeparatedServerTopology.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientSeparatedServerTopology.java
@@ -35,6 +35,11 @@ public class ClientSeparatedServerTopology extends AbstractTopology
{
}
+ public String getName()
+ {
+ return ITopologyConstants.CLIENT_SEPARATED_SERVER_MODE;
+ }
+
public void start() throws Exception
{
super.start();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientServerTopology.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientServerTopology.java
index d71aef9..2ff1808 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientServerTopology.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientServerTopology.java
@@ -33,6 +33,11 @@ public class ClientServerTopology extends AbstractTopology
{
}
+ public String getName()
+ {
+ return ITopologyConstants.CLIENT_SERVER_MODE;
+ }
+
public void start() throws Exception
{
super.start();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientTopology.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientTopology.java
index 3aad3b7..4648b97 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientTopology.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ClientTopology.java
@@ -26,6 +26,11 @@ public class ClientTopology extends AbstractTopology
{
}
+ public String getName()
+ {
+ return ITopologyConstants.CLIENT_MODE;
+ }
+
public void start() throws Exception
{
super.start();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/EmbeddedTopology.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/EmbeddedTopology.java
index 6b6b2eb..8268d50 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/EmbeddedTopology.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/EmbeddedTopology.java
@@ -11,25 +11,47 @@
package org.eclipse.emf.cdo.tests.topology;
+import org.eclipse.net4j.spring.Container;
+
import javax.sql.DataSource;
public class EmbeddedTopology extends AbstractTopology
{
+ private Container net4j;
+
+ private Container cdoServer;
+
+ private Container net4jEmbedded;
+
public EmbeddedTopology()
{
}
+ public String getName()
+ {
+ return ITopologyConstants.EMBEDDED_MODE;
+ }
+
public void start() throws Exception
{
+ super.start();
+ net4j = createContainer("net4j", NET4J_LOCATION, null);
+ net4jEmbedded = createContainer("embedded", NET4J_EMBEDDED_LOCATION, net4j);
+ cdoServer = createContainer("cdo-server", CDO_SERVER_LOCATION, net4jEmbedded);
+ createCDOClient("cdo-client", net4jEmbedded);
}
public void stop() throws Exception
{
+ super.stop();
+ cdoServer.stop();
+ net4jEmbedded.stop();
+ net4j.stop();
}
public DataSource getDataSource()
{
- return null;
+ return (DataSource) cdoServer.getBean("dataSource");
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopology.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopology.java
index 99a30b2..84ec2c1 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopology.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopology.java
@@ -20,6 +20,8 @@ import javax.sql.DataSource;
public interface ITopology
{
+ public String getName();
+
public void start() throws Exception;
public void stop() throws Exception;
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopologyConstants.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopologyConstants.java
new file mode 100644
index 0000000..b5e8174
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/topology/ITopologyConstants.java
@@ -0,0 +1,32 @@
+/***************************************************************************
+ * Copyright (c) 2004, 2005, 2006 Eike Stepper, Fuggerstr. 39, 10777 Berlin, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.emf.cdo.tests.topology;
+
+
+public interface ITopologyConstants
+{
+ public static final String CDO_TEST_MODE_KEY = "cdo.test.mode";
+
+ public static final String CLIENT_SEPARATED_SERVER_MODE = "Client-Separated-Server";
+
+ public static final String CLIENT_SERVER_MODE = "Client-Server";
+
+ public static final String CLIENT_MODE = "Client";
+
+ public static final String EMBEDDED_MODE = "Embedded";
+
+ public static final String[] ALL_MODES = { //
+ CLIENT_SEPARATED_SERVER_MODE, // 0
+ CLIENT_SERVER_MODE, // 1
+ CLIENT_MODE, // 2
+ EMBEDDED_MODE // 3
+ };
+}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/Net4jUtilPlugin.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/Net4jUtilPlugin.java
index e847def..330de79 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/Net4jUtilPlugin.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/Net4jUtilPlugin.java
@@ -26,6 +26,8 @@ public class Net4jUtilPlugin extends AbstractPlugin
//The shared instance.
private static Net4jUtilPlugin plugin;
+ private boolean inDebugMode;
+
/**
* The constructor.
*/
@@ -37,6 +39,7 @@ public class Net4jUtilPlugin extends AbstractPlugin
public void doStart() throws Exception
{
initializeLogger();
+ // determineDebugMode();
}
protected void doStop() throws Exception
@@ -72,4 +75,22 @@ public class Net4jUtilPlugin extends AbstractPlugin
logger.debug("Log4j initialized");
}
}
+
+ // private void determineDebugMode()
+ // {
+ // ServiceTracker environmentTracker = new ServiceTracker(getBundleContext(),
+ // EnvironmentInfo.class.getName(), null);
+ // environmentTracker.open();
+ // EnvironmentInfo environmentInfo = (EnvironmentInfo) environmentTracker.getService();
+ // environmentTracker.close();
+ //
+ // if (environmentInfo == null) throw new IllegalStateException("environmentInfo == null");
+ // inDebugMode = environmentInfo.inDebugMode();
+ // System.out.println("DEBUG MODE: " + inDebugMode);
+ // }
+ //
+ // public static boolean inDebugMode()
+ // {
+ // return getDefault().inDebugMode;
+ // }
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/PropertiesHelper.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/PropertiesHelper.java
new file mode 100644
index 0000000..1814944
--- /dev/null
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/PropertiesHelper.java
@@ -0,0 +1,47 @@
+package org.eclipse.net4j.util;
+
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import java.io.PrintStream;
+
+
+public final class PropertiesHelper
+{
+ private PropertiesHelper()
+ {
+ }
+
+ public static void dumpProperties()
+ {
+ dumpProperties(System.out);
+ }
+
+ public static void dumpProperties(PrintStream out)
+ {
+ List<String> props = getSortedProperties();
+ for (String prop : props)
+ {
+ out.println(prop);
+ }
+ }
+
+ public static List<String> getSortedProperties()
+ {
+ List<String> result = new ArrayList<String>();
+ Properties properties = System.getProperties();
+ for (Iterator it = properties.entrySet().iterator(); it.hasNext();)
+ {
+ Map.Entry<String, String> entry = (Map.Entry<String, String>) it.next();
+ result.add(entry.getKey() + " = " + entry.getValue());
+ }
+
+ Collections.sort(result);
+ return result;
+ }
+}