added getDebugHost() and getDebugPort() methods to Platform for convenience
This commit is contained in:
@@ -66,26 +66,10 @@ public class LuaJVMTest extends TestCase {
|
||||
* Provides a J2SE DebugSupport instance.
|
||||
*/
|
||||
public DebugNetSupport getDebugSupport() throws IOException {
|
||||
int port = getDebugPortNumber();
|
||||
int port = getDebugPort();
|
||||
DebugSupportImpl debugSupport = new DebugSupportImpl(port);
|
||||
return debugSupport;
|
||||
}
|
||||
|
||||
private int getDebugPortNumber() throws IOException {
|
||||
String portStr =
|
||||
getProperty(DebugLuaState.PROPERTY_LUAJ_DEBUG_PORT);
|
||||
int port = -1;
|
||||
if (portStr == null) {
|
||||
throw new IOException("Port number must be specified in the System property");
|
||||
} else {
|
||||
try {
|
||||
port = Integer.parseInt(portStr);
|
||||
} catch (NumberFormatException e) {
|
||||
throw new IOException("Bad port number: " + portStr);
|
||||
}
|
||||
}
|
||||
return port;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user