From 3ace8c814de5be9ba2df9d74b66e4acba9cfe2b4 Mon Sep 17 00:00:00 2001 From: Kris Heid Date: Fri, 5 Mar 2021 14:37:12 +0100 Subject: [PATCH] fix FakeADBServer testcases which expect certain commands...however due to previous commits these commands are now quoted --- test/se/vidstige/jadb/test/unit/MockedTestCases.java | 2 +- test/se/vidstige/jadb/test/unit/PackageManagerTest.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/se/vidstige/jadb/test/unit/MockedTestCases.java b/test/se/vidstige/jadb/test/unit/MockedTestCases.java index 017acef..1a886a6 100644 --- a/test/se/vidstige/jadb/test/unit/MockedTestCases.java +++ b/test/se/vidstige/jadb/test/unit/MockedTestCases.java @@ -99,7 +99,7 @@ public class MockedTestCases { @Test public void testExecuteShell() throws Exception { server.add("serial-123"); - server.expectShell("serial-123", "ls -l").returns("total 0"); + server.expectShell("serial-123", "ls '-l'").returns("total 0"); JadbDevice device = connection.getDevices().get(0); device.executeShell("ls", "-l"); } diff --git a/test/se/vidstige/jadb/test/unit/PackageManagerTest.java b/test/se/vidstige/jadb/test/unit/PackageManagerTest.java index 6974b02..921df75 100644 --- a/test/se/vidstige/jadb/test/unit/PackageManagerTest.java +++ b/test/se/vidstige/jadb/test/unit/PackageManagerTest.java @@ -44,7 +44,7 @@ public class PackageManagerTest { String response = "package:/system/priv-app/Contacts.apk-com.android.contacts\n" + "package:/system/priv-app/Teleservice.apk-com.android.phone"; - server.expectShell(DEVICE_SERIAL, "pm list packages").returns(response); + server.expectShell(DEVICE_SERIAL, "pm 'list' 'packages'").returns(response); //Act List actual = new PackageManager(device).getPackages(); @@ -64,7 +64,7 @@ public class PackageManagerTest { "[malformed_line]\n" + "package:/system/priv-app/Teleservice.apk-com.android.phone"; - server.expectShell(DEVICE_SERIAL, "pm list packages").returns(response); + server.expectShell(DEVICE_SERIAL, "pm 'list' 'packages'").returns(response); //Act List actual = new PackageManager(device).getPackages(); @@ -79,7 +79,7 @@ public class PackageManagerTest { List expected = new ArrayList<>(); String response = ""; - server.expectShell(DEVICE_SERIAL, "pm list packages").returns(response); + server.expectShell(DEVICE_SERIAL, "pm 'list' 'packages'").returns(response); //Act List actual = new PackageManager(device).getPackages();