From d765e8f97f06843a0940b29e54dd7ae466b89260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jari=20H=C3=A4m=C3=A4l=C3=A4inen?= Date: Sat, 28 Jan 2017 18:41:24 +0200 Subject: [PATCH] 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. --- .../jadb/test/integration/RealDeviceTestCases.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/se/vidstige/jadb/test/integration/RealDeviceTestCases.java b/test/se/vidstige/jadb/test/integration/RealDeviceTestCases.java index 92a6d60..be6120c 100644 --- a/test/se/vidstige/jadb/test/integration/RealDeviceTestCases.java +++ b/test/se/vidstige/jadb/test/integration/RealDeviceTestCases.java @@ -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