mirror of
https://github.com/revanced/jadb.git
synced 2025-02-11 09:36:48 +01:00
Don't use System.out as parameter in executeShell test
Using System.out as parameter for executeShell causes test run to stop in Windows host. Probably because deprecated executeShell closes the given output stream. Changed parameter stream in test to ByteArrayOutputStream to allow tests to run in Windows system. Resulting byte array is then written to System.out to preserve old behavior.
This commit is contained in:
parent
0cb9550b50
commit
d765e8f97f
@ -8,6 +8,7 @@ import org.junit.Test;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
import se.vidstige.jadb.*;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
@ -98,8 +99,10 @@ public class RealDeviceTestCases {
|
||||
@Test
|
||||
public void testShellExecuteTwice() throws Exception {
|
||||
JadbDevice any = jadb.getAnyDevice();
|
||||
any.executeShell(System.out, "ls /");
|
||||
any.executeShell(System.out, "ls", "-la", "/");
|
||||
ByteArrayOutputStream bout = new ByteArrayOutputStream();
|
||||
any.executeShell(bout, "ls /");
|
||||
any.executeShell(bout, "ls", "-la", "/");
|
||||
System.out.write(bout.toByteArray());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user