summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authori0328702011-08-15 04:39:04 (EDT)
committeri0328702011-08-15 04:39:04 (EDT)
commit50c7f09bad8d1db3faacabd0b646b89850726915 (patch)
treeaa7f8460ac898a22d1d3df25b5e998ed0d6f6407
parentbd46f4b6673037b844483ca289c71e685b9b6050 (diff)
downloadrt.equinox.incubator-50c7f09bad8d1db3faacabd0b646b89850726915.zip
rt.equinox.incubator-50c7f09bad8d1db3faacabd0b646b89850726915.tar.gz
rt.equinox.incubator-50c7f09bad8d1db3faacabd0b646b89850726915.tar.bz2
Fixes bug 354716 for equinox:help command not working and updates the tests to explicitely define mock objects as multithreaded
-rw-r--r--console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshCommandTests.java2
-rw-r--r--console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshCommandWithConfigAdminTests.java2
-rw-r--r--console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshDisconnectCommand.java2
-rw-r--r--console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshShellTests.java2
-rw-r--r--console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/telnet/TelnetDisconnectionTest.java1
-rw-r--r--console/org.eclipse.equinox.console.supportability/src/org/eclipse/equinox/console/command/adapter/Activator.java2
6 files changed, 10 insertions, 1 deletions
diff --git a/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshCommandTests.java b/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshCommandTests.java
index 18849d1..76212e1 100644
--- a/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshCommandTests.java
+++ b/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshCommandTests.java
@@ -71,6 +71,7 @@ public class SshCommandTests {
@Test
public void testSshCommand() throws Exception {
CommandSession session = EasyMock.createMock(CommandSession.class);
+ EasyMock.makeThreadSafe(session, true);
session.put((String)EasyMock.anyObject(), EasyMock.anyObject());
EasyMock.expectLastCall().times(4);
EasyMock.expect(session.execute(GOGO_SHELL_COMMAND)).andReturn(null);
@@ -83,6 +84,7 @@ public class SshCommandTests {
EasyMock.replay(processor);
BundleContext context = EasyMock.createMock(BundleContext.class);
+ EasyMock.makeThreadSafe(context, true);
EasyMock.expect(context.getProperty(USE_CONFIG_ADMIN_PROP)).andReturn(FALSE);
EasyMock.expect(context.getProperty(DEFAULT_USER_STORAGE)).andReturn(TRUE).anyTimes();
EasyMock.expect(context.getProperty(SSH_PORT_PROP_NAME)).andReturn(Integer.toString(SSH_PORT));
diff --git a/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshCommandWithConfigAdminTests.java b/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshCommandWithConfigAdminTests.java
index 3679311..09a585b 100644
--- a/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshCommandWithConfigAdminTests.java
+++ b/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshCommandWithConfigAdminTests.java
@@ -75,6 +75,7 @@ public class SshCommandWithConfigAdminTests {
public void testSshCommandWithConfigAdmin() throws Exception {
CommandSession session = EasyMock.createMock(CommandSession.class);
+ EasyMock.makeThreadSafe(session, true);
session.put((String)EasyMock.anyObject(), EasyMock.anyObject());
EasyMock.expectLastCall().times(4);
EasyMock.expect(session.execute(GOGO_SHELL_COMMAND)).andReturn(null);
@@ -92,6 +93,7 @@ public class SshCommandWithConfigAdminTests {
EasyMock.replay(registration);
BundleContext context = EasyMock.createMock(BundleContext.class);
+ EasyMock.makeThreadSafe(context, true);
EasyMock.expect(context.getProperty(USE_CONFIG_ADMIN_PROP)).andReturn(TRUE);
EasyMock.expect(context.getProperty(DEFAULT_USER_STORAGE)).andReturn(TRUE).anyTimes();
EasyMock.expect(
diff --git a/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshDisconnectCommand.java b/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshDisconnectCommand.java
index 0ce33a8..91eb454 100644
--- a/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshDisconnectCommand.java
+++ b/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshDisconnectCommand.java
@@ -69,6 +69,7 @@ public class SshDisconnectCommand {
@Test
public void testSshCommand() throws Exception {
final CommandSession session = EasyMock.createMock(CommandSession.class);
+ EasyMock.makeThreadSafe(session, true);
session.put((String)EasyMock.anyObject(), EasyMock.anyObject());
EasyMock.expectLastCall();
session.put((String)EasyMock.anyObject(), EasyMock.anyObject());
@@ -96,6 +97,7 @@ public class SshDisconnectCommand {
EasyMock.replay(processor);
BundleContext context = EasyMock.createMock(BundleContext.class);
+ EasyMock.makeThreadSafe(context, true);
EasyMock.expect(context.getProperty(USE_CONFIG_ADMIN_PROP)).andReturn(FALSE);
EasyMock.expect(context.getProperty(DEFAULT_USER_STORAGE)).andReturn(TRUE).anyTimes();
EasyMock.expect(context.getProperty(SSH_PORT_PROP_NAME)).andReturn(Integer.toString(SSH_PORT));
diff --git a/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshShellTests.java b/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshShellTests.java
index e0619d9..79a96c9 100644
--- a/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshShellTests.java
+++ b/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/ssh/SshShellTests.java
@@ -70,6 +70,7 @@ public class SshShellTests {
socketServer = servSocket.accept();
CommandSession session = EasyMock.createMock(CommandSession.class);
+ EasyMock.makeThreadSafe(session, true);
session.put((String)EasyMock.anyObject(), EasyMock.anyObject());
EasyMock.expectLastCall().times(4);
EasyMock.expect(session.execute(GOGO_SHELL_COMMAND)).andReturn(null);
@@ -82,6 +83,7 @@ public class SshShellTests {
EasyMock.replay(processor);
BundleContext context = EasyMock.createMock(BundleContext.class);
+ EasyMock.makeThreadSafe(context, true);
EasyMock.expect(context.getProperty(DEFAULT_USER_STORAGE)).andReturn(TRUE);
EasyMock.replay(context);
diff --git a/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/telnet/TelnetDisconnectionTest.java b/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/telnet/TelnetDisconnectionTest.java
index 58f3a30..7f7fb2e 100644
--- a/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/telnet/TelnetDisconnectionTest.java
+++ b/console/org.eclipse.equinox.console.supportability.tests/src/org/eclipse/equinox/console/telnet/TelnetDisconnectionTest.java
@@ -39,6 +39,7 @@ public class TelnetDisconnectionTest {
connection = new TelnetConnection(socketServer, processor, null);
final CommandSession session = EasyMock.createMock(CommandSession.class);
+ EasyMock.makeThreadSafe(session, true);
session.put((String)EasyMock.anyObject(), EasyMock.anyObject());
EasyMock.expectLastCall().times(4);
EasyMock.expect(session.get("CLOSEABLE")).andReturn(connection);
diff --git a/console/org.eclipse.equinox.console.supportability/src/org/eclipse/equinox/console/command/adapter/Activator.java b/console/org.eclipse.equinox.console.supportability/src/org/eclipse/equinox/console/command/adapter/Activator.java
index 89586f3..9ba4829 100644
--- a/console/org.eclipse.equinox.console.supportability/src/org/eclipse/equinox/console/command/adapter/Activator.java
+++ b/console/org.eclipse.equinox.console.supportability/src/org/eclipse/equinox/console/command/adapter/Activator.java
@@ -265,7 +265,7 @@ public class Activator implements BundleActivator {
Method[] methods = c.getDeclaredMethods();
for (Method method : methods) {
if (method.getName().startsWith("_")
- && method.getModifiers() == Modifier.PUBLIC) {
+ && method.getModifiers() == Modifier.PUBLIC && !method.getName().equals("_help")) {
Type[] types = method.getGenericParameterTypes();
if (types.length == 1
&& types[0].equals(CommandInterpreter.class)) {