Changed BureauRegistry to use Launcher and updated bureau tests
* Moved the thane-specific TestClientMain out into src/thane and renamed BureauTestClient * Removed server name and port from the registry init and from the Launcher/ CommandGenerator parameters. These can be inserted by the caller * Converted all the asc junk to compc/mxmlc the same as msoy does it * Moved the test client main function into src/as land * Added extdeps.suffix alternative approach since tests/build.xml does not get launched from nifty ooo-libs container * Fixed bureau test targets * Moved avmthane to overridable property and corrected out of date default * Converted BureauRegistry code to deal with Launcher objects and added shim to preserve use of CommandGenerator * Fixed narya build to remove thane-config.xml after building aslib git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5218 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1 +0,0 @@
|
||||
package {}
|
||||
@@ -1,7 +1,40 @@
|
||||
package com.threerings.bureau.client {
|
||||
|
||||
import com.threerings.bureau.data.BureauMarshaller;
|
||||
|
||||
public class TestClient extends BureauClient
|
||||
{
|
||||
BureauMarshaller;
|
||||
|
||||
/**
|
||||
* The main entry point for the bureau test client to be run in thane. Arguments:
|
||||
* 0: the token to use to log back into the server
|
||||
* 1: the bureau id of this instance
|
||||
* 2: the name of the server to log into
|
||||
* 3: the port to connect to on the server
|
||||
*/
|
||||
public static function main (argv :Array) :void
|
||||
{
|
||||
if (argv.length != 4) {
|
||||
trace("Expected 4 arguments: (token) (bureauId) (server) (port)");
|
||||
}
|
||||
|
||||
var token :String = argv[0];
|
||||
var bureauId :String = argv[1];
|
||||
var server :String = argv[2];
|
||||
var port :int = parseInt(argv[3]);
|
||||
|
||||
trace("Token: " + token);
|
||||
trace("BureauId: " + bureauId);
|
||||
trace("Server: " + server);
|
||||
trace("Port: " + port + " (parsed from " + argv[3] + ")");
|
||||
|
||||
// create the client and log on
|
||||
var client :TestClient = new TestClient(token, bureauId);
|
||||
client.setServer(server, [port]);
|
||||
client.logon();
|
||||
}
|
||||
|
||||
public function TestClient (token :String, bureauId :String)
|
||||
{
|
||||
super(token, bureauId);
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
|
||||
/**
|
||||
* The main entry point for the bureau test client to be run in thane. Arguments:
|
||||
* 0: the token to use to log back into the server
|
||||
* 1: the bureau id of this instance
|
||||
* 2: the name of the server to log into
|
||||
* 3: the port to connect to on the server
|
||||
*/
|
||||
|
||||
import avmplus.System;
|
||||
import com.threerings.bureau.client.TestClient;
|
||||
|
||||
if (System.argv.length != 4) {
|
||||
trace("Expected 4 arguments: (token) (bureauId) (server) (port)");
|
||||
}
|
||||
|
||||
var token :String = System.argv[0];
|
||||
var bureauId :String = System.argv[1];
|
||||
var server :String = System.argv[2];
|
||||
var port :int = parseInt(System.argv[3]);
|
||||
|
||||
trace("Token: " + token);
|
||||
trace("BureauId: " + bureauId);
|
||||
trace("Server: " + server);
|
||||
trace("Port: " + port + " (parsed from " + System.argv[3] + ")");
|
||||
|
||||
// create the client and log on
|
||||
var client :TestClient = new TestClient(token, bureauId);
|
||||
client.setServer(server, [port]);
|
||||
client.logon();
|
||||
|
||||
// run it
|
||||
//client.run();
|
||||
@@ -56,12 +56,11 @@ public class TestServer extends PresentsServer
|
||||
public static BureauRegistry.CommandGenerator antCommandGenerator (final String target)
|
||||
{
|
||||
return new BureauRegistry.CommandGenerator() {
|
||||
public String[] createCommand (String serverNameAndPort, String bureauId, String token) {
|
||||
int colon = serverNameAndPort.indexOf(':');
|
||||
public String[] createCommand (String bureauId, String token) {
|
||||
return new String[] {
|
||||
"ant",
|
||||
"-DserverName=" + serverNameAndPort.substring(0, colon),
|
||||
"-DserverPort=" + serverNameAndPort.substring(colon + 1),
|
||||
"-DserverName=localhost",
|
||||
"-DserverPort=47624",
|
||||
"-DbureauId=" + bureauId,
|
||||
"-Dtoken=" + token,
|
||||
target };
|
||||
@@ -74,7 +73,7 @@ public class TestServer extends PresentsServer
|
||||
throws Exception
|
||||
{
|
||||
super.init(injector);
|
||||
_bureauReg.init("localhost:47624");
|
||||
_bureauReg.init();
|
||||
}
|
||||
|
||||
public void setClientTarget (String target)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package {
|
||||
|
||||
import avmplus.System;
|
||||
import com.threerings.bureau.client.TestClient;
|
||||
|
||||
|
||||
public class BureauTestClient
|
||||
{
|
||||
TestClient.main(System.argv);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user