public function testJsonizeEcho()
 {
     $jsonize = new Jsonize\InstanceJsonize("jsonize", "", array("once" => TRUE));
     //$jsonize = new Jsonize\SocketJsonize("localhost", 1234);
     $result = $jsonize->invokeSync(array("task" => "echo", "payload" => array("foobar" => 1234)));
     $this->assertEquals($result[0]["result"]["foobar"], 1234);
 }
 /**
  * @expectedException Jsonize\JsonizeServerException
  */
 public function testJsonizeServerFailure()
 {
     $jsonize = new Jsonize\InstanceJsonize("echo test");
     $result = $jsonize->invokeSync(array("task" => "totalfail", "payload" => array()));
 }
 /**
  * @expectedException Jsonize\JsonizeTimeoutException
  */
 public function testJsonizeTimeout()
 {
     $jsonize = new Jsonize\InstanceJsonize("jsonize");
     //$jsonize = new Jsonize\SocketJsonize("localhost", 1234);
     $result = $jsonize->invokeSync(array("task" => "echotimeout", "payload" => array("delay" => 1000)), 500);
 }
 /**
  * @expectedException Jsonize\JsonizeErrorException
  */
 public function testJsonizeEchoFail()
 {
     $jsonize = new Jsonize\InstanceJsonize("jsonize");
     //$jsonize = new Jsonize\SocketJsonize("localhost", 1234);
     $result = $jsonize->invokeSync(array("task" => "echofail", "payload" => array("foobar" => 1234)));
 }