added getDebugHost() and getDebugPort() methods to Platform for convenience

This commit is contained in:
Shu Lei
2007-12-01 01:04:34 +00:00
parent 9fd34436fe
commit 3c05880012
4 changed files with 134 additions and 117 deletions

View File

@@ -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;
}
});
}