// Helper method used by JUnit tests to pass in an operation and method argument
 // When the AMF call returns, CallResultHandler.onResult is called to Assert things.
 private void internalTestCall(String operation, Object methodArg, CallResultHandler resultHandler)
     throws ClientStatusException, ServerStatusException {
   AMFConnection amfConnection = new AMFConnection();
   // Connect.
   amfConnection.connect(DEFAULT_URL);
   // Make a remoting call and retrieve the result.
   Object result;
   if (methodArg == null) result = amfConnection.call(operation);
   else result = amfConnection.call(operation, methodArg);
   resultHandler.onResult(result);
   amfConnection.close();
 }
  protected void setUp() throws Exception {
    server = new TestServer();
    if (!server.startServer("classpath:/WEB-INF/flex/services-config.xml")) {
      Assert.fail("Couldn't start server process");
    }

    AMFConnection.registerAlias(
        "remoting.amfclient.ServerCustomType" /* server type */,
        "amfclient.ClientCustomType" /* client type */);
    super.setUp();
  }