Commit b82773db authored by legoc's avatar legoc

Added test of the function/method now.

parent bfaa2c3e
......@@ -160,8 +160,7 @@ void testFastConnect(Server& server) {
results[j]->kill();
application::State state = results[j]->waitFor();
cout << "killed " << results[j]->getNameId()
<< " with initial state " << application::toString(results[j]->getInitialState())
<< " and final state " << application::toString(state) << endl;
<< " with final state " << application::toString(state) << endl;
}
i++;
......
......@@ -62,7 +62,7 @@ int main(int argc, char *argv[]) {
// start the application.
auto_ptr<application::Instance> responderApplication = server.start(applicationName);
cout << "started application " << *responderApplication << endl;
cout << "started application " << *responderApplication << " with state " << application::toString(responderApplication->now()) << endl;
// create a subscriber to the application applicationName
auto_ptr<application::Requester> requester = application::Requester::create(*responderApplication, "responder");
......@@ -74,6 +74,8 @@ int main(int argc, char *argv[]) {
return -1;
}
cout << "application " << *responderApplication << " has state " << application::toString(responderApplication->now()) << endl;
// send a simple message.
requester->send("request");
......
......@@ -197,8 +197,7 @@ public class Test {
result.kill();
int state = result.waitFor();
System.out.println("killed " + result.getNameId()
+ " with initial state " + Application.State.toString(result.getInitialState())
+ " and final state " + Application.State.toString(state));
+ " with final state " + Application.State.toString(state));
}
i++;
......
......@@ -61,11 +61,14 @@ public class TestRequesterAndResponderApplication {
// Start the application.
Application.Instance responderApplication = server.start(applicationName);
System.out.println("started application " + responderApplication);
System.out.println("started application " + responderApplication + " with state " + Application.State.toString(responderApplication.now()));
Application.Requester requester = Application.Requester.create(responderApplication, "responder");
System.out.println("created requester " + requester);
// Check the state of the responder app.
System.out.println("application " + responderApplication + " has state " + Application.State.toString(responderApplication.now()));
// Send a simple message.
requester.send("request");
System.out.println("response is " + requester.receiveString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment