Tabnine Logo
TestHandler
Code IndexAdd Tabnine to your IDE (free)

How to use
TestHandler
in
org.apache.shindig.protocol

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

origin: org.apache.shindig/shindig-common

@Operation(httpMethods = {"POST", "PUT"})
public Future<?> create(RequestItem req) {
 if (mock != null) {
  return mock.create(req);
 }
 return Futures.immediateFuture(CREATE_RESPONSE);
}
origin: com.lmco.shindig/shindig-common

@Operation(httpMethods = {})
public void exception(RequestItem req) {
 if (mock != null) {
  mock.exception(req);
 } else {
  throw new NullPointerException(FAILURE_MESSAGE);
 }
}

origin: com.lmco.shindig/shindig-common

@Operation(httpMethods = "DELETE")
public Future<?> futureException(RequestItem req) {
 if (mock != null) {
  return mock.futureException(req);
 }
 return ImmediateFuture.errorInstance(new ProtocolException(HttpServletResponse.SC_BAD_REQUEST,
   FAILURE_MESSAGE, new Throwable()));
}
origin: org.gatein.shindig/shindig-common

reset(multipartFormParser);
handler.setMock(new TestHandler() {
 @Override
 public Object get(RequestItem req) {
origin: org.apache.shindig/shindig-common

@Operation(httpMethods = "GET")
public Object get(RequestItem req) {
 if (mock != null) {
  return mock.get(req);
 }
 return GET_RESPONSE;
}
origin: org.apache.shindig/shindig-common

@Before
public void setUp() throws Exception {
 converter = new BeanJsonConverter(Guice.createInjector());
 registry = new DefaultHandlerRegistry(null, converter,
   new HandlerExecutionListener.NoOpHandler());
 registry.addHandlers(Sets.<Object>newHashSet(new TestHandler()));
}
origin: org.wso2.org.apache.shindig/shindig-common

reset(multipartFormParser);
handler.setMock(new TestHandler() {
 @Override
 public Object get(RequestItem req) {
origin: org.gatein.shindig/shindig-common

@Operation(httpMethods = "GET")
public Object get(RequestItem req) {
 if (mock != null) {
  return mock.get(req);
 }
 return GET_RESPONSE;
}
origin: com.lmco.shindig/shindig-common

@Before
public void setUp() throws Exception {
 converter = new BeanJsonConverter(Guice.createInjector());
 registry = new DefaultHandlerRegistry(null, converter,
   new HandlerExecutionListener.NoOpHandler());
 registry.addHandlers(Sets.<Object>newHashSet(new TestHandler()));
}
origin: org.apache.shindig/shindig-common

reset(multipartFormParser);
handler.setMock(new TestHandler() {
 @Override
 public Object get(RequestItem req) {
origin: org.apache.shindig/shindig-common

@Operation(name="override.rpcname", httpMethods = "")
public Object overriddenRpc(RequestItem req) {
 if (mock != null) {
  return mock.get(req);
 }
 return GET_RESPONSE;
}
origin: org.gatein.shindig/shindig-common

@Before
public void setUp() throws Exception {
 converter = new BeanJsonConverter(Guice.createInjector());
 registry = new DefaultHandlerRegistry(null, converter,
   new HandlerExecutionListener.NoOpHandler());
 registry.addHandlers(Sets.<Object>newHashSet(new TestHandler()));
}
origin: org.wso2.org.apache.shindig/shindig-common

@Operation(httpMethods = {"POST", "PUT"})
public Future<?> create(RequestItem req) {
 if (mock != null) {
  return mock.create(req);
 }
 return Futures.immediateFuture(CREATE_RESPONSE);
}
origin: org.gatein.shindig/shindig-common

@Operation(httpMethods = {})
public void exception(RequestItem req) {
 if (mock != null) {
  mock.exception(req);
 } else {
  throw new NullPointerException(FAILURE_MESSAGE);
 }
}

origin: org.wso2.org.apache.shindig/shindig-common

@Operation(httpMethods = "DELETE")
public Future<?> futureException(RequestItem req) {
 if (mock != null) {
  return mock.futureException(req);
 }
 return Futures.immediateFailedFuture(new ProtocolException(HttpServletResponse.SC_BAD_REQUEST,
   FAILURE_MESSAGE, new Throwable()));
}
origin: org.wso2.org.apache.shindig/shindig-common

reset(multipartFormParser);
handler.setMock(new TestHandler() {
 @Override
 public Object get(RequestItem req) {
origin: org.wso2.org.apache.shindig/shindig-common

@Operation(httpMethods = "GET", path = "/overridden/method")
public Object overridden(RequestItem req) {
 if (mock != null) {
  return mock.get(req);
 }
 return GET_RESPONSE;
}
origin: org.wso2.org.apache.shindig/shindig-common

@Before
public void setUp() throws Exception {
 converter = new BeanJsonConverter(Guice.createInjector());
 registry = new DefaultHandlerRegistry(null, converter,
   new HandlerExecutionListener.NoOpHandler());
 registry.addHandlers(Sets.<Object>newHashSet(new TestHandler()));
}
origin: apache/shindig

@Operation(httpMethods = {"POST", "PUT"})
public Future<?> create(RequestItem req) {
 if (mock != null) {
  return mock.create(req);
 }
 return Futures.immediateFuture(CREATE_RESPONSE);
}
origin: apache/shindig

@Operation(httpMethods = {})
public void exception(RequestItem req) {
 if (mock != null) {
  mock.exception(req);
 } else {
  throw new NullPointerException(FAILURE_MESSAGE);
 }
}
org.apache.shindig.protocolTestHandler

Javadoc

Simple test handler implementation. Can be used standalone or to wrap a mock delegate.

Most used methods

  • <init>
  • create
  • exception
  • futureException
  • get
  • setMock

Popular in Java

  • Parsing JSON documents to java classes using gson
  • addToBackStack (FragmentTransaction)
  • getResourceAsStream (ClassLoader)
  • compareTo (BigDecimal)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JButton (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now