Examples of ClientResponse


Examples of org.jboss.resteasy.client.ClientResponse

      contentSignature.setSelector("test");
      contentSignature.setAttribute("code", "hello");
      contentSignature.setPrivateKey(keys.getPrivate());
      request.header(DKIMSignature.DKIM_SIGNATURE, contentSignature);
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(204, response.getStatus());


   }
View Full Code Here

Examples of org.jboss.resteasy.client.ClientResponse

      contentSignature.setDomain("samplezone.org");
      request.getAttributes().put(KeyRepository.class.getName(), repository);

      request.header(DKIMSignature.DKIM_SIGNATURE, contentSignature);
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(204, response.getStatus());


   }
View Full Code Here

Examples of org.jboss.resteasy.client.ClientResponse

      contentSignature.setSelector("test");
      contentSignature.setDomain("samplezone.org");
      contentSignature.setPrivateKey(badKey);
      request.header(DKIMSignature.DKIM_SIGNATURE, contentSignature);
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(401, response.getStatus());
   }
View Full Code Here

Examples of org.jboss.resteasy.client.ClientResponse

   @Test
   public void testBasicVerificationNoSignature() throws Exception
   {
      ClientRequest request = new ClientRequest(TestPortProvider.generateURL("/signed"));
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(401, response.getStatus());
   }
View Full Code Here

Examples of org.jboss.resteasy.client.ClientResponse

   @Test
   public void testMapper() throws Exception
   {
      ClientRequest request = new ClientRequest(generateBaseUrl() + "/test");
      ClientResponse response = request.get();
      Assert.assertEquals(Response.Status.PRECONDITION_FAILED.getStatusCode(), response.getStatus());
   }
View Full Code Here

Examples of org.jboss.resteasy.client.ClientResponse

   {
      ClientRequest request = new ClientRequest(generateURL("/test1"));
      Foo foo = new Foo();
      foo.setName("Bill");
      request.body("application/xml", foo);
      ClientResponse res = request.post();
      Assert.assertEquals(res.getEntity(String.class), "Bill");

      request = new ClientRequest(generateURL("/test1"));
      res = request.post();
      Assert.assertEquals(res.getEntity(String.class), "NULL");


   }
View Full Code Here

Examples of org.jboss.resteasy.client.ClientResponse

   {
      ClientRequest request = new ClientRequest(generateURL("/test2"));
      Foo foo = new Foo();
      foo.setName("Bill");
      request.body("application/xml", foo);
      ClientResponse res = request.post();
      Assert.assertEquals(res.getEntity(String.class), "Bill");

      request = new ClientRequest(generateURL("/test2"));
      res = request.post();
      Assert.assertEquals(res.getEntity(String.class), "NULL");


   }
View Full Code Here

Examples of org.jboss.resteasy.client.ClientResponse

   @Test
   public void testBadRequest() throws Exception
   {
      ClientRequest request = new ClientRequest(generateURL("/test"));
      request.body("application/xml", "<junk");
      ClientResponse res = request.post();
      Assert.assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), res.getStatus());
   }
View Full Code Here

Examples of org.jboss.resteasy.client.jaxrs.internal.ClientResponse

   }

   public Object invoke(Object[] args)
   {
      ClientInvocation request = createRequest(args);
      ClientResponse response = (ClientResponse)request.invoke();
      ClientContext context = new ClientContext(request, response, entityExtractorFactory);
      return extractor.extractEntity(context, null);
   }
View Full Code Here

Examples of org.voltdb.client.ClientResponse

       
        String sql = String.format("SELECT * FROM %s WHERE custid = 1",
                                   SmallBankConstants.TABLENAME_ACCOUNTS);
       
        String procName = VoltSystemProcedure.procCallName(AdHoc.class);
        ClientResponse cresponse = client.callProcedure(procName, sql);
        assert(cresponse.getStatus() == Status.OK) : cresponse.toString();

        // XXX: We currently have no way of checking the read/write set
        //      for adhoc queries, so I just have this for checking manually.
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.