Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 252060 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/rse/tests/subsystems/shells/ShellServiceTest.java (+33 lines)
Lines 11-16 Link Here
11
 *******************************************************************************/
11
 *******************************************************************************/
12
package org.eclipse.rse.tests.subsystems.shells;
12
package org.eclipse.rse.tests.subsystems.shells;
13
13
14
import java.io.BufferedReader;
15
import java.io.IOException;
16
import java.io.InputStreamReader;
14
import java.lang.reflect.Method;
17
import java.lang.reflect.Method;
15
18
16
import junit.framework.Test;
19
import junit.framework.Test;
Lines 22-27 Link Here
22
import org.eclipse.rse.core.model.IHost;
25
import org.eclipse.rse.core.model.IHost;
23
import org.eclipse.rse.core.subsystems.ISubSystem;
26
import org.eclipse.rse.core.subsystems.ISubSystem;
24
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
27
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
28
import org.eclipse.rse.services.shells.HostShellProcessAdapter;
25
import org.eclipse.rse.services.shells.IHostOutput;
29
import org.eclipse.rse.services.shells.IHostOutput;
26
import org.eclipse.rse.services.shells.IHostShell;
30
import org.eclipse.rse.services.shells.IHostShell;
27
import org.eclipse.rse.services.shells.IShellService;
31
import org.eclipse.rse.services.shells.IShellService;
Lines 73-78 Link Here
73
77
74
		// // Add a test suite for each connection type
78
		// // Add a test suite for each connection type
75
		String[] connTypes = { "local", "ssh", "telnet" };
79
		String[] connTypes = { "local", "ssh", "telnet" };
80
//		String[] connTypes = { "local", "ssh"};
76
81
77
		for (int i = 0; i < connTypes.length; i++) {
82
		for (int i = 0; i < connTypes.length; i++) {
78
			String suiteName = connTypes[i];
83
			String suiteName = connTypes[i];
Lines 173-176 Link Here
173
		assertTrue(matchFound);
178
		assertTrue(matchFound);
174
	}
179
	}
175
180
181
	public void testRunCommandViaHostShellProcessAdapter() throws Exception {
182
		IHostShell hostShell = null;
183
		hostShell = shellService.runCommand("", "echo test"
184
				+ shellSubSystem.getParentRemoteCmdSubSystemConfiguration()
185
						.getCommandSeparator() + " exit", new String[] {}, mon);
186
		HostShellProcessAdapter p = null;
187
		try {
188
			p = new HostShellProcessAdapter(hostShell);
189
		} catch (Exception e) {
190
			fail(e.getMessage());
191
			return;
192
		}
193
		BufferedReader bufferReader = new BufferedReader(new InputStreamReader(
194
				p.getInputStream()));
195
196
		String nextLine;
197
		boolean matchFound = false;
198
		try {
199
			while ((nextLine = bufferReader.readLine()) != null) {
200
				matchFound = nextLine.equals("test");
201
			}
202
			bufferReader.close();
203
		} catch (IOException e) {
204
			fail(e.getMessage());
205
		}
206
		assertTrue(matchFound);
207
	}
208
176
}
209
}

Return to bug 252060