mirror of
https://github.com/revanced/jadb.git
synced 2025-06-12 05:07:39 +02:00
Specifying port explicitly in unit tests.
This commit is contained in:
@ -17,7 +17,7 @@ public class MockedTestCases {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception{
|
||||
server = new AdbServer();
|
||||
server = new AdbServer(15037);
|
||||
server.start();
|
||||
connection = new JadbConnection("localhost", 15037);
|
||||
}
|
||||
|
@ -7,7 +7,8 @@ import java.net.Socket;
|
||||
// >set ANDROID_ADB_SERVER_PORT=15037
|
||||
public class AdbServer implements Runnable {
|
||||
|
||||
private int port = 15037;
|
||||
private static final int DEFAULT_PORT = 15037;
|
||||
private final int port;
|
||||
private ServerSocket socket;
|
||||
private Thread thread;
|
||||
private final Object lockObject = new Object();
|
||||
@ -17,6 +18,15 @@ public class AdbServer implements Runnable {
|
||||
AdbServer server = new AdbServer();
|
||||
server.run();
|
||||
}
|
||||
|
||||
public AdbServer()
|
||||
{
|
||||
this(DEFAULT_PORT);
|
||||
}
|
||||
public AdbServer(int port)
|
||||
{
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public void start() throws InterruptedException
|
||||
{
|
||||
|
Reference in New Issue
Block a user