Created a test service and provider and sorted out further details.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@71 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-07-19 07:48:25 +00:00
parent 933896e503
commit d55ce27b2b
9 changed files with 75 additions and 11 deletions
@@ -1,5 +1,5 @@
//
// $Id: TestClient.java,v 1.4 2001/06/13 05:17:55 mdb Exp $
// $Id: TestClient.java,v 1.5 2001/07/19 07:48:25 mdb Exp $
package com.threerings.cocktail.cher.client.test;
@@ -37,7 +37,9 @@ public class TestClient
{
Log.info("Client did logon [client=" + client + "].");
// try subscribing to a test object
client.getDObjectManager().subscribeToObject(1, this);
client.getDObjectManager().subscribeToObject(2, this);
// issue a test invocation request
TestService.test(client, "foo", 1, this);
}
public void clientFailedToLogon (Client client, Exception cause)
@@ -85,6 +87,11 @@ public class TestClient
return false;
}
public void handleTestSucceeded (String response)
{
Log.info("Got test response [rsp=" + response + "].");
}
public static void main (String[] args)
{
TestClient tclient = new TestClient();
@@ -0,0 +1,25 @@
//
// $Id: TestService.java,v 1.1 2001/07/19 07:48:25 mdb Exp $
package com.threerings.cocktail.cher.client.test;
import com.threerings.cocktail.cher.Log;
import com.threerings.cocktail.cher.client.Client;
import com.threerings.cocktail.cher.client.InvocationManager;
/**
* A test of the invocation services.
*/
public class TestService
{
public static final String MODULE = "test";
public static void test (
Client client, String one, int two, Object rsptarget)
{
InvocationManager invmgr = client.getInvocationManager();
Object[] args = new Object[] { one, new Integer(two) };
invmgr.invoke(MODULE, "Test", args, rsptarget);
Log.info("Sent test request [one=" + one + ", two=" + two + "].");
}
}
@@ -0,0 +1,17 @@
//
// $Id: TestProvider.java,v 1.1 2001/07/19 07:48:25 mdb Exp $
package com.threerings.cocktail.cher.server.test;
import com.threerings.cocktail.cher.Log;
/**
* A test of the invocation services.
*/
public class TestProvider
{
public Object[] handleTestRequest (String one, int two)
{
Log.info("Test request [one=" + one + ", two=" + two + "].");
}
}