Codota Logo
JsonRpcServletTest.setupRequest
Code IndexAdd Codota to your IDE (free)

How to use
setupRequest
method
in
org.apache.shindig.protocol.JsonRpcServletTest

Best Java code snippets using org.apache.shindig.protocol.JsonRpcServletTest.setupRequest (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: org.gatein.shindig/shindig-common

@Test
public void testMethodRecognition() throws Exception {
 setupRequest("{method:test.get,id:id,params:{userId:5,groupId:@self}}");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals("{id: 'id', result: {foo:'bar'}}", getOutput());
}
origin: com.lmco.shindig/shindig-common

@Test
public void testInvalidService() throws Exception {
 setupRequest("{method:junk.get,id:id,params:{userId:5,groupId:@self}}");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals(
   "{id:id,error:{message:'notImplemented: The method junk.get is not implemented',code:501}}",
   getOutput());
}
origin: com.lmco.shindig/shindig-common

@Test
public void testBasicBatch() throws Exception {
 setupRequest("[{method:test.get,id:'1'},{method:test.get,id:'2'}]");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals("[{id:'1',result:{foo:'bar'}},{id:'2',result:{foo:'bar'}}]",
   getOutput());
}
origin: apache/shindig

@Test
public void testInvalidService() throws Exception {
 setupRequest("{method:junk.get,id:id,params:{userId:5,groupId:@self}}");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals(
   "{id:id,error:{message:'notImplemented: The method junk.get is not implemented',code:501}}",
   getOutput());
}
origin: org.gatein.shindig/shindig-common

@Test
public void testInvalidService() throws Exception {
 setupRequest("{method:junk.get,id:id,params:{userId:5,groupId:@self}}");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals(
   "{id:id,error:{message:'notImplemented: The method junk.get is not implemented',code:501}}",
   getOutput());
}
origin: org.apache.shindig/shindig-common

@Test
public void testMethodRecognition() throws Exception {
 setupRequest("{method:test.get,id:id,params:{userId:5,groupId:@self}}");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals("{id: 'id', result: {foo:'bar'}}", getOutput());
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testBasicBatch() throws Exception {
 setupRequest("[{method:test.get,id:'1'},{method:test.get,id:'2'}]");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals("[{id:'1',result:{foo:'bar'}},{id:'2',result:{foo:'bar'}}]",
   getOutput());
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testInvalidService() throws Exception {
 setupRequest("{method:junk.get,id:id,params:{userId:5,groupId:@self}}");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals(
   "{id:id,error:{message:'notImplemented: The method junk.get is not implemented',code:501}}",
   getOutput());
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testMethodRecognition() throws Exception {
 setupRequest("{method:test.get,id:id,params:{userId:5,groupId:@self}}");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals("{id: 'id', result: {foo:'bar'}}", getOutput());
}
origin: apache/shindig

@Test
public void testBasicBatch() throws Exception {
 setupRequest("[{method:test.get,id:'1'},{method:test.get,id:'2'}]");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals("[{id:'1',result:{foo:'bar'}},{id:'2',result:{foo:'bar'}}]",
   getOutput());
}
origin: org.apache.shindig/shindig-common

@Test
public void testBasicBatch() throws Exception {
 setupRequest("[{method:test.get,id:'1'},{method:test.get,id:'2'}]");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals("[{id:'1',result:{foo:'bar'}},{id:'2',result:{foo:'bar'}}]",
   getOutput());
}
origin: org.apache.shindig/shindig-common

@Test
public void testInvalidService() throws Exception {
 setupRequest("{method:junk.get,id:id,params:{userId:5,groupId:@self}}");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals(
   "{id:id,error:{message:'notImplemented: The method junk.get is not implemented',code:501}}",
   getOutput());
}
origin: org.gatein.shindig/shindig-common

@Test
public void testBasicBatch() throws Exception {
 setupRequest("[{method:test.get,id:'1'},{method:test.get,id:'2'}]");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals("[{id:'1',result:{foo:'bar'}},{id:'2',result:{foo:'bar'}}]",
   getOutput());
}
origin: com.lmco.shindig/shindig-common

@Test
public void testMethodRecognition() throws Exception {
 setupRequest("{method:test.get,id:id,params:{userId:5,groupId:@self}}");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals("{id: 'id', result: {foo:'bar'}}", getOutput());
}
origin: apache/shindig

@Test
public void testMethodRecognition() throws Exception {
 setupRequest("{method:test.get,id:id,params:{userId:5,groupId:@self}}");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals("{id: 'id', result: {foo:'bar'}}", getOutput());
}
origin: com.lmco.shindig/shindig-common

/**
 * Tests a data handler that returns a failed Future.
 * @throws Exception on failure
 */
@Test
public void testFailedRequest() throws Exception {
 setupRequest("{id:id,method:test.futureException}");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals(
   "{id:id,error:{message:'badRequest: FAILURE_MESSAGE',code:400}}", getOutput());
}
origin: org.wso2.org.apache.shindig/shindig-common

/**
 * Tests a data handler that returns a failed Future.
 * @throws Exception on failure
 */
@Test
public void testFailedRequest() throws Exception {
 setupRequest("{id:id,method:test.futureException}");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals(
   "{id:id,error:{message:'badRequest: FAILURE_MESSAGE',code:400}}", getOutput());
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testDisallowJSONP() throws Exception {
 servlet.setJSONPAllowed(false);
 setupRequest("[{method:test.get,id:'1'},{method:test.get,id:'2'}]");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals("[{id:'1',result:{foo:'bar'}},{id:'2',result:{foo:'bar'}}]",
   getOutput());
 servlet.setJSONPAllowed(true);
}
origin: apache/shindig

@Test
public void testDisallowJSONP() throws Exception {
 servlet.setJSONPAllowed(false);
 setupRequest("[{method:test.get,id:'1'},{method:test.get,id:'2'}]");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals("[{id:'1',result:{foo:'bar'}},{id:'2',result:{foo:'bar'}}]",
   getOutput());
 servlet.setJSONPAllowed(true);
}
origin: org.apache.shindig/shindig-common

@Test
public void testDisallowJSONP() throws Exception {
 servlet.setJSONPAllowed(false);
 setupRequest("[{method:test.get,id:'1'},{method:test.get,id:'2'}]");
 expect(res.getWriter()).andReturn(writer);
 expectLastCall();
 mockControl.replay();
 servlet.service(req, res);
 mockControl.verify();
 JsonAssert.assertJsonEquals("[{id:'1',result:{foo:'bar'}},{id:'2',result:{foo:'bar'}}]",
   getOutput());
 servlet.setJSONPAllowed(true);
}
org.apache.shindig.protocolJsonRpcServletTestsetupRequest

Popular methods of JsonRpcServletTest

  • assertTrue
  • getOutput
  • mockFormDataItem

Popular in Java

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • onCreateOptionsMenu (Activity)
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Notification (javax.management)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now