minor changes to address warnings, etc

This commit is contained in:
Daniel Friederich 2016-11-03 15:53:13 -05:00 committed by Samuel Carlsson
parent 22f2442731
commit f8c9098a7e
6 changed files with 12 additions and 8 deletions

View File

@ -1,6 +1,5 @@
package se.vidstige.jadb;
import java.util.List;
import java.io.IOException;
public class DeviceWatcher implements Runnable {

View File

@ -2,7 +2,6 @@ package se.vidstige.jadb;
import java.io.IOException;
import java.net.Socket;
import java.net.SocketException;
import java.util.ArrayList;
import java.util.List;

View File

@ -90,6 +90,7 @@ public class PackageManager {
public void launch(Package name) throws IOException, JadbException {
InputStream s = device.executeShell("monkey", "-p", name.toString(), "-c", "android.intent.category.LAUNCHER", "1");
s.close();
}
//<editor-fold desc="InstallOption">
@ -132,7 +133,7 @@ public class PackageManager {
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");

View File

@ -1,5 +1,6 @@
package se.vidstige.jadb.test.integration;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
@ -49,6 +50,7 @@ public class RealDeviceTestCases {
@Test
public void testGetDevices() throws Exception {
List<JadbDevice> actual = jadb.getDevices();
Assert.assertNotNull(actual);
//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"));
}
@Test
@SuppressWarnings("deprecation")
@Test
public void testShellExecuteTwice() throws Exception {
JadbDevice any = jadb.getAnyDevice();
any.executeShell(System.out, "ls /");

View File

@ -13,8 +13,12 @@ public class AdbOutputStreamFixture {
private byte[] passthrough(byte[] input) throws IOException {
ByteArrayOutputStream output = new ByteArrayOutputStream();
OutputStream sut = new AdbFilterOutputStream(output);
sut.write(input);
sut.flush();
try {
sut.write(input);
sut.flush();
} finally {
sut.close();
}
return output.toByteArray();
}

View File

@ -8,7 +8,6 @@ import se.vidstige.jadb.JadbConnection;
import se.vidstige.jadb.JadbDevice;
import se.vidstige.jadb.JadbException;
import se.vidstige.jadb.RemoteFile;
import se.vidstige.jadb.managers.PropertyManager;
import se.vidstige.jadb.test.fakes.FakeAdbServer;
import java.io.ByteArrayInputStream;
@ -18,7 +17,6 @@ import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Map;
public class MockedTestCases {