#include #include int main (int argc, char **argv) { const char *commands[] = { "--ex=localhost", "--el=Front Stage.occulter.y", "--value-directive=start", "--ex=localhost", "--el=Front Stage.occulter.x", "--value-directive=start", "--ex=localhost", "--el=Front Stage.assembly.z", "--value-directive=start", 0}; const char *xmlFile="../Coda/localhost.xml"; commandInterface::handle_t *keys = 0; if (argc < 2) { std::cerr << "The only required argument is the classpath for finding " << "either the testbed.jar or the class files!" << std::endl; return -2; } std::cout << "Status of initialization: " << (commandInterface::initialize (xmlFile, argv[1], "localhost", true) ? "true" : "false") << std::endl; std::cout << "Attempting to start a GUI monitor of the system..." << std::endl << std::endl; commandInterface::monitor (xmlFile); sleep (3); std::cout << "Adding these commands to the things to do: " << std::endl; for (int c = 0 ; commands[c] != 0 ; c++) std::cout << " " << commands[c] << std::endl; std::cout << "Status of appending commands: " << (commandInterface::append (commands, &keys) ? "true" : "false") << std::endl; std::cout << "Received these keys: " << std::hex << keys << std::endl; for (int k = 0 ; keys[k] != 0 ; k++) std::cout << " " << keys[k] << std::endl; std::cout << std::endl; std::cout << "Status of executing the commands: " << (commandInterface::execute (true) ? "true" : "false") << std::endl << std::endl; for (int k = 0 ; keys[k] != 0 ; k++) { bool arrived = false, success = false; char *response = 0; std::cout << "Status of collecting result for key " << keys[k] << ": " << (commandInterface::collect (keys[k], true, false, &arrived, &success, &response) ? "true" : "false") << std::endl; std::cout << " Arrived: " << (arrived ? "true":"false") << std::endl; std::cout << " Success: " << (success ? "true":"false") << std::endl; std::cout << " Response: " << (response == 0 ? "null" : response) << std::endl; } return 0; }