exit(1); } if ($response != $req1) { print_r("Req1 output is not same as input! [{$response}] vs [{$req1}]\n"); exit(1); } $fault = $clReq2->getResponseData($response); if ($fault != 0) { print_r("fault: " . $clReq2->getFaultText() . "\n"); } if ($response != $req2) { print_r("Req2 output is not same as input! [{$response}] vs [{$req2}]\n"); exit(1); } // ExecuteAndWaitAny $r = $pc->executeAndWaitAny(); if ($pc->hasFault()) { print_r("[Fault] " . $pc->getFault() . "\n"); exit(-1); } if ($r->hasFault()) { print_r("[fault] " . $r->getFaultText() . "\n"); exit(-1); } $response = ""; /* Extract the response data */ $fault = $r->getResponseData($response); if ($fault != 0) { print_r("fault: " . $r->getFaultText() . "\n"); } if ($response != $req2 && $response != $req) {
<?php $expected = "I expect this to be echo'd out"; $client = new PlutonClient('inprogress'); $client->initialize(); $request = new PlutonClientRequest(); $request->setRequestData($expected); $request->setContext("echo.sleepMS", "3000"); $client->addRequest('system.echo.0.raw', $request); $client->executeAndWaitSent(); if ($request->inProgress()) { print "Request is in progress - good\n"; } else { print "Request is NOT in progress - bad\n"; exit(1); } $res = $client->executeAndWaitAny(); print "executeAndWaitAny returned {$res}\n"; if ($request->inProgress()) { print "Request is still in progress - bad\n"; exit(2); } else { print "Request is NOT in progress - good\n"; } $responseData = null; $request->getResponseData($responseData); if ($responseData !== $expected) { print "Client test failed\n expected: {$expected}\n received: {$responseData}\n"; exit(3); } else { print "Client test successful\n"; }