aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLazar Kirchev2011-10-19 03:58:59 (EDT)
committerLazar Kirchev2011-10-19 03:58:59 (EDT)
commit61b96b6e8095d80eab1707f38d6f4be9ec8d5023 (patch)
tree82263ef56d2c486afb97dc5b3af89ae4c8f94d48
parent98303bb1e9a65c56740a6e59da463c2c832a0c45 (diff)
downloadrt.equinox.bundles-61b96b6e8095d80eab1707f38d6f4be9ec8d5023.zip
rt.equinox.bundles-61b96b6e8095d80eab1707f38d6f4be9ec8d5023.tar.gz
rt.equinox.bundles-61b96b6e8095d80eab1707f38d6f4be9ec8d5023.tar.bz2
Decouple SSH functionality in separate bundle and fix tests accordingly.
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/.classpath8
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/.project28
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/.settings/org.eclipse.jdt.core.prefs8
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/META-INF/MANIFEST.MF12
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/build.properties4
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/hostkey.serbin0 -> 1201 bytes
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/org.eclipse.equinox.console.ssh.SshShellTests_store3
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/jaas/RolePrincipalTests.java (renamed from bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/jaas/RolePrincipalTests.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/jaas/UserPrincipalTests.java (renamed from bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/jaas/UserPrincipalTests.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/SshCommandTests.java (renamed from bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshCommandTests.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/SshCommandWithConfigAdminTests.java (renamed from bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshCommandWithConfigAdminTests.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/SshInputHandlerTests.java (renamed from bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshInputHandlerTests.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/SshInputScannerTests.java (renamed from bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshInputScannerTests.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/SshShellTests.java (renamed from bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshShellTests.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/UserAdminCommandTests.java (renamed from bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/UserAdminCommandTests.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/storage/DigestUtilTests.java (renamed from bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/storage/DigestUtilTests.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/storage/SecureUserStoreTests.java (renamed from bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/storage/SecureUserStoreTests.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/.classpath7
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/.project28
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/.settings/org.eclipse.jdt.core.prefs8
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/META-INF/MANIFEST.MF26
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/about.html28
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/build.properties5
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/jaas/RolePrincipal.java (renamed from bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/jaas/RolePrincipal.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/jaas/SecureStorageLoginModule.java (renamed from bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/jaas/SecureStorageLoginModule.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/jaas/UserPrincipal.java (renamed from bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/jaas/UserPrincipal.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/Activator.java83
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshCommand.java (renamed from bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshCommand.java)9
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshInputHandler.java (renamed from bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshInputHandler.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshInputScanner.java (renamed from bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshInputScanner.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshServ.java (renamed from bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshServ.java)7
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshSession.java (renamed from bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshSession.java)4
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshShell.java (renamed from bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshShell.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshShellFactory.java (renamed from bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshShellFactory.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/UserAdminCommand.java (renamed from bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/UserAdminCommand.java)2
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/storage/DigestUtil.java (renamed from bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/storage/DigestUtil.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/storage/SecureUserStore.java (renamed from bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/storage/SecureUserStore.java)0
-rwxr-xr-xbundles/org.eclipse.equinox.console.tests/.classpath1
-rwxr-xr-xbundles/org.eclipse.equinox.console.tests/META-INF/MANIFEST.MF2
-rwxr-xr-xbundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/common/HistoryHolderTests.java1
-rwxr-xr-xbundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshDisconnectCommandTests.java233
-rwxr-xr-xbundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/supportability/ConsoleInputHandlerTests.java1
-rwxr-xr-xbundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/supportability/ConsoleInputScannerTests.java1
-rwxr-xr-xbundles/org.eclipse.equinox.console/META-INF/MANIFEST.MF20
-rwxr-xr-xbundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/Activator.java12
-rwxr-xr-xbundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/common/ConsoleInputHandler.java (renamed from bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/supportability/ConsoleInputHandler.java)4
-rwxr-xr-xbundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/common/ConsoleInputScanner.java (renamed from bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/supportability/ConsoleInputScanner.java)6
-rwxr-xr-xbundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/common/HistoryHolder.java (renamed from bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/supportability/HistoryHolder.java)2
-rwxr-xr-xbundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/telnet/TelnetConnection.java5
49 files changed, 268 insertions, 290 deletions
diff --git a/bundles/org.eclipse.equinox.console.ssh.tests/.classpath b/bundles/org.eclipse.equinox.console.ssh.tests/.classpath
new file mode 100755
index 0000000..23f11b1
--- /dev/null
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.equinox.console.ssh.tests/.project b/bundles/org.eclipse.equinox.console.ssh.tests/.project
new file mode 100755
index 0000000..ffacebc
--- /dev/null
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.equinox.console.ssh.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.equinox.console.ssh.tests/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.console.ssh.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 0000000..c3a6274
--- /dev/null
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Tue Oct 18 16:14:30 EEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/bundles/org.eclipse.equinox.console.ssh.tests/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.console.ssh.tests/META-INF/MANIFEST.MF
new file mode 100755
index 0000000..20f5ae4
--- /dev/null
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Ssh Tests
+Bundle-SymbolicName: org.eclipse.equinox.console.ssh.tests
+Bundle-Version: 1.0.0.qualifier
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: junit.framework;version="4.8.1",
+ org.apache.sshd.client.future,
+ org.easymock;version="2.4.0",
+ org.junit;version="4.8.1"
+Fragment-Host: org.eclipse.equinox.console.ssh, org.eclipse.equinox.console
diff --git a/bundles/org.eclipse.equinox.console.ssh.tests/build.properties b/bundles/org.eclipse.equinox.console.ssh.tests/build.properties
new file mode 100755
index 0000000..34d2e4d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/bundles/org.eclipse.equinox.console.ssh.tests/hostkey.ser b/bundles/org.eclipse.equinox.console.ssh.tests/hostkey.ser
new file mode 100755
index 0000000..cb61e70
--- /dev/null
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/hostkey.ser
Binary files differ
diff --git a/bundles/org.eclipse.equinox.console.ssh.tests/org.eclipse.equinox.console.ssh.SshShellTests_store b/bundles/org.eclipse.equinox.console.ssh.tests/org.eclipse.equinox.console.ssh.SshShellTests_store
new file mode 100755
index 0000000..f80649d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/org.eclipse.equinox.console.ssh.SshShellTests_store
@@ -0,0 +1,3 @@
+#Wed Oct 19 10:21:35 EEST 2011
+/ssh/username/roles=
+/ssh/username/password=0d85584b3529eaac630d1b7ddde2418308d56317
diff --git a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/jaas/RolePrincipalTests.java b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/jaas/RolePrincipalTests.java
index edae26f..edae26f 100755
--- a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/jaas/RolePrincipalTests.java
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/jaas/RolePrincipalTests.java
diff --git a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/jaas/UserPrincipalTests.java b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/jaas/UserPrincipalTests.java
index 50239be..50239be 100755
--- a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/jaas/UserPrincipalTests.java
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/jaas/UserPrincipalTests.java
diff --git a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshCommandTests.java b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/SshCommandTests.java
index 7fab978..7fab978 100755
--- a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshCommandTests.java
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/SshCommandTests.java
diff --git a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshCommandWithConfigAdminTests.java b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/SshCommandWithConfigAdminTests.java
index 099442d..099442d 100755
--- a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshCommandWithConfigAdminTests.java
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/SshCommandWithConfigAdminTests.java
diff --git a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshInputHandlerTests.java b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/SshInputHandlerTests.java
index e7ed407..e7ed407 100755
--- a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshInputHandlerTests.java
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/SshInputHandlerTests.java
diff --git a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshInputScannerTests.java b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/SshInputScannerTests.java
index 5f246fb..5f246fb 100755
--- a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshInputScannerTests.java
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/SshInputScannerTests.java
diff --git a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshShellTests.java b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/SshShellTests.java
index 9c041fd..9c041fd 100755
--- a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshShellTests.java
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/SshShellTests.java
diff --git a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/UserAdminCommandTests.java b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/UserAdminCommandTests.java
index 6586901..6586901 100755
--- a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/UserAdminCommandTests.java
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/ssh/UserAdminCommandTests.java
diff --git a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/storage/DigestUtilTests.java b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/storage/DigestUtilTests.java
index d1a040b..d1a040b 100755
--- a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/storage/DigestUtilTests.java
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/storage/DigestUtilTests.java
diff --git a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/storage/SecureUserStoreTests.java b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/storage/SecureUserStoreTests.java
index 20062e1..20062e1 100755
--- a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/storage/SecureUserStoreTests.java
+++ b/bundles/org.eclipse.equinox.console.ssh.tests/src/org/eclipse/equinox/console/storage/SecureUserStoreTests.java
diff --git a/bundles/org.eclipse.equinox.console.ssh/.classpath b/bundles/org.eclipse.equinox.console.ssh/.classpath
new file mode 100755
index 0000000..ad32c83
--- /dev/null
+++ b/bundles/org.eclipse.equinox.console.ssh/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.equinox.console.ssh/.project b/bundles/org.eclipse.equinox.console.ssh/.project
new file mode 100755
index 0000000..a3f47b5
--- /dev/null
+++ b/bundles/org.eclipse.equinox.console.ssh/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.equinox.console.ssh</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.equinox.console.ssh/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.console.ssh/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 0000000..8b11af0
--- /dev/null
+++ b/bundles/org.eclipse.equinox.console.ssh/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Tue Oct 18 14:13:09 EEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/bundles/org.eclipse.equinox.console.ssh/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.console.ssh/META-INF/MANIFEST.MF
new file mode 100755
index 0000000..4efb150
--- /dev/null
+++ b/bundles/org.eclipse.equinox.console.ssh/META-INF/MANIFEST.MF
@@ -0,0 +1,26 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Console ssh support plug-in
+Bundle-SymbolicName: org.eclipse.equinox.console.ssh
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.equinox.console.ssh.Activator
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: javax.security.auth;resolution:=optional,
+ javax.security.auth.callback;resolution:=optional,
+ javax.security.auth.login;resolution:=optional,
+ javax.security.auth.spi;resolution:=optional,
+ org.apache.felix.service.command;status=provisional;version="0.8.0",
+ org.apache.sshd;version="0.5.0";resolution:=optional,
+ org.apache.sshd.common;version="0.5.0";resolution:=optional,
+ org.apache.sshd.server;version="0.5.0";resolution:=optional,
+ org.apache.sshd.server.jaas;version="0.5.0";resolution:=optional,
+ org.apache.sshd.server.keyprovider;version="0.5.0";resolution:=optional,
+ org.apache.sshd.server.session;version="0.5.0";resolution:=optional,
+ org.apache.sshd.server.shell;version="0.5.0";resolution:=optional,
+ org.eclipse.equinox.console.common,
+ org.eclipse.equinox.console.common.terminal,
+ org.osgi.framework;version="1.7.0",
+ org.osgi.service.cm;resolution:=optional,
+ org.osgi.util.tracker
+Export-Package: org.eclipse.equinox.console.jaas
diff --git a/bundles/org.eclipse.equinox.console.ssh/about.html b/bundles/org.eclipse.equinox.console.ssh/about.html
new file mode 100755
index 0000000..359fab5
--- /dev/null
+++ b/bundles/org.eclipse.equinox.console.ssh/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>January 10, 2011</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.console.ssh/build.properties b/bundles/org.eclipse.equinox.console.ssh/build.properties
new file mode 100755
index 0000000..dfb921b
--- /dev/null
+++ b/bundles/org.eclipse.equinox.console.ssh/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ about.html,\
+ .
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/jaas/RolePrincipal.java b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/jaas/RolePrincipal.java
index c5f8c4a..c5f8c4a 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/jaas/RolePrincipal.java
+++ b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/jaas/RolePrincipal.java
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/jaas/SecureStorageLoginModule.java b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/jaas/SecureStorageLoginModule.java
index 941fb17..941fb17 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/jaas/SecureStorageLoginModule.java
+++ b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/jaas/SecureStorageLoginModule.java
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/jaas/UserPrincipal.java b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/jaas/UserPrincipal.java
index 7af4162..7af4162 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/jaas/UserPrincipal.java
+++ b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/jaas/UserPrincipal.java
diff --git a/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/Activator.java b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/Activator.java
new file mode 100755
index 0000000..d982bac
--- /dev/null
+++ b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/Activator.java
@@ -0,0 +1,83 @@
+package org.eclipse.equinox.console.ssh;
+
+import org.apache.felix.service.command.CommandProcessor;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+import org.osgi.util.tracker.ServiceTrackerCustomizer;
+
+public class Activator implements BundleActivator {
+
+ private static BundleContext context;
+ private static SshCommand sshConnection = null;
+ private static boolean isFirstProcessor = true;
+
+ private ServiceTracker<CommandProcessor, SshCommand> commandProcessorTracker;
+
+ public static class ProcessorCustomizer implements ServiceTrackerCustomizer<CommandProcessor, SshCommand> {
+
+ private final BundleContext context;
+
+ public ProcessorCustomizer(BundleContext context) {
+ this.context = context;
+ }
+
+ public SshCommand addingService(ServiceReference<CommandProcessor> reference) {
+ CommandProcessor processor = context.getService(reference);
+ if (processor == null)
+ return null;
+
+ if (isFirstProcessor) {
+ isFirstProcessor = false;
+ sshConnection = new SshCommand(processor, context);
+ sshConnection.start();
+ } else {
+ sshConnection.addCommandProcessor(processor);
+ }
+
+ return sshConnection;
+ }
+
+ public void modifiedService(
+ ServiceReference<CommandProcessor> reference,
+ SshCommand service) {
+ // nothing
+ }
+
+ public void removedService(ServiceReference<CommandProcessor> reference, SshCommand service) {
+ CommandProcessor processor = context.getService(reference);
+ service.removeCommandProcessor(processor);
+ }
+ }
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ context = bundleContext;
+ commandProcessorTracker = new ServiceTracker<CommandProcessor, SshCommand>(context, CommandProcessor.class, new ProcessorCustomizer(context));
+ commandProcessorTracker.open();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ commandProcessorTracker.close();
+
+ try {
+ sshConnection.ssh(new String[]{"stop"});
+ } catch (Exception e) {
+ // expected if the ssh server is not started
+ }
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshCommand.java b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshCommand.java
index 136509a..64440ad 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshCommand.java
+++ b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshCommand.java
@@ -161,14 +161,7 @@ public class SshCommand {
checkPortAvailable(port);
- try {
- sshServ = new SshServ(processors, context, host, port);
- } catch (NoClassDefFoundError e) {
- // ssh server bundles are optional and may not be available
- System.out.println("SSH bundles not available! If you want to use SSH, please install Apache sshd-core, Apache mina-core, slf4j-api and a slf4j logger implementation bundles");
- sshServ = null;
- return;
- }
+ sshServ = new SshServ(processors, context, host, port);
sshServ.setName("equinox ssh");
if ("true".equals(context.getProperty(DEFAULT_USER_STORE_PROPERTY))) {
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshInputHandler.java b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshInputHandler.java
index d1b2eb7..d1b2eb7 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshInputHandler.java
+++ b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshInputHandler.java
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshInputScanner.java b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshInputScanner.java
index f0c88a9..f0c88a9 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshInputScanner.java
+++ b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshInputScanner.java
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshServ.java b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshServ.java
index a8cfed6..088a31f 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshServ.java
+++ b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshServ.java
@@ -42,12 +42,7 @@ public class SshServ extends Thread {
}
public void run() throws RuntimeException {
- try {
- sshServer = SshServer.setUpDefaultServer();
- } catch (NoClassDefFoundError e1) {
- System.out.println("SSH bundles not available! If you want to use SSH, please install Apache sshd-core, Apache mina-core, slf4j-api and a slf4j logger implementation bundles");
- throw new RuntimeException("SSH bundles not available");
- }
+ sshServer = SshServer.setUpDefaultServer();
if (host != null) {
sshServer.setHost(host);
}
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshSession.java b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshSession.java
index fe78733..2420278 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshSession.java
+++ b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshSession.java
@@ -24,8 +24,8 @@ import org.eclipse.equinox.console.common.ConsoleOutputStream;
import org.eclipse.equinox.console.common.KEYS;
import org.eclipse.equinox.console.common.terminal.TerminalTypeMappings;
import org.eclipse.equinox.console.storage.SecureUserStore;
-import org.eclipse.equinox.console.supportability.ConsoleInputHandler;
-import org.eclipse.equinox.console.supportability.ConsoleInputScanner;
+import org.eclipse.equinox.console.common.ConsoleInputHandler;
+import org.eclipse.equinox.console.common.ConsoleInputScanner;
import org.osgi.framework.BundleContext;
/**
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshShell.java b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshShell.java
index f1f4839..f1f4839 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshShell.java
+++ b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshShell.java
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshShellFactory.java b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshShellFactory.java
index 82b7964..82b7964 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/SshShellFactory.java
+++ b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshShellFactory.java
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/UserAdminCommand.java b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/UserAdminCommand.java
index 4a57da6..cdf9b46 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/ssh/UserAdminCommand.java
+++ b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/UserAdminCommand.java
@@ -22,7 +22,7 @@ import org.apache.felix.service.command.Descriptor;
import org.eclipse.equinox.console.common.Scanner;
import org.eclipse.equinox.console.storage.DigestUtil;
import org.eclipse.equinox.console.storage.SecureUserStore;
-import org.eclipse.equinox.console.supportability.ConsoleInputScanner;
+import org.eclipse.equinox.console.common.ConsoleInputScanner;
/**
* This class provides commands for administering users: adding, removing and listing users; setting or changing password;
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/storage/DigestUtil.java b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/storage/DigestUtil.java
index fec76ba..fec76ba 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/storage/DigestUtil.java
+++ b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/storage/DigestUtil.java
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/storage/SecureUserStore.java b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/storage/SecureUserStore.java
index dc6bde7..dc6bde7 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/storage/SecureUserStore.java
+++ b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/storage/SecureUserStore.java
diff --git a/bundles/org.eclipse.equinox.console.tests/.classpath b/bundles/org.eclipse.equinox.console.tests/.classpath
index 64c5e31..a7d4b62 100755
--- a/bundles/org.eclipse.equinox.console.tests/.classpath
+++ b/bundles/org.eclipse.equinox.console.tests/.classpath
@@ -3,5 +3,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.equinox.console.tests/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.console.tests/META-INF/MANIFEST.MF
index 4e3fc8a..aa559b3 100755
--- a/bundles/org.eclipse.equinox.console.tests/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.console.tests/META-INF/MANIFEST.MF
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: Console supportability tests
+Bundle-Name: Console tests
Bundle-SymbolicName: org.eclipse.equinox.console.tests
Bundle-Version: 1.0.0.qualifier
Bundle-ActivationPolicy: lazy
diff --git a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/common/HistoryHolderTests.java b/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/common/HistoryHolderTests.java
index c6321a6..5ee9bba 100755
--- a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/common/HistoryHolderTests.java
+++ b/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/common/HistoryHolderTests.java
@@ -14,7 +14,6 @@ package org.eclipse.equinox.console.common;
import org.junit.Assert;
import org.junit.Test;
-import org.eclipse.equinox.console.supportability.HistoryHolder;
public class HistoryHolderTests {
diff --git a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshDisconnectCommandTests.java b/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshDisconnectCommandTests.java
deleted file mode 100755
index 1d86b80..0000000
--- a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/ssh/SshDisconnectCommandTests.java
+++ /dev/null
@@ -1,233 +0,0 @@
-package org.eclipse.equinox.console.ssh;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PipedInputStream;
-import java.io.PipedOutputStream;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.io.StringBufferInputStream;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.util.Dictionary;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.felix.service.command.CommandProcessor;
-import org.apache.felix.service.command.CommandSession;
-import org.apache.sshd.ClientChannel;
-import org.apache.sshd.ClientSession;
-import org.apache.sshd.SshClient;
-import org.apache.sshd.client.future.ConnectFuture;
-import org.apache.sshd.client.future.DefaultConnectFuture;
-import org.apache.sshd.server.Environment;
-import org.easymock.EasyMock;
-import org.easymock.IAnswer;
-import org.eclipse.equinox.console.commands.DisconnectCommand;
-import org.eclipse.equinox.console.common.ConsoleInputStream;
-import org.eclipse.equinox.console.storage.DigestUtil;
-import org.eclipse.equinox.console.storage.SecureUserStore;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.osgi.framework.BundleContext;
-
-public class SshDisconnectCommandTests {
- private static final int TEST_CONTENT = 100;
- private static final String USER_STORE_FILE_NAME = "org.eclipse.equinox.console.jaas.file";
- private static final String JAAS_CONFIG_FILE_NAME = "jaas.config";
- private static final String JAAS_CONFIG_PROPERTY_NAME = "java.security.auth.login.config";
- private static final String DEFAULT_USER_STORAGE = "osgi.console.ssh.useDefaultSecureStorage";
- private static final String USE_CONFIG_ADMIN_PROP = "osgi.console.useConfigAdmin";
- private static final String SSH_PORT_PROP_NAME = "osgi.console.ssh";
- private static final String STORE_FILE_NAME = SshCommandTests.class.getName() + "_store";
- private static final String GOGO_SHELL_COMMAND = "gosh --login --noshutdown";
- private static final String TRUE = "true";
- private static final String FALSE = "false";
- private static final String USERNAME = "username";
- private static final String PASSWORD = "password";
- private static final String START_COMMAND = "start";
- private static final String STOP_COMMAND = "stop";
- private static final String TERM_PROPERTY = "TERM";
- private static final String XTERM = "XTERM";
- private static final String HOST = "localhost";
- private static final int SSH_PORT = 2222;
- private static final long WAIT_TIME = 5000;
- private SshSession sshSession;
- private InputStream in;
-
- @Before
- public void init() throws Exception {
- clean();
- initStore();
- initJaasConfigFile();
- }
-
- @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());
- EasyMock.expectLastCall();
- session.put((String)EasyMock.anyObject(), EasyMock.anyObject());
- EasyMock.expectLastCall();
- session.put((String)EasyMock.anyObject(), EasyMock.anyObject());
- EasyMock.expectLastCall();
- session.put((String)EasyMock.anyObject(), EasyMock.anyObject());
- EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
-
- public Object answer() throws Throwable {
- sshSession = (SshSession)EasyMock.getCurrentArguments()[1];
- return null;
- }
-
- });
- EasyMock.expect(session.execute(GOGO_SHELL_COMMAND)).andReturn(null);
- EasyMock.expect(session.get("CLOSEABLE")).andReturn(sshSession);
- session.close();
- EasyMock.expectLastCall().atLeastOnce();
- EasyMock.replay(session);
-
- CommandProcessor processor = EasyMock.createMock(CommandProcessor.class);
- EasyMock.expect(processor.createSession((ConsoleInputStream)EasyMock.anyObject(), (PrintStream)EasyMock.anyObject(), (PrintStream)EasyMock.anyObject())).andReturn(session);
- 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));
- EasyMock.expect(context.registerService((String)EasyMock.anyObject(), EasyMock.anyObject(), (Dictionary<String, ?>)EasyMock.anyObject())).andReturn(null);
- EasyMock.replay(context);
-
- Map<String, String> environment = new HashMap<String, String>();
- environment.put(TERM_PROPERTY, XTERM);
- Environment env = EasyMock.createMock(Environment.class);
- EasyMock.expect(env.getEnv()).andReturn(environment);
- EasyMock.replay(env);
-
- SshCommand command = new SshCommand(processor, context);
- command.ssh(new String[] {START_COMMAND});
-
- SshClient client = SshClient.setUpDefaultClient();
- client.start();
- try {
- ConnectFuture connectFuture = client.connect(HOST, SSH_PORT);
- DefaultConnectFuture defaultConnectFuture = (DefaultConnectFuture) connectFuture;
-
- try {
- Thread.sleep(WAIT_TIME);
- } catch (InterruptedException ie) {
- // do nothing
- }
- ClientSession sshSession = defaultConnectFuture.getSession();
-
- int ret = ClientSession.WAIT_AUTH;
- sshSession.authPassword(USERNAME, PASSWORD);
- ret = sshSession.waitFor(ClientSession.WAIT_AUTH | ClientSession.CLOSED | ClientSession.AUTHED, 0);
-
- if ((ret & ClientSession.CLOSED) != 0) {
- System.err.println("error");
- System.exit(-1);
- }
- ClientChannel channel = sshSession.createChannel("shell");
-
- PipedOutputStream outputStream = new PipedOutputStream();
- PipedInputStream inputStream = new PipedInputStream(outputStream);
-
- final DisconnectCommand disconnectCommand = new DisconnectCommand(context);
- in = System.in;
- System.setIn(inputStream);
-
- ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
- channel.setIn(new StringBufferInputStream(TEST_CONTENT + "\n"));
- channel.setOut(byteOut);
- channel.setErr(byteOut);
- channel.open();
-
-
- new Thread() {
- public void run() {
- disconnectCommand.disconnect(session);
- }
- }.start();
-
- outputStream.write(new byte[]{'y'});
- outputStream.write('\n');
- outputStream.flush();
-
- Thread.sleep(WAIT_TIME);
-
- try {
- Thread.sleep(WAIT_TIME);
- } catch (InterruptedException ie) {
- // do nothing
- }
-
- try {
- outputStream.write(TEST_CONTENT);
- outputStream.write('\n');
- outputStream.flush();
- Assert.fail("Connection not closed");
- } catch (Exception e) {
- // we should be here
- }
- sshSession.close(true);
- } finally {
- client.stop();
- }
-
- command.ssh(new String[] {STOP_COMMAND});
- return;
- }
-
- @After
- public void cleanUp() {
- clean();
- }
-
- private void clean() {
- System.setProperty(USER_STORE_FILE_NAME, "");
- File file = new File(STORE_FILE_NAME);
- if (file.exists()) {
- file.delete();
- }
-
- System.setProperty(JAAS_CONFIG_PROPERTY_NAME, "");
- File jaasConfFile = new File(JAAS_CONFIG_FILE_NAME);
- if (jaasConfFile.exists()) {
- jaasConfFile.delete();
- }
-
- System.setIn(in);
- }
-
- private void initStore() throws Exception {
- System.setProperty(USER_STORE_FILE_NAME, STORE_FILE_NAME);
- SecureUserStore.initStorage();
- SecureUserStore.putUser(USERNAME, DigestUtil.encrypt(PASSWORD), null);
- }
-
- private void initJaasConfigFile() throws Exception {
- System.setProperty(JAAS_CONFIG_PROPERTY_NAME, JAAS_CONFIG_FILE_NAME);
- File jaasConfFile = new File(JAAS_CONFIG_FILE_NAME);
- if (!jaasConfFile.exists()) {
- PrintWriter out = null;
- try {
- out = new PrintWriter(jaasConfFile);
- out.println("equinox_console {");
- out.println(" org.eclipse.equinox.console.jaas.SecureStorageLoginModule REQUIRED;");
- out.println("};");
- } finally {
- if (out != null) {
- out.close();
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/supportability/ConsoleInputHandlerTests.java b/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/supportability/ConsoleInputHandlerTests.java
index ad45990..e595b62 100755
--- a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/supportability/ConsoleInputHandlerTests.java
+++ b/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/supportability/ConsoleInputHandlerTests.java
@@ -11,6 +11,7 @@
package org.eclipse.equinox.console.supportability;
+import org.eclipse.equinox.console.common.ConsoleInputHandler;
import org.eclipse.equinox.console.common.ConsoleInputStream;
import org.junit.Assert;
import org.junit.Test;
diff --git a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/supportability/ConsoleInputScannerTests.java b/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/supportability/ConsoleInputScannerTests.java
index 2240e2c..d03838c 100755
--- a/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/supportability/ConsoleInputScannerTests.java
+++ b/bundles/org.eclipse.equinox.console.tests/src/org/eclipse/equinox/console/supportability/ConsoleInputScannerTests.java
@@ -16,6 +16,7 @@ import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import org.apache.felix.service.command.CommandSession;
+import org.eclipse.equinox.console.common.ConsoleInputScanner;
import org.eclipse.equinox.console.common.ConsoleInputStream;
import org.eclipse.equinox.console.common.ConsoleOutputStream;
import org.eclipse.equinox.console.common.KEYS;
diff --git a/bundles/org.eclipse.equinox.console/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.console/META-INF/MANIFEST.MF
index d744dd6..5a0b9ec 100755
--- a/bundles/org.eclipse.equinox.console/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.console/META-INF/MANIFEST.MF
@@ -1,23 +1,12 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: Console supportability plug-in
+Bundle-Name: Console plug-in
Bundle-SymbolicName: org.eclipse.equinox.console
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.eclipse.equinox.console.command.adapter.Activator
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: javax.security.auth;resolution:=optional,
- javax.security.auth.callback;resolution:=optional,
- javax.security.auth.login;resolution:=optional,
- javax.security.auth.spi;resolution:=optional,
- org.apache.felix.service.command;status=provisional;version="0.8.0",
- org.apache.sshd;version="0.5.0";resolution:=optional,
- org.apache.sshd.common;version="0.5.0";resolution:=optional,
- org.apache.sshd.server;version="0.5.0";resolution:=optional,
- org.apache.sshd.server.jaas;version="0.5.0";resolution:=optional,
- org.apache.sshd.server.keyprovider;version="0.5.0";resolution:=optional,
- org.apache.sshd.server.session;version="0.5.0";resolution:=optional,
- org.apache.sshd.server.shell;version="0.5.0";resolution:=optional,
+Import-Package: org.apache.felix.service.command;status=provisional;version="0.8.0",
org.eclipse.osgi.framework.console,
org.eclipse.osgi.service.environment,
org.eclipse.osgi.service.resolver,
@@ -29,5 +18,6 @@ Import-Package: javax.security.auth;resolution:=optional,
org.osgi.service.permissionadmin,
org.osgi.service.startlevel,
org.osgi.util.tracker
-Export-Package: org.eclipse.equinox.console.completion.common,
- org.eclipse.equinox.console.jaas
+Export-Package: org.eclipse.equinox.console.common,
+ org.eclipse.equinox.console.common.terminal,
+ org.eclipse.equinox.console.completion.common
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/Activator.java b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/Activator.java
index fbc3df2..fc12e65 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/Activator.java
+++ b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/Activator.java
@@ -27,7 +27,6 @@ import org.eclipse.equinox.console.commands.DisconnectCommand;
import org.eclipse.equinox.console.commands.EquinoxCommandProvider;
import org.eclipse.equinox.console.commands.HelpCommand;
import org.eclipse.equinox.console.commands.ManCommand;
-import org.eclipse.equinox.console.ssh.SshCommand;
import org.eclipse.equinox.console.telnet.TelnetCommand;
import org.eclipse.osgi.framework.console.CommandInterpreter;
import org.eclipse.osgi.framework.console.CommandProvider;
@@ -57,7 +56,6 @@ public class Activator implements BundleActivator {
private ServiceTracker<PlatformAdmin, ?> platformAdminTracker;
private static boolean isFirstProcessor = true;
private static TelnetCommand telnetConnection = null;
- private static SshCommand sshConnection = null;
private ServiceTracker<CommandProcessor, ServiceTracker<ConsoleSession, CommandSession>> commandProcessorTracker;
// Tracker for Equinox CommandProviders
@@ -84,11 +82,8 @@ public class Activator implements BundleActivator {
isFirstProcessor = false;
telnetConnection = new TelnetCommand(processor, context);
telnetConnection.start();
- sshConnection = new SshCommand(processor, context);
- sshConnection.start();
} else {
telnetConnection.addCommandProcessor(processor);
- sshConnection.addCommandProcessor(processor);
}
ServiceTracker<ConsoleSession, CommandSession> tracker = new ServiceTracker<ConsoleSession, CommandSession>(context, ConsoleSession.class, new SessionCustomizer(context, processor));
@@ -108,7 +103,6 @@ public class Activator implements BundleActivator {
tracker.close();
CommandProcessor processor = context.getService(reference);
telnetConnection.removeCommandProcessor(processor);
- sshConnection.removeCommandProcessor(processor);
}
}
@@ -330,11 +324,5 @@ public class Activator implements BundleActivator {
// expected if the telnet server is not started
}
- try {
- sshConnection.ssh(new String[]{"stop"});
- } catch (Exception e) {
- // expected if the ssh server is not started
- }
-
}
}
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/supportability/ConsoleInputHandler.java b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/common/ConsoleInputHandler.java
index 45add08..4e64c59 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/supportability/ConsoleInputHandler.java
+++ b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/common/ConsoleInputHandler.java
@@ -9,13 +9,11 @@
* Lazar Kirchev, SAP AG - initial API and implementation
* IBM Corporation - ongoing development
*******************************************************************************/
-package org.eclipse.equinox.console.supportability;
+package org.eclipse.equinox.console.common;
import java.io.InputStream;
import java.io.OutputStream;
-import org.eclipse.equinox.console.common.ConsoleInputStream;
-import org.eclipse.equinox.console.common.InputHandler;
/**
* This class customizes the generic handler with a concrete content processor,
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/supportability/ConsoleInputScanner.java b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/common/ConsoleInputScanner.java
index e9e47fb..3ee1bfe 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/supportability/ConsoleInputScanner.java
+++ b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/common/ConsoleInputScanner.java
@@ -9,7 +9,7 @@
* Lazar Kirchev, SAP AG - initial API and implementation
*******************************************************************************/
-package org.eclipse.equinox.console.supportability;
+package org.eclipse.equinox.console.common;
import java.io.IOException;
import java.io.OutputStream;
@@ -18,10 +18,6 @@ import java.util.Map;
import java.util.Set;
import org.apache.felix.service.command.CommandSession;
-import org.eclipse.equinox.console.common.ConsoleInputStream;
-import org.eclipse.equinox.console.common.KEYS;
-import org.eclipse.equinox.console.common.Scanner;
-import org.eclipse.equinox.console.common.SimpleByteBuffer;
import org.eclipse.equinox.console.completion.CompletionHandler;
import org.osgi.framework.BundleContext;
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/supportability/HistoryHolder.java b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/common/HistoryHolder.java
index 52bdd42..1e304b5 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/supportability/HistoryHolder.java
+++ b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/common/HistoryHolder.java
@@ -9,7 +9,7 @@
* Lazar Kirchev, SAP AG - initial API and implementation
*******************************************************************************/
-package org.eclipse.equinox.console.supportability;
+package org.eclipse.equinox.console.common;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/telnet/TelnetConnection.java b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/telnet/TelnetConnection.java
index 56802cf..cfdf098 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/telnet/TelnetConnection.java
+++ b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/telnet/TelnetConnection.java
@@ -17,9 +17,10 @@ import java.net.Socket;
import org.apache.felix.service.command.CommandProcessor;
import org.apache.felix.service.command.CommandSession;
import java.io.Closeable;
+
+import org.eclipse.equinox.console.common.ConsoleInputHandler;
+import org.eclipse.equinox.console.common.ConsoleInputScanner;
import org.eclipse.equinox.console.common.ConsoleInputStream;
-import org.eclipse.equinox.console.supportability.ConsoleInputHandler;
-import org.eclipse.equinox.console.supportability.ConsoleInputScanner;
import org.osgi.framework.BundleContext;
/**