Fixing a bug where jadb would hang if no devices where found.

This commit is contained in:
Samuel Carlsson
2014-03-20 17:30:21 +01:00
parent 59cc2e9d1e
commit fa74fd88bd
3 changed files with 17 additions and 10 deletions

View File

@ -6,8 +6,6 @@ import org.junit.Before;
import org.junit.Test;
import se.vidstige.jadb.JadbConnection;
import se.vidstige.jadb.JadbDevice;
import se.vidstige.jadb.server.AdbServer;
import se.vidstige.jadb.server.SocketServer;
import se.vidstige.jadb.test.fakes.FakeAdbServer;
import java.util.List;
@ -36,4 +34,11 @@ public class MockedTestCases {
List<JadbDevice> devices = connection.getDevices();
Assert.assertEquals("serial-123", devices.get(0).getSerial());
}
@Test
public void testListNoDevices() throws Exception {
List<JadbDevice> devices = connection.getDevices();
Assert.assertEquals(0, devices.size());
}
}