Skip to content

Commit

Permalink
ISPN-2867 Do not test Main to avoid System.exit() affecting test
Browse files Browse the repository at this point in the history
completion
  • Loading branch information
tristantarrant authored and danberindei committed Feb 27, 2013
1 parent 70f435f commit 855685c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import java.io.InputStream;
import java.io.PrintStream;

import org.infinispan.cli.shell.Shell;
import org.infinispan.cli.shell.ShellImpl;
import org.infinispan.util.Util;
import org.testng.annotations.Test;

Expand All @@ -39,7 +41,9 @@ public void testStandardInput() throws Exception {
baos = new ByteArrayOutputStream();
System.setIn(bais);
System.setOut(new PrintStream(baos));
Main.main(new String[]{"-f","-"});
Shell shell = new ShellImpl();
shell.init(new String[]{"-f","-"});
shell.run();
System.out.flush();
String output = baos.toString("UTF-8");
assert output.contains("Version");
Expand Down

0 comments on commit 855685c

Please sign in to comment.