Permalink
Browse files

AS7-5703 cli tests rely on JBOSS_HOME

  • Loading branch information...
1 parent 84cd813 commit 571ee694d46eecdba7ea101c76d7891b90247b4c @aloubyansky aloubyansky committed with bstansberry Oct 12, 2012
View
7 ...suite/shared/src/main/java/org/jboss/as/test/integration/management/util/CLITestUtil.java
@@ -24,6 +24,7 @@
import static org.junit.Assert.fail;
import java.io.File;
+import java.io.InputStream;
import java.io.OutputStream;
import org.jboss.as.cli.CliInitializationException;
@@ -49,6 +50,12 @@ public static CommandContext getCommandContext() throws CliInitializationExcepti
return CommandContextFactory.getInstance().newCommandContext(serverAddr, serverPort, null, null);
}
+ public static CommandContext getCommandContext(String address, int port, String user, char[] pwd, InputStream in, OutputStream out)
+ throws CliInitializationException {
+ setJBossCliConfig();
+ return CommandContextFactory.getInstance().newCommandContext(address, port, user, pwd, in, out);
+ }
+
public static CommandContext getCommandContext(OutputStream out) throws CliInitializationException {
SecurityActions.setSystemProperty(JREADLINE_TERMINAL, JREADLINE_TEST_TERMINAL);
setJBossCliConfig();
View
3 testsuite/shared/src/main/java/org/jboss/as/test/integration/management/util/CLIWrapper.java
@@ -30,7 +30,6 @@
import org.jboss.as.cli.CliInitializationException;
import org.jboss.as.cli.CommandContext;
-import org.jboss.as.cli.CommandContextFactory;
import org.jboss.as.cli.CommandLineException;
import org.jboss.as.test.http.Authentication;
import org.jboss.as.test.shared.TestSuiteEnvironment;
@@ -83,7 +82,7 @@ public CLIWrapper(boolean connect, String cliAddress) throws CliInitializationEx
consoleOut = new ByteArrayOutputStream();
final char[] password = getPassword() == null ? null : getPassword().toCharArray();
System.setProperty("jreadline.terminal","org.jboss.jreadline.terminal.TestTerminal");
- ctx = CommandContextFactory.getInstance().newCommandContext(
+ ctx = CLITestUtil.getCommandContext(
TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), getUsername(), password,
createConsoleInput(), consoleOut);

0 comments on commit 571ee69

Please sign in to comment.