Package com.betfair.testing.utils.cougar.beans

Examples of com.betfair.testing.utils.cougar.beans.HttpCallBean


    Map<String, Timestamp> expectedRequestTimes = new LinkedHashMap<String, Timestamp>();
    
   
    for (int i = 0; i < numberOfRequests+1; i++) {
      //Setup call beans
      HttpCallBean callBean = createComplexCallBean(responseContentType, i);
      httpCallBeans.add(callBean);
     
      //Store expected responses
      HttpResponseBean responseBean = createExpectedResponse(responseContentType, callBean, i);
      expectedResponses.put("Response " + i, responseBean);
View Full Code Here


    return returnBean; 
  }
 
  private HttpCallBean createComplexCallBean(CougarMessageContentTypeEnum responseContentType, int i){
   
    HttpCallBean callBean = new HttpCallBean();
    callBean.setServiceName("baseline","cougarBaseline");
    callBean.setVersion("v2");
    callBean.setOperationName("testComplexMutator","complex");
         
    Map<String, String> acceptProtocols = new HashMap<String,String>();
    switch (responseContentType) {
    case JSON:
      acceptProtocols.put("application/json", "");
      break;
    case XML:
      acceptProtocols.put("application/xml", "");
      break;
    }
    callBean.setAcceptProtocols(acceptProtocols);
   
    String requestXmlString = "";
    requestXmlString = "<message><name>sum</name><value1> " + i + "</value1><value2>" + i + "</value2></message>";
    Document requestDocument = xHelpers.getXMLObjectFromString(requestXmlString);
    callBean.setRestPostQueryObjects(requestDocument);
   
    return callBean;
  }
View Full Code Here

   
    public void buildCalls(CougarMessageContentTypeEnum responseContentTypeEnum) {
     
      for (int i = 0; i < numberOfRequests+1; i++) {
        //Setup call beans
        HttpCallBean callBean = new HttpCallBean();
        callBean.setServiceName("baseline","cougarBaseline");
        callBean.setVersion("v2");
        callBean.setOperationName("testComplexMutator","complex");
             
        Map<String, String> acceptProtocols = new HashMap<String,String>();
        switch (responseContentTypeEnum) {
        case JSON:
          acceptProtocols.put("application/json", "");
          break;
        case XML:
          acceptProtocols.put("application/xml", "");
          break;
        }
        callBean.setAcceptProtocols(acceptProtocols);
       
        String requestXmlString = "";
        requestXmlString = "<message><name>sum</name><value1> " + i + "</value1><value2>" + i + "</value2></message>";
        Document requestDocument = xHelpers.getXMLObjectFromString(requestXmlString);
        callBean.setRestPostQueryObjects(requestDocument);
        httpCallBeans.add(callBean);
       
        //Store expected responses
        HttpResponseBean responseBean = new HttpResponseBean();
        String responseXmlString = "<SimpleResponse><message>sum = " + i*2 + "</message></SimpleResponse>";
View Full Code Here

   
    public void buildCalls(CougarMessageContentTypeEnum responseContentTypeEnum) {
     
      for (int i = 0; i < numberOfRequests+1; i++) {
        //Setup call beans
        HttpCallBean callBean = new HttpCallBean();
        callBean.setServiceName("baseline","cougarBaseline");
        callBean.setVersion("v2");
        callBean.setOperationName("testSimpleGet","simple");
        LinkedHashMap<String, String> queryParams = new LinkedHashMap<String, String>();
        String queryParameter = identifier + "-" + i;
        queryParams.put("message",queryParameter );
        callBean.setQueryParams(queryParams);
        httpCallBeans.add(callBean);
             
        Map<String, String> acceptProtocols = new HashMap<String,String>();
        switch (responseContentTypeEnum) {
        case JSON:
          acceptProtocols.put("application/json", "");
          break;
        case XML:
          acceptProtocols.put("application/xml", "");
          break;
        }
        callBean.setAcceptProtocols(acceptProtocols);
       
        //Store expected responses
        HttpResponseBean responseBean = new HttpResponseBean();
        String responseXmlString = "<SimpleResponse><message>" + queryParameter + "</message></SimpleResponse>";
        Document responseBaseObject = xHelpers.getXMLObjectFromString(responseXmlString);
View Full Code Here

   
    public void buildCalls() throws JSONException {
     
      for (int i = 0; i < numberOfRequests+1; i++) {
        //Setup call beans
        HttpCallBean callBean = new HttpCallBean();

        BatchedRequestBean request1 = new BatchedRequestBean();
        request1.setMethod("testSimpleGet");
        request1.setId("1");
        request1.setParams("[\"foo\"]");
        request1.setVersion("2.0");
                request1.setService("Baseline");

        BatchedRequestBean request2 = new BatchedRequestBean();
        request2.setMethod("testSimpleGet");
        request2.setId("2");
        request2.setParams("[\"foo\"]");
        request2.setVersion("2.0");
                request2.setService("Baseline");

        List<BatchedRequestBean> requests = new ArrayList<BatchedRequestBean>();
        requests.add(request1);
        requests.add(request2);
       
        callBean.setJSONRPC(true);
        callBean.setBatchedRequestsDirect(requests);
        httpCallBeans.add(callBean);
       
        //Store expected responses
        Map<String,Object> responseMap = new HashMap<String,Object>();
       
View Full Code Here

   
    public void buildCalls() throws JSONException {
     
      for (int i = 0; i < numberOfRequests+1; i++) {
        //Setup call beans
        HttpCallBean callBean = new HttpCallBean();
       
        BatchedRequestBean request1 = new BatchedRequestBean();
        request1.setMethod("testComplexMutator");
        request1.setId("1");
        request1.setParams("[{\"name\":\"sum1\",\"value1\":7,\"value2\":55}]");
        request1.setVersion("2.0");
                request1.setService("Baseline");
       
        BatchedRequestBean request2 = new BatchedRequestBean();
        request2.setMethod("testComplexMutator");
        request2.setId("2");
        request2.setParams("[{\"name\":\"sum2\",\"value1\":8,\"value2\":55}]");
        request2.setVersion("2.0");
                request2.setService("Baseline");
       
        List<BatchedRequestBean> requests = new ArrayList<BatchedRequestBean>();
        requests.add(request1);
        requests.add(request2);
       
        callBean.setJSONRPC(true);
        callBean.setBatchedRequestsDirect(requests);
        httpCallBeans.add(callBean);
       
        //Store expected responses
        Map<String,Object> responseMap = new HashMap<String,Object>();
       
View Full Code Here

   
    public void buildCalls(CougarMessageContentTypeEnum responseContentTypeEnum) {
     
      for (int i = 0; i < numberOfRequests+1; i++) {
        //Setup call beans
        HttpCallBean callBean = new HttpCallBean();
        callBean.setServiceName("baseline","cougarBaseline");
        callBean.setVersion("v2");
        callBean.setOperationName("testSimpleGet","simple");
        LinkedHashMap<String, String> queryParams = new LinkedHashMap<String, String>();
        String queryParameter = identifier + "-" + i;
        queryParams.put("message", queryParameter);
        callBean.setQueryParams(queryParams);
        httpCallBeans.add(callBean);
             
        Map<String, String> acceptProtocols = new HashMap<String,String>();
        switch (responseContentTypeEnum) {
        case JSON:
          acceptProtocols.put("application/json", "");
          break;
        case XML:
          acceptProtocols.put("application/xml", "");
          break;
        }
        callBean.setAcceptProtocols(acceptProtocols);
       
        //Store expected responses
        HttpResponseBean responseBean = new HttpResponseBean();
        String responseXmlString = "<SimpleResponse><message>" + queryParameter + "</message></SimpleResponse>";
        Document responseBaseObject = xHelpers.getXMLObjectFromString(responseXmlString);
View Full Code Here

  public void buildCalls(String operationName) {
         
    for (int i = 0; i < numberOfRequests + 1; i++) {
     
      // Setup call beans
      HttpCallBean callBean = new HttpCallBean();
      callBean.setServiceName("BaselineService");
      callBean.setVersion("v2");

      //TODO decide here at run time what message to create? for multiple services??
     
      SOAPMessageExchange msgEx = null;
     
      if(operationName.equalsIgnoreCase("TestComplexMutator")){
        msgEx = SOAPGenerator.buildSOAPMessageCOMPLEX(callBean);
      }
      else if (operationName.equalsIgnoreCase("TestSimpleGet")){
        msgEx = SOAPGenerator.buildSOAPMessageSIMPLEGET(callBean);
      }
      else if(operationName.equalsIgnoreCase("TestParameterStylesQA")){
        msgEx = SOAPGenerator.buildSOAPMessagePARAMSTYLES(callBean);
      }
      else if(operationName.equalsIgnoreCase("TestAsyncGet")){
        msgEx = SOAPGenerator.buildSOAPMessageAsyncGet(callBean);
      }
      else{
        throw new RuntimeException("Unsupported operation. i dont know how to handle the following operation: " + operationName);
      }
       
      callBean.setSOAPMessage(msgEx.getRequest());
     
      httpCallBeans.add(callBean);

      // create expected responses
      HttpResponseBean responseBean = new HttpResponseBean();
View Full Code Here

   
    public void buildCalls(CougarMessageContentTypeEnum responseContentTypeEnum) {
     
      for (int i = 0; i < numberOfRequests+1; i++) {
        //Setup call beans
        HttpCallBean callBean = new HttpCallBean();
        callBean.setServiceName("baseline","cougarBaseline");
        callBean.setVersion("v2");
        callBean.setOperationName("testParameterStylesQA");
       
        Map<String, String> headerParams = new HashMap<String, String>();
        headerParams.put("headerParam", "Foo");
        callBean.setHeaderParams(headerParams);
       
        Map<String, String> queryParams = new HashMap<String, String>();
        String queryParameter = "queryParameter-" + identifier + "-" + i;
        queryParams.put("queryParam", queryParameter);
        String dateQueryParameter = "2009-06-01T13:50:00.0Z";
        queryParams.put("dateQueryParam", dateQueryParameter);
        callBean.setQueryParams(queryParams);
       
       
        httpCallBeans.add(callBean);
             
        Map<String, String> acceptProtocols = new HashMap<String,String>();
        switch (responseContentTypeEnum) {
        case JSON:
          acceptProtocols.put("application/json", "");
          break;
        case XML:
          acceptProtocols.put("application/xml", "");
          break;
        }
        callBean.setAcceptProtocols(acceptProtocols);
       
        //Store expected responses
        HttpResponseBean responseBean = new HttpResponseBean();
        String responseXmlString = "<SimpleResponse><message>headerParam=Foo,queryParam=" + queryParameter + ",dateQueryParam=Mon Jun 01 13:50:00 UTC 2009</message></SimpleResponse>";
        Document responseBaseObject = xHelpers.getXMLObjectFromString(responseXmlString);
View Full Code Here

   
    public void buildCalls(CougarMessageContentTypeEnum responseContentTypeEnum) {
     
      for (int i = 0; i < numberOfRequests+1; i++) {
        //Setup call beans
        HttpCallBean callBean = new HttpCallBean();
        callBean.setServiceName("baseline","cougarBaseline");
        callBean.setVersion("v2");
        callBean.setOperationName("testComplexMutator","complex");
             
        Map<String, String> acceptProtocols = new HashMap<String,String>();
        switch (responseContentTypeEnum) {
        case JSON:
          acceptProtocols.put("application/json", "");
          break;
        case XML:
          acceptProtocols.put("application/xml", "");
          break;
        }
        callBean.setAcceptProtocols(acceptProtocols);
       
        String requestXmlString = "";
        requestXmlString = "<message><name>sum</name><value1> " + i + "</value1><value2>" + i + "</value2></message>";
        Document requestDocument = xHelpers.getXMLObjectFromString(requestXmlString);
        callBean.setRestPostQueryObjects(requestDocument);
        httpCallBeans.add(callBean);
       
        //Store expected responses
        HttpResponseBean responseBean = new HttpResponseBean();
        String responseXmlString = "<SimpleResponse><message>sum = " + i*2 + "</message></SimpleResponse>";
View Full Code Here

TOP

Related Classes of com.betfair.testing.utils.cougar.beans.HttpCallBean

Copyright © 2018 www.massapicom. 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.