Examples of RpcHandler


Examples of com.ecyrd.jspwiki.xmlrpc.RPCHandler

        m_props = new Properties();
        m_props.load( TestEngine.findTestProperties() );

        m_engine = new TestEngine( m_props );

        m_handler = new RPCHandler();
        WikiContext ctx = new WikiContext( m_engine, new WikiPage(m_engine, "Dummy") );
        m_handler.initialize( ctx );
    }
View Full Code Here

Examples of ecks.RPC.RPCHandler

        if (Configuration.Config.get("rpcport").equals("any"))
            myConf.RPCServer = new WebServer(8081);
        else
            myConf.RPCServer = new WebServer(Integer.parseInt(Configuration.Config.get("rpcport")), inetT);

        myConf.RPCServer.addHandler("ecks", new RPCHandler());
        myConf.RPCServer.start();

        Logging.info("STARTUP", "XMLRPC Started...");
        Logging.verbose("STARTUP", "Good luck!");
    }
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

    mockGadget(new ArrayList<Feature>(), "default","http://www.example.com/gadget.xml");
    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();
    expect(mockProcessor.process(EasyMock.isA(GadgetContext.class))).andReturn(mockGadget);

    replay();
    RpcHandler operation = registry.getRpcHandler(request);

    HttpRequestHandler.HttpApiResponse httpApiResponse =
            (HttpRequestHandler.HttpApiResponse)operation.execute(emptyFormItems, token, converter).get();
    verify();

    JsonAssert.assertJsonEquals("{ headers : {}, status : 200, content : 'CONTENT' }}",
            converter.convertToString(httpApiResponse));
  }
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();
    expect(mockProcessor.process(EasyMock.isA(GadgetContext.class))).andThrow(
            new ProcessingException("error", HttpServletResponse.SC_BAD_REQUEST)).anyTimes();

    replay();
    RpcHandler operation = registry.getRpcHandler(request);

    HttpRequestHandler.HttpApiResponse httpApiResponse =
            (HttpRequestHandler.HttpApiResponse)operation.execute(emptyFormItems, token, converter).get();
    verify();

    JsonAssert.assertJsonEquals("{ headers : {}, status : 200, content : 'CONTENT' }}",
            converter.convertToString(httpApiResponse));
  }
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

    HttpRequest httpRequest = new HttpRequest(Uri.parse("http://www.example.org/somecontent"));
    httpRequest.setMethod("GET");
    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();

    replay();
    RpcHandler operation = registry.getRpcHandler(request);

    HttpRequestHandler.HttpApiResponse httpApiResponse =
        (HttpRequestHandler.HttpApiResponse)operation.execute(emptyFormItems, token, converter).get();
    verify();

    JsonAssert.assertJsonEquals("{ headers : {}, status : 200, content : 'CONTENT' }}",
        converter.convertToString(httpApiResponse));
  }
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

        + "href:'http://www.example.org/somecontent',"
        + "body:'POSTBODY'"
        + "}}");
    HttpRequest httpRequest = new HttpRequest(Uri.parse("http://www.example.org/somecontent"));
    httpRequest.setMethod("GET");
    RpcHandler operation = registry.getRpcHandler(request);
    try {
      operation.execute(emptyFormItems, token, converter).get();
      fail("Body should not be allowed in GET request");
    } catch (ExecutionException ee) {
      assertTrue(ee.getCause() instanceof ProtocolException);
    }
  }
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

    httpRequest.setMethod("POST");
    httpRequest.setPostBody("POSTBODY".getBytes());
    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();

    replay();
    RpcHandler operation = registry.getRpcHandler(request);

    HttpRequestHandler.HttpApiResponse httpApiResponse =
        (HttpRequestHandler.HttpApiResponse)operation.execute(emptyFormItems, token, converter).get();
    verify();

    JsonAssert.assertJsonEquals("{ headers : {}, status : 200, content : 'CONTENT' }}",
        converter.convertToString(httpApiResponse));
  }
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

    httpRequest.setHeader("goodheader", "good");
    httpRequest.setHeader("Content-Length", "1000");
    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();

    replay();
    RpcHandler operation = registry.getRpcHandler(request);

    HttpRequestHandler.HttpApiResponse httpApiResponse =
        (HttpRequestHandler.HttpApiResponse)operation.execute(emptyFormItems, token, converter).get();
    verify();

    JsonAssert.assertJsonEquals("{ headers : {}, status : 200, content : 'CONTENT' }}",
        converter.convertToString(httpApiResponse));
  }
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();

    replay();

    RpcHandler operation = registry.getRpcHandler(request);

    HttpRequestHandler.HttpApiResponse httpApiResponse =
        (HttpRequestHandler.HttpApiResponse)operation.execute(emptyFormItems, token, converter).get();
    verify();

    JSONObject feed = (JSONObject) httpApiResponse.getContent();
      JSONObject entry = feed.getJSONArray("Entry").getJSONObject(0);
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

    httpRequest.setMethod("GET");

    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();

    replay();
    RpcHandler operation = registry.getRpcHandler(request);

    HttpRequestHandler.HttpApiResponse httpApiResponse =
        (HttpRequestHandler.HttpApiResponse)operation.execute(emptyFormItems, token, converter).get();
    verify();

    JSONObject feed = (JSONObject) httpApiResponse.getContent();
    JSONArray feeds = feed.getJSONArray("Entry");
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.