Skip to content

Commit

Permalink
Merge pull request #136 from root-intruder/master
Browse files Browse the repository at this point in the history
fix FakeADBServer testcases which expect certain commands
  • Loading branch information
vidstige authored Mar 5, 2021
2 parents d756538 + 3ace8c8 commit cfc66ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/se/vidstige/jadb/test/unit/MockedTestCases.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void testPullFile() throws Exception {
@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");
}
Expand Down
6 changes: 3 additions & 3 deletions test/se/vidstige/jadb/test/unit/PackageManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void testGetPackagesWithSeveralPackages() throws Exception {
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<Package> actual = new PackageManager(device).getPackages();
Expand All @@ -64,7 +64,7 @@ public void testGetPackagesMalformedIgnoredString() throws Exception {
"[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<Package> actual = new PackageManager(device).getPackages();
Expand All @@ -79,7 +79,7 @@ public void testGetPackagesWithNoPackages() throws Exception {
List<Package> 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<Package> actual = new PackageManager(device).getPackages();
Expand Down

0 comments on commit cfc66ff

Please sign in to comment.