mirror of
https://github.com/revanced/jadb.git
synced 2025-02-06 07:26:48 +01:00
minor changes to address warnings, etc
This commit is contained in:
parent
22f2442731
commit
f8c9098a7e
@ -1,6 +1,5 @@
|
|||||||
package se.vidstige.jadb;
|
package se.vidstige.jadb;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class DeviceWatcher implements Runnable {
|
public class DeviceWatcher implements Runnable {
|
||||||
|
@ -2,7 +2,6 @@ package se.vidstige.jadb;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.net.SocketException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -90,6 +90,7 @@ public class PackageManager {
|
|||||||
|
|
||||||
public void launch(Package name) throws IOException, JadbException {
|
public void launch(Package name) throws IOException, JadbException {
|
||||||
InputStream s = device.executeShell("monkey", "-p", name.toString(), "-c", "android.intent.category.LAUNCHER", "1");
|
InputStream s = device.executeShell("monkey", "-p", name.toString(), "-c", "android.intent.category.LAUNCHER", "1");
|
||||||
|
s.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
//<editor-fold desc="InstallOption">
|
//<editor-fold desc="InstallOption">
|
||||||
@ -132,7 +133,7 @@ public class PackageManager {
|
|||||||
new InstallOption("-d");
|
new InstallOption("-d");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This option is sSupported only from Android 6.X+
|
* This option is supported only from Android 6.X+
|
||||||
*/
|
*/
|
||||||
public static final InstallOption GRANT_ALL_PERMISSIONS = new InstallOption("-g");
|
public static final InstallOption GRANT_ALL_PERMISSIONS = new InstallOption("-g");
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package se.vidstige.jadb.test.integration;
|
package se.vidstige.jadb.test.integration;
|
||||||
|
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
@ -49,6 +50,7 @@ public class RealDeviceTestCases {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetDevices() throws Exception {
|
public void testGetDevices() throws Exception {
|
||||||
List<JadbDevice> actual = jadb.getDevices();
|
List<JadbDevice> actual = jadb.getDevices();
|
||||||
|
Assert.assertNotNull(actual);
|
||||||
//Assert.assertEquals("emulator-5554", actual.get(0).getSerial());
|
//Assert.assertEquals("emulator-5554", actual.get(0).getSerial());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +94,8 @@ public class RealDeviceTestCases {
|
|||||||
any.pull(new RemoteFile("/file/does/not/exist"), temporaryFolder.newFile("xyz"));
|
any.pull(new RemoteFile("/file/does/not/exist"), temporaryFolder.newFile("xyz"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@SuppressWarnings("deprecation")
|
||||||
|
@Test
|
||||||
public void testShellExecuteTwice() throws Exception {
|
public void testShellExecuteTwice() throws Exception {
|
||||||
JadbDevice any = jadb.getAnyDevice();
|
JadbDevice any = jadb.getAnyDevice();
|
||||||
any.executeShell(System.out, "ls /");
|
any.executeShell(System.out, "ls /");
|
||||||
|
@ -13,8 +13,12 @@ public class AdbOutputStreamFixture {
|
|||||||
private byte[] passthrough(byte[] input) throws IOException {
|
private byte[] passthrough(byte[] input) throws IOException {
|
||||||
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
||||||
OutputStream sut = new AdbFilterOutputStream(output);
|
OutputStream sut = new AdbFilterOutputStream(output);
|
||||||
sut.write(input);
|
try {
|
||||||
sut.flush();
|
sut.write(input);
|
||||||
|
sut.flush();
|
||||||
|
} finally {
|
||||||
|
sut.close();
|
||||||
|
}
|
||||||
return output.toByteArray();
|
return output.toByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ import se.vidstige.jadb.JadbConnection;
|
|||||||
import se.vidstige.jadb.JadbDevice;
|
import se.vidstige.jadb.JadbDevice;
|
||||||
import se.vidstige.jadb.JadbException;
|
import se.vidstige.jadb.JadbException;
|
||||||
import se.vidstige.jadb.RemoteFile;
|
import se.vidstige.jadb.RemoteFile;
|
||||||
import se.vidstige.jadb.managers.PropertyManager;
|
|
||||||
import se.vidstige.jadb.test.fakes.FakeAdbServer;
|
import se.vidstige.jadb.test.fakes.FakeAdbServer;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
@ -18,7 +17,6 @@ import java.text.DateFormat;
|
|||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class MockedTestCases {
|
public class MockedTestCases {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user