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

  • Running tasks concurrently on multiple threads
  • getContentResolver (Context)
  • onCreateOptionsMenu (Activity)
  • findViewById (Activity)
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JTextField (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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