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:
Jamie Doornbos
2008-07-02 23:44:11 +00:00
parent ffeb20b2c7
commit 8ce8e69b59
10 changed files with 601 additions and 148 deletions
+1
View File
@@ -231,6 +231,7 @@
<arg value="${deploy.dir}/${lib.name}lib.swc"/>
</java>
<delete file="${deploy.dir}/aslib-config.xml"/>
<delete file="${deploy.dir}/thane-config.xml"/>
</target>
<!-- build the native libraries -->
+1
View File
@@ -15,6 +15,7 @@
<include name="junit4.jar"/>
<include name="retroweaver-all-1.2.2.jar"/>
<include name="samskivert.jar"/>
<include name="swfutils-ooo.jar"/>
<include name="velocity-1.5-dev.jar"/>
<include name="thane*.swc"/>
</fileset>
@@ -23,6 +23,7 @@ package com.threerings.bureau.server;
import java.util.Map;
import java.util.Set;
import java.io.IOException;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -54,41 +55,38 @@ import static com.threerings.bureau.Log.log;
public class BureauRegistry
{
/**
* Defines the commands that are responsible for invoking a bureau. Instances are associated to
* bureau types by the server on startup. The instances are used whenever the registry needs to
* launch a bureau for an agent with the assocated bureau type.
* @see setCommandGenerator
* Defines how a bureau is launched. Instances are associated to bureau types by the server on
* startup. The instances are used whenever the registry needs to launch a bureau for an agent
* with the assocated bureau type.
*/
public static interface Launcher
{
/**
* Kicks off a new bureau. This method will always be called on the unit invocation
* thread since it may do extensive I/O.
* @param bureauId the id of the bureau being launched
* @param token the secret string for the bureau to use in its credentials
*/
void launchBureau (String bureauId, String token)
throws IOException;
}
/**
* Defines how to generate a command to launch a bureau in a local process.
* @see #setCommandGenerator
* @see Launcher
*/
public static interface CommandGenerator
{
/**
* Launches a new bureau using the given server connect-back url and other information.
* Called by the registry when it decides a new bureau is needed.
* @param serverNameAndPort the name and port the bureau should use to connect back to the
* server, e.g. server.com:47624
* Creates the command line to launch a new bureau using the given information.
* Called by the registry when a new bureau is needed whose type was registered
* with <code>setCommandGenerator</code>.
* @param bureauId the id of the bureau being launched
* @param token the token string to use for the credentials when logging in
* @return the builder, ready to launch
* @return command line arguments, including executable name
*/
String[] createCommand (
String serverNameAndPort,
String bureauId,
String token);
}
/**
* Thrown when a bureau could not be authenticated.
*/
public static class AuthenticationException extends Exception
{
/**
* Creates a new authentication exception with a message explaining why the client could
* not be authenticated as a bureau.
*/
public AuthenticationException (String message)
{
super(message);
}
String[] createCommand (String bureauId, String token);
}
/**
@@ -115,9 +113,8 @@ public class BureauRegistry
/**
* Provides the Bureau registry with necessary runtime configuration.
*/
public void init (String serverNameAndPort)
public void init ()
{
_serverNameAndPort = serverNameAndPort;
}
/**
@@ -150,15 +147,43 @@ public class BureauRegistry
* @param bureauType the type of bureau that will be launched
* @param cmdGenerator the generator to be used for bureaus of <code>bureauType</code>
*/
public void setCommandGenerator (String bureauType, CommandGenerator cmdGenerator)
public void setCommandGenerator (
String bureauType,
final CommandGenerator cmdGenerator)
{
if (_generators.get(bureauType) != null) {
log.warning("Generator for type already exists [type=" +
setLauncher(bureauType, new Launcher () {
public void launchBureau (String bureauId, String token)
throws IOException {
ProcessBuilder builder = new ProcessBuilder(
cmdGenerator.createCommand(bureauId, token));
builder.redirectErrorStream(true);
Process process = builder.start();
// log the output of the process and prefix with bureau id
ProcessLogger.copyMergedOutput(log, bureauId, process);
}
public String toString () {
return "DefaultLauncher for " + cmdGenerator;
}
});
}
/**
* Registers a launcher for a given type. When an agent is started and no bureaus are
* running, the <code>bureauType</code> is used to determine the <code>Launcher</code>
* instance to call.
* @param bureauType the type of bureau that will be launched
* @param launcher the launcher to be used for bureaus of <code>bureauType</code>
*/
public void setLauncher (String bureauType, Launcher launcher)
{
if (_launchers.get(bureauType) != null) {
log.warning("Launcher for type already exists [type=" +
bureauType + "]");
return;
}
_generators.put(bureauType, cmdGenerator);
_launchers.put(bureauType, launcher);
}
/**
@@ -184,29 +209,24 @@ public class BureauRegistry
if (bureau == null) {
CommandGenerator generator = _generators.get(agent.bureauType);
if (generator == null) {
log.warning("CommandGenerator not found for agent's " +
Launcher launcher = _launchers.get(agent.bureauType);
if (launcher == null) {
log.warning("Launcher not found for agent's " +
"bureau type " + StringUtil.toString(agent));
return;
}
log.info("Creating new bureau " +
StringUtil.toString(agent.bureauId) + " " +
StringUtil.toString(generator));
StringUtil.toString(launcher));
bureau = new Bureau();
bureau.bureauId = agent.bureauId;
bureau.token = generateToken(bureau.bureauId);
// schedule the bureau to be kicked off
bureau.builder = new ProcessBuilder(
generator.createCommand(
_serverNameAndPort, agent.bureauId, bureau.token));
bureau.launcher = launcher;
bureau.builder.redirectErrorStream(true);
_invoker.postUnit(new Launcher(bureau));
_invoker.postUnit(new LauncherUnit(bureau));
_bureaus.put(agent.bureauId, bureau);
}
@@ -473,32 +493,30 @@ public class BureauRegistry
/**
* Invoker unit to launch a bureau's process, then assign the result on the main thread.
*/
protected static class Launcher extends Invoker.Unit
protected static class LauncherUnit extends Invoker.Unit
{
Launcher (Bureau bureau)
LauncherUnit (Bureau bureau)
{
super("Launcher for " + bureau +
StringUtil.toString(bureau.builder.command()));
super("LauncherUnit for " + bureau + ": " +
StringUtil.toString(bureau.launcher));
_bureau = bureau;
}
public boolean invoke ()
{
try {
_result = _bureau.builder.start();
// log the output of the process and prefix with bureau id
ProcessLogger.copyMergedOutput(log, _bureau.bureauId, _result);
_bureau.launch();
} catch (Exception e) {
log.warning("Could not launch process", "bureau", _bureau, e);
log.warning("Could not launch bureau", e);
}
return true;
}
public void handleResult ()
{
_bureau.process = _result;
_bureau.builder = null;
_bureau.launched = true;
_bureau.launcher = null;
log.info("Bureau launched", "bureau", _bureau);
}
@@ -552,11 +570,11 @@ public class BureauRegistry
// }
// non-null once the bureau is kicked off
Process process;
// non-null once the bureau is scheduled but not yet kicked off
ProcessBuilder builder;
Launcher launcher;
// non-null once the bureau is kicked off
boolean launched;
// The token given to this bureau for authentication
String token;
@@ -582,7 +600,8 @@ public class BureauRegistry
else {
builder.append(clientObj.getOid());
}
builder.append(", process=").append(process);
builder.append(", launcher=").append(launcher);
builder.append(", launched=").append(launched);
builder.append(", totalAgents=").append(agentStates.size());
agentSummary(builder.append(", ")).append("]");
return builder.toString();
@@ -615,10 +634,15 @@ public class BureauRegistry
agentSummary(str).append("]");
log.info(str.toString());
}
void launch ()
throws IOException
{
launcher.launchBureau(bureauId, token);
}
}
protected String _serverNameAndPort;
protected Map<String, CommandGenerator> _generators = Maps.newHashMap();
protected Map<String, Launcher> _launchers = Maps.newHashMap();
protected Map<String, Bureau> _bureaus = Maps.newHashMap();
@Inject protected RootDObjectManager _omgr;
+99 -47
View File
@@ -1,6 +1,9 @@
<!-- build configuration -->
<project name="narya tests" default="compile" basedir=".">
<!-- import overriding properties -->
<property file="../build.properties"/>
<!-- things you may want to change -->
<property name="junit.fork" value="true"/>
@@ -8,10 +11,14 @@
<property name="test.dir" value="."/>
<property name="src.dir" value="src/java"/>
<property name="deploy.dir" value="dist"/>
<property name="lib.name" value="naryatests"/>
<property name="cbundle.dir" value="rsrc/bundles/components"/>
<property name="tbundle.dir" value="rsrc/bundles/tiles"/>
<!-- this may be changed if you don't have msoy built -->
<property name="avmthane" value="/export/msoy/dist/lib/avmthane"/>
<!-- declare our classpath -->
<property name="classes.dir" value="${deploy.dir}/classes"/>
<property name="narya.classes.dir" value="../${deploy.dir}/classes"/>
@@ -99,36 +106,63 @@
</javac>
</target>
<!-- checks whether the abc library needs to be compiled -->
<target name="check-abclib">
<condition property="abclib_up_to_date">
<uptodate targetfile="${deploy.dir}/testslib.abc">
<srcfiles dir="../lib" includes="*.abc"/>
<srcfiles dir="../dist" includes="*.abc"/>
<srcfiles dir="src/as" includes="**/*.as"/>
</uptodate>
</condition>
<!-- checks whether our Flash library needs building -->
<target name="checkaslib">
<condition property="no_build_aslib"><or>
<not><available file="${flexsdk.dir}/lib/compc.jar"/></not>
<and>
<uptodate targetfile="${deploy.dir}/${lib.name}.swc">
<srcfiles dir="src/as" includes="**/*.as"/>
<srcfiles dir="../dist" includes="*.swc"/>
</uptodate>
<uptodate targetfile="${deploy.dir}/${lib.name}.abc">
<srcfiles dir="src/as" includes="**/*.as"/>
<srcfiles dir="../dist" includes="*.swc"/>
</uptodate>
</and>
</or></condition>
<available property="extdep.suffix" value="-0.0-SNAPSHOT"
filepath="../dist/lib" file="thane-0.0-SNAPSHOT.swc"/>
</target>
<!-- builds our Flash (abc) library -->
<target name="abclib" unless="abclib_up_to_date" depends="check-abclib,prepare"
description="Build the abc library for tests classes">
<taskdef name="asc" classname="flex.ant.AscTask" classpathref="classpath"/>
<asc as3="true" strict="true" classpathref="classpath" use="AS3">
<import dir="../dist">
<include name="builtin.abc"/>
<include name="thane.abc"/>
<include name="narya-abc.abc"/>
</import>
<in dir="src/as">
<include name="**/*.as"/>
<exclude name="**/*Main.as"/>
</in>
<filespec dir="../etc" includes="empty.as"/>
</asc>
<move overwrite="true" file="../etc/empty.abc" tofile="${deploy.dir}/testslib.abc"/>
<!-- builds our Flash library -->
<target name="aslib" unless="no_build_aslib" depends="checkaslib">
<!-- Generate aslib-config.xml for Flash Player and general compilation -->
<copy file="etc/thane-config.xml.in" tofile="${deploy.dir}/thane-config.xml">
<filterset>
<filter token="flex_sdk_dir" value="${flexsdk.dir}"/>
<filter token="lib_name" value="${lib.name}"/>
</filterset>
</copy>
<!-- Build Narya tests -->
<java jar="${flexsdk.dir}/lib/compc.jar" fork="true" failonerror="true">
<arg value="-load-config"/>
<arg value="${deploy.dir}/thane-config.xml"/>
<arg value="-compiler.optimize"/>
<arg value="-compiler.source-path=src/as/"/>
<arg value="-compiler.external-library-path"/>
<arg value="../dist/lib/thane${extdep.suffix}.swc"/>
<arg value="-compiler.library-path"/>
<arg value="../dist/thane-env.swc"/>
<arg value="../dist/naryalib.swc"/>
<arg value="-output"/>
<arg value="${deploy.dir}/${lib.name}.swc"/>
<arg value="-compiler.source-path"/>
<arg value="src/as/"/>
<arg value="-include-sources=src/as/com/threerings/bureau/client/TestClient.as"/>
</java>
<delete file="${deploy.dir}/aslib-config.xml"/>
<echo message="Turning .swc into .abc..."/>
<java outputproperty="dump" classpathref="classpath"
classname="flash.swf.tools.SwfxPrinter" fork="true" failonerror="true">
<arg value="-dump"/>
<arg value="${deploy.dir}/${lib.name}.abc"/>
<arg value="${deploy.dir}/${lib.name}.swc"/>
</java>
</target>
<!-- run the tests -->
<target name="test" depends="compile"
description="Run the tests.">
@@ -147,29 +181,48 @@
<!-- checks whether the bureau client needs to be compiled -->
<target name="bureau-check-thane-client">
<condition property="thane_client_up_to_date">
<uptodate targetfile="${deploy.dir}/TestClientMain.abc">
<srcfiles dir="dist" includes="testslib.abc"/>
<condition property="no_build_thane_client">
<uptodate targetfile="${deploy.dir}/BureauTestClient.abc">
<srcfiles dir="dist" includes="*.swc"/>
<srcfiles dir="src/thane" includes="**/*.as"/>
</uptodate>
</condition>
</target>
<!-- builds the bureau thane test client -->
<target name="bureau-compile-thane-client"
unless="thane_client_up_to_date" depends="abclib,bureau-check-thane-client"
description="Compiles the thane client for testing the bureau library">
<taskdef name="asc" classname="flex.ant.AscTask" classpathref="classpath"/>
<asc as3="true" strict="true" classpathref="classpath" use="AS3">
<import dir="..">
<include name="dist/builtin.abc"/>
<include name="dist/thane.abc"/>
<include name="dist/narya-abc.abc"/>
<include name="tests/dist/testslib.abc"/>
</import>
<filespec dir="src/as" includes="com/threerings/bureau/client/TestClientMain.as"/>
</asc>
<move overwrite="true" todir="dist"
file="src/as/com/threerings/bureau/client/TestClientMain.abc"/>
unless="no_build_thane_client" depends="aslib,bureau-check-thane-client"
description="Compiles the thane client for testing the bureau library">
<dirname property="abs.flexsdk.dir" file="${flexsdk.dir}/somefile.txt"/>
<copy file="etc/thane-config.xml.in" tofile="${deploy.dir}/thane-config.xml">
<filterset>
<filter token="flex_sdk_dir" value="${abs.flexsdk.dir}"/>
</filterset>
</copy>
<!-- link the executable -->
<java jar="${flexsdk.dir}/lib/mxmlc.jar" fork="true" failonerror="true">
<arg value="-load-config"/>
<arg value="${deploy.dir}/thane-config.xml"/>
<arg value="-compiler.external-library-path"/>
<arg value="../dist/lib/thane${extdep.suffix}.swc"/>
<arg value="dist/${lib.name}.swc"/>
<arg value="-compiler.source-path=src/thane"/>
<arg value="-output"/>
<arg value="${deploy.dir}/BureauTestClient.swf"/>
<arg value="src/thane/BureauTestClient.as"/>
</java>
<delete file="${deploy.dir}/thane-config.xml"/>
<echo message="Turning .swf into .abc..."/>
<java outputproperty="dump" classpathref="classpath"
classname="flash.swf.tools.SwfxPrinter" fork="true" failonerror="true">
<arg value="-dump"/>
<arg value="${deploy.dir}/BureauTestClient.abc"/>
<arg value="${deploy.dir}/BureauTestClient.swf"/>
</java>
</target>
<target name="bureau-runserver" depends="compile"
@@ -210,11 +263,10 @@
<!-- runs the thane test client -->
<target name="bureau-run-thane-client" depends="bureau-compile-thane-client"
description="Runs the thane client for testing the bureau library">
<exec executable="/export/thane/tamarin-central/dist/thane/avmthane">
<exec executable="${avmthane}">
<!--arg value="-Dverbose"/-->
<arg value="../dist/narya-abc.abc"/>
<arg value="dist/testslib.abc"/>
<arg value="dist/TestClientMain.abc"/>
<arg value="dist/naryatests.abc"/>
<arg value="dist/BureauTestClient.abc"/>
<arg value="--"/>
<arg value="${token}"/>
<arg value="${bureauId}"/>
+366
View File
@@ -0,0 +1,366 @@
<flex-config>
<!-- benchmark: output performance benchmark-->
<!-- benchmark usage:
<benchmark>boolean</benchmark>
-->
<compiler>
<!-- compiler.accessible: generate an accessible SWF-->
<accessible>false</accessible>
<!-- compiler.actionscript-file-encoding: specifies actionscript file encoding. If there is no BOM in the AS3 source files, the compiler will use this file encoding.-->
<!-- compiler.actionscript-file-encoding usage:
<actionscript-file-encoding>string</actionscript-file-encoding>
-->
<!-- compiler.allow-source-path-overlap: checks if a source-path entry is a subdirectory of another source-path entry. It helps make the package names of MXML components unambiguous.-->
<allow-source-path-overlap>false</allow-source-path-overlap>
<!-- compiler.as3: use the ActionScript 3 class based object model for greater performance and better error reporting. In the class based object model most built-in functions are implemented as fixed methods of classes.-->
<as3>true</as3>
<!-- compiler.context-root: path to replace {context.root} tokens for service channel endpoints-->
<!-- compiler.context-root usage:
<context-root>context-path</context-root>
-->
<!-- compiler.debug: generates a movie that is suitable for debugging-->
<debug>false</debug>
<!-- compiler.defaults-css-files usage:
<defaults-css-files>
<filename>string</filename>
<filename>string</filename>
</defaults-css-files>
-->
<!-- compiler.defaults-css-url: defines the location of the default style sheet. Setting this option overrides the implicit use of the defaults.css style sheet in the framework.swc file.-->
<!-- compiler.defaults-css-url usage:
<defaults-css-url>string</defaults-css-url>
-->
<!-- compiler.define: define a global AS3 conditional compilation definition, e.g. -define=CONFIG::debugging,true or -define+=CONFIG::debugging,true (to append to existing definitions in flex-config.xml) -->
<!-- compiler.define usage:
<define>
<name>string</name>
<value>string</value>
<value>string</value>
</define>
-->
<!-- compiler.es: use the ECMAScript edition 3 prototype based object model to allow dynamic overriding of prototype properties. In the prototype based object model built-in functions are implemented as dynamic properties of prototype objects.-->
<es>false</es>
<!-- compiler.external-library-path: list of SWC files or directories to compile against but to omit from linking-->
<external-library-path>
</external-library-path>
<fonts>
<!-- compiler.fonts.advanced-anti-aliasing: enables advanced anti-aliasing for embedded fonts, which provides greater clarity for small fonts.-->
<advanced-anti-aliasing>true</advanced-anti-aliasing>
<!-- compiler.fonts.flash-type: enables FlashType for embedded fonts, which provides greater clarity for small fonts.-->
<!-- compiler.fonts.flash-type usage:
<flash-type>boolean</flash-type>
-->
<languages>
<!-- compiler.fonts.languages.language-range: a range to restrict the number of font glyphs embedded into the SWF-->
<!-- compiler.fonts.languages.language-range usage:
<language-range>
<lang>string</lang>
<range>string</range>
<range>string</range>
</language-range>
-->
</languages>
<!-- compiler.fonts.local-fonts-snapshot: File containing system font data produced by flex2.tools.FontSnapshot.-->
<local-fonts-snapshot>@flex_sdk_dir@/frameworks/localFonts.ser</local-fonts-snapshot>
<!-- compiler.fonts.managers: Compiler font manager classes, in policy resolution order-->
<managers>
<manager-class>flash.fonts.JREFontManager</manager-class>
<manager-class>flash.fonts.AFEFontManager</manager-class>
<manager-class>flash.fonts.BatikFontManager</manager-class>
</managers>
<!-- compiler.fonts.max-cached-fonts: sets the maximum number of fonts to keep in the server cache. The default value is 20.-->
<max-cached-fonts>20</max-cached-fonts>
<!-- compiler.fonts.max-glyphs-per-face: sets the maximum number of character glyph-outlines to keep in the server cache for each font face. The default value is 1000.-->
<max-glyphs-per-face>1000</max-glyphs-per-face>
</fonts>
<!-- compiler.headless-server: a flag to set when Flex is running on a server without a display-->
<!-- compiler.headless-server usage:
<headless-server>boolean</headless-server>
-->
<!-- compiler.include-libraries: a list of libraries (SWCs) to completely include in the SWF-->
<!-- compiler.include-libraries usage:
<include-libraries>
<library>string</library>
<library>string</library>
</include-libraries>
-->
<!-- compiler.incremental: enables incremental compilation-->
<!-- compiler.incremental usage:
<incremental>boolean</incremental>
-->
<!-- compiler.keep-all-type-selectors: disables the pruning of unused CSS type selectors-->
<!-- compiler.keep-all-type-selectors usage:
<keep-all-type-selectors>boolean</keep-all-type-selectors>
-->
<!-- compiler.keep-as3-metadata: keep the specified metadata in the SWF-->
<!-- compiler.keep-as3-metadata usage:
<keep-as3-metadata>
<name>string</name>
<name>string</name>
</keep-as3-metadata>
-->
<!-- compiler.keep-generated-actionscript: save temporary source files generated during MXML compilation-->
<keep-generated-actionscript>false</keep-generated-actionscript>
<!-- compiler.library-path: list of SWC files or directories that contain SWC files-->
<library-path>
</library-path>
<!-- compiler.locale: specifies the locale for internationalization-->
<locale>
<locale-element>en_US</locale-element>
</locale>
<mxml>
<!-- compiler.mxml.compatibility-version: specifies a compatibility version. e.g. -compatibility-version=2.0.1-->
<!-- compiler.mxml.compatibility-version usage:
<compatibility-version>version</compatibility-version>
-->
</mxml>
<namespaces>
<!-- compiler.namespaces.namespace: Specify a URI to associate with a manifest of components for use as MXML elements-->
<namespace>
<uri>http://www.adobe.com/2006/mxml</uri>
<manifest>@flex_sdk_dir@/frameworks/mxml-manifest.xml</manifest>
</namespace>
</namespaces>
<!-- compiler.optimize: Enable post-link SWF optimization-->
<optimize>true</optimize>
<!-- compiler.services: path to Flex Data Services configuration file-->
<!-- compiler.services usage:
<services>filename</services>
-->
<!-- compiler.show-actionscript-warnings: runs the AS3 compiler in a mode that detects legal but potentially incorrect code-->
<show-actionscript-warnings>true</show-actionscript-warnings>
<!-- compiler.show-binding-warnings: toggle whether warnings generated from data binding code are displayed-->
<show-binding-warnings>true</show-binding-warnings>
<!-- compiler.show-shadowed-device-font-warnings: toggles whether warnings are displayed when an embedded font name shadows a device font name-->
<show-shadowed-device-font-warnings>true</show-shadowed-device-font-warnings>
<!-- compiler.show-unused-type-selector-warnings: toggle whether warnings generated from unused CSS type selectors are displayed-->
<show-unused-type-selector-warnings>true</show-unused-type-selector-warnings>
<!-- compiler.source-path: list of path elements that form the roots of ActionScript class hierarchies-->
<!-- compiler.source-path usage:
<source-path>
<path-element>string</path-element>
<path-element>string</path-element>
</source-path>
-->
<!-- compiler.strict: runs the AS3 compiler in strict error checking mode.-->
<strict>true</strict>
<!-- compiler.theme: list of CSS or SWC files to apply as a theme-->
<!-- compiler.theme usage:
<theme>
<filename>string</filename>
<filename>string</filename>
</theme>
-->
<!-- compiler.use-resource-bundle-metadata: determines whether resources bundles are included in the application.-->
<use-resource-bundle-metadata>true</use-resource-bundle-metadata>
<!-- compiler.verbose-stacktraces: save callstack information to the SWF for debugging-->
<verbose-stacktraces>true</verbose-stacktraces>
<!-- compiler.warn-array-tostring-changes: Array.toString() format has changed.-->
<warn-array-tostring-changes>false</warn-array-tostring-changes>
<!-- compiler.warn-assignment-within-conditional: Assignment within conditional.-->
<warn-assignment-within-conditional>true</warn-assignment-within-conditional>
<!-- compiler.warn-bad-array-cast: Possibly invalid Array cast operation.-->
<warn-bad-array-cast>true</warn-bad-array-cast>
<!-- compiler.warn-bad-bool-assignment: Non-Boolean value used where a Boolean value was expected.-->
<warn-bad-bool-assignment>true</warn-bad-bool-assignment>
<!-- compiler.warn-bad-date-cast: Invalid Date cast operation.-->
<warn-bad-date-cast>true</warn-bad-date-cast>
<!-- compiler.warn-bad-es3-type-method: Unknown method.-->
<warn-bad-es3-type-method>true</warn-bad-es3-type-method>
<!-- compiler.warn-bad-es3-type-prop: Unknown property.-->
<warn-bad-es3-type-prop>true</warn-bad-es3-type-prop>
<!-- compiler.warn-bad-nan-comparison: Illogical comparison with NaN. Any comparison operation involving NaN will evaluate to false because NaN != NaN.-->
<warn-bad-nan-comparison>true</warn-bad-nan-comparison>
<!-- compiler.warn-bad-null-assignment: Impossible assignment to null.-->
<warn-bad-null-assignment>true</warn-bad-null-assignment>
<!-- compiler.warn-bad-null-comparison: Illogical comparison with null.-->
<warn-bad-null-comparison>true</warn-bad-null-comparison>
<!-- compiler.warn-bad-undefined-comparison: Illogical comparison with undefined. Only untyped variables (or variables of type *) can be undefined.-->
<warn-bad-undefined-comparison>true</warn-bad-undefined-comparison>
<!-- compiler.warn-boolean-constructor-with-no-args: Boolean() with no arguments returns false in ActionScript 3.0. Boolean() returned undefined in ActionScript 2.0.-->
<warn-boolean-constructor-with-no-args>false</warn-boolean-constructor-with-no-args>
<!-- compiler.warn-changes-in-resolve: __resolve is no longer supported.-->
<warn-changes-in-resolve>false</warn-changes-in-resolve>
<!-- compiler.warn-class-is-sealed: Class is sealed. It cannot have members added to it dynamically.-->
<warn-class-is-sealed>true</warn-class-is-sealed>
<!-- compiler.warn-const-not-initialized: Constant not initialized.-->
<warn-const-not-initialized>true</warn-const-not-initialized>
<!-- compiler.warn-constructor-returns-value: Function used in new expression returns a value. Result will be what the function returns, rather than a new instance of that function.-->
<warn-constructor-returns-value>false</warn-constructor-returns-value>
<!-- compiler.warn-deprecated-event-handler-error: EventHandler was not added as a listener.-->
<warn-deprecated-event-handler-error>true</warn-deprecated-event-handler-error>
<!-- compiler.warn-deprecated-function-error: Unsupported ActionScript 2.0 function.-->
<warn-deprecated-function-error>true</warn-deprecated-function-error>
<!-- compiler.warn-deprecated-property-error: Unsupported ActionScript 2.0 property.-->
<warn-deprecated-property-error>true</warn-deprecated-property-error>
<!-- compiler.warn-duplicate-argument-names: More than one argument by the same name.-->
<warn-duplicate-argument-names>true</warn-duplicate-argument-names>
<!-- compiler.warn-duplicate-variable-def: Duplicate variable definition -->
<warn-duplicate-variable-def>true</warn-duplicate-variable-def>
<!-- compiler.warn-for-var-in-changes: ActionScript 3.0 iterates over an object's properties within a "for x in target" statement in random order.-->
<warn-for-var-in-changes>false</warn-for-var-in-changes>
<!-- compiler.warn-import-hides-class: Importing a package by the same name as the current class will hide that class identifier in this scope.-->
<warn-import-hides-class>true</warn-import-hides-class>
<!-- compiler.warn-instance-of-changes: Use of the instanceof operator.-->
<warn-instance-of-changes>true</warn-instance-of-changes>
<!-- compiler.warn-internal-error: Internal error in compiler.-->
<warn-internal-error>true</warn-internal-error>
<!-- compiler.warn-level-not-supported: _level is no longer supported. For more information, see the flash.display package.-->
<warn-level-not-supported>true</warn-level-not-supported>
<!-- compiler.warn-missing-namespace-decl: Missing namespace declaration (e.g. variable is not defined to be public, private, etc.).-->
<warn-missing-namespace-decl>true</warn-missing-namespace-decl>
<!-- compiler.warn-negative-uint-literal: Negative value will become a large positive value when assigned to a uint data type.-->
<warn-negative-uint-literal>true</warn-negative-uint-literal>
<!-- compiler.warn-no-constructor: Missing constructor.-->
<warn-no-constructor>false</warn-no-constructor>
<!-- compiler.warn-no-explicit-super-call-in-constructor: The super() statement was not called within the constructor.-->
<warn-no-explicit-super-call-in-constructor>false</warn-no-explicit-super-call-in-constructor>
<!-- compiler.warn-no-type-decl: Missing type declaration.-->
<warn-no-type-decl>true</warn-no-type-decl>
<!-- compiler.warn-number-from-string-changes: In ActionScript 3.0, white space is ignored and '' returns 0. Number() returns NaN in ActionScript 2.0 when the parameter is '' or contains white space.-->
<warn-number-from-string-changes>false</warn-number-from-string-changes>
<!-- compiler.warn-scoping-change-in-this: Change in scoping for the this keyword. Class methods extracted from an instance of a class will always resolve this back to that instance. In ActionScript 2.0 this is looked up dynamically based on where the method is invoked from.-->
<warn-scoping-change-in-this>false</warn-scoping-change-in-this>
<!-- compiler.warn-slow-text-field-addition: Inefficient use of += on a TextField.-->
<warn-slow-text-field-addition>true</warn-slow-text-field-addition>
<!-- compiler.warn-unlikely-function-value: Possible missing parentheses.-->
<warn-unlikely-function-value>true</warn-unlikely-function-value>
<!-- compiler.warn-xml-class-has-changed: Possible usage of the ActionScript 2.0 XML class.-->
<warn-xml-class-has-changed>false</warn-xml-class-has-changed>
</compiler>
<!-- debug-password: the password to include in debuggable SWFs-->
<debug-password></debug-password>
<!-- default-background-color: default background color (may be overridden by the application code)-->
<default-background-color>0x869CA7</default-background-color>
<!-- default-frame-rate: default frame rate to be used in the SWF.-->
<default-frame-rate>30</default-frame-rate>
<!-- default-script-limits: default script execution limits (may be overridden by root attributes)-->
<default-script-limits>
<max-recursion-depth>1000</max-recursion-depth>
<max-execution-time>15</max-execution-time>
</default-script-limits>
<!-- default-size: default application size (may be overridden by root attributes in the application)-->
<default-size>
<width>500</width>
<height>375</height>
</default-size>
<!-- externs: a list of symbols to omit from linking when building a SWF-->
<!-- externs usage:
<externs>
<symbol>string</symbol>
<symbol>string</symbol>
</externs>
-->
<frames>
<!-- frames.frame: A SWF frame label with a sequence of classnames that will be linked onto the frame.-->
<!-- frames.frame usage:
<frame>
<label>string</label>
<classname>string</classname>
</frame>
-->
</frames>
<!-- include-resource-bundles: a list of resource bundles to include in the output SWC-->
<!-- include-resource-bundles usage:
<include-resource-bundles>
<bundle>string</bundle>
<bundle>string</bundle>
</include-resource-bundles>
-->
<!-- includes: a list of symbols to always link in when building a SWF-->
<!-- includes usage:
<includes>
<symbol>string</symbol>
<symbol>string</symbol>
</includes>
-->
<!-- link-report: Output a XML-formatted report of all definitions linked into the application.-->
<!-- link-report usage:
<link-report>filename</link-report>
-->
<!-- load-config: load a file containing configuration options-->
<!--
<load-config>${flexlib}/${configname}-config.xml</load-config>
-->
<!-- load-externs: an XML file containing <def>, <pre>, and <ext> symbols to omit from linking when building a SWF-->
<!-- load-externs usage:
<load-externs>filename</load-externs>
-->
<metadata>
<!-- metadata.contributor: A contributor's name to store in the SWF metadata-->
<!-- metadata.contributor usage:
<contributor>name</contributor>
-->
<!-- metadata.creator: A creator's name to store in the SWF metadata-->
<creator>Three Rings Design, Inc.</creator>
<!-- metadata.date: The creation date to store in the SWF metadata-->
<!-- metadata.date usage:
<date>text</date>
-->
<!-- metadata.description: The default description to store in the SWF metadata-->
<description>http://www.whirled.com</description>
<!-- metadata.language: The language to store in the SWF metadata (i.e. EN, FR)-->
<language>EN</language>
<!-- metadata.localized-description: A localized RDF/XMP description to store in the SWF metadata-->
<!-- metadata.localized-description usage:
<localized-description>
<text>string</text>
<lang>string</lang>
<lang>string</lang>
</localized-description>
-->
<!-- metadata.localized-title: A localized RDF/XMP title to store in the SWF metadata-->
<!-- metadata.localized-title usage:
<localized-title>
<title>string</title>
<lang>string</lang>
<lang>string</lang>
</localized-title>
-->
<!-- metadata.publisher: A publisher's name to store in the SWF metadata-->
<publisher>Three Rings Design, Inc.</publisher>
<!-- metadata.title: The default title to store in the SWF metadata-->
<title>Whirled</title>
</metadata>
<!-- output: the filename of the SWF movie to create-->
<!-- output usage:
<output>filename</output>
-->
<!-- raw-metadata: XML text to store in the SWF metadata (overrides metadata.* configuration)-->
<!-- raw-metadata usage:
<raw-metadata>text</raw-metadata>
-->
<!-- resource-bundle-list: prints a list of resource bundles to a file for input to the compc compiler to create a resource bundle SWC file. -->
<!-- resource-bundle-list usage:
<resource-bundle-list>filename</resource-bundle-list>
-->
<!-- runtime-shared-libraries: a list of runtime shared library URLs to be loaded before the application starts-->
<!-- runtime-shared-libraries usage:
<runtime-shared-libraries>
<url>string</url>
<url>string</url>
</runtime-shared-libraries>
-->
<runtime-shared-library-path>
</runtime-shared-library-path>
<!-- static-link-runtime-shared-libraries: statically link the libraries specified by the -runtime-shared-libraries-path option.-->
<static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
<!-- target-player: specifies the version of the player the application is targeting. Features requiring a later version will not be compiled into the application. The minimum value supported is "9.0.0".-->
<!-- target-player usage:
<target-player>version</target-player>
-->
<!-- use-network: toggle whether the SWF is flagged for access to network resources-->
<use-network>true</use-network>
<!-- verify-digests: verifies the libraries loaded at runtime are the correct ones.-->
<!-- verify-digests usage:
<verify-digests>boolean</verify-digests>
-->
<!-- version: display the build version of the program-->
<!-- version usage:
<version>boolean</version>
-->
<!-- warnings: toggle the display of warnings-->
<!-- warnings usage:
<warnings>boolean</warnings>
-->
</flex-config>
-1
View File
@@ -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)
+11
View File
@@ -0,0 +1,11 @@
package {
import avmplus.System;
import com.threerings.bureau.client.TestClient;
public class BureauTestClient
{
TestClient.main(System.argv);
}
}