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

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

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

origin: org.gatein.shindig/shindig-common

@Test
public void testRestPath() {
 DefaultHandlerRegistry.RestPath restPath =
   new DefaultHandlerRegistry.RestPath("/service/const1/{p1}/{p2}+/const2/{p3}", null);
 DefaultHandlerRegistry.RestInvocationWrapper wrapper =
   restPath.accept("service/const1/a/b,c/const2/d".split("/"));
 assertArrayEquals(wrapper.pathParams.get("p1"), new String[]{"a"});
 assertArrayEquals(wrapper.pathParams.get("p2"), new String[]{"b","c"});
 assertArrayEquals(wrapper.pathParams.get("p3"), new String[]{"d"});
 wrapper = restPath.accept("service/const1/a/b/const2".split("/"));
 assertArrayEquals(wrapper.pathParams.get("p1"), new String[]{"a"});
 assertArrayEquals(wrapper.pathParams.get("p2"), new String[]{"b"});
 assertNull(wrapper.pathParams.get("p3"));
 assertNull(restPath.accept("service/const1/{p1}/{p2}+".split("/")));
 assertNull(restPath.accept("service/constmiss/{p1}/{p2}+/const2".split("/")));
}
origin: org.apache.shindig/shindig-common

@Test
public void testSupportedRpcServices() throws Exception {
 assertEquals(registry.getSupportedRpcServices(),
   Sets.newHashSet("test.create", "test.get", "test.overridden", "test.exception",
     "test.futureException", "test.override.rpcname", "test.echo", "test.noArg"));
}
origin: org.gatein.shindig/shindig-common

@Test
public void testGetHandlerRPC() throws Exception {
 assertNotNull(registry.getRpcHandler(new JSONObject("{method : test.get}")));
}
origin: org.apache.shindig/shindig-common

@Test
public void testFutureException() throws Exception {
 // Test calling a handler method which does not return a future
 JSONObject rpc = new JSONObject("{ method : test.futureException }");
 RpcHandler handler = registry.getRpcHandler(rpc);
 Future<?> future = handler.execute(null, null, null);
 try {
  future.get();
  fail("Service method did not produce ExecutionException from Future");
 } catch (ExecutionException ee) {
  assertSame(ee.getCause().getClass(), ProtocolException.class);
 }
}
origin: com.lmco.shindig/shindig-common

@Test
public void testNonFutureException() throws Exception {
 // Test calling a handler method which does not return a future
 JSONObject rpc = new JSONObject("{ method : test.exception }");
 RpcHandler handler = registry.getRpcHandler(rpc);
 Future<?> future = handler.execute(null, null, null);
 try {
  future.get();
  fail("Service method did not produce NullPointerException from Future");
 } catch (ExecutionException ee) {
  assertSame(ee.getCause().getClass(), NullPointerException.class);
 }
}
origin: apache/shindig

@Test
public void testFutureException() throws Exception {
 // Test calling a handler method which does not return a future
 JSONObject rpc = new JSONObject("{ method : test.futureException }");
 RpcHandler handler = registry.getRpcHandler(rpc);
 Future<?> future = handler.execute(null, null, null);
 try {
  future.get();
  fail("Service method did not produce ExecutionException from Future");
 } catch (ExecutionException ee) {
  assertSame(ee.getCause().getClass(), ProtocolException.class);
 }
}
origin: org.gatein.shindig/shindig-common

@Test
public void testSupportedRpcServices() throws Exception {
 assertEquals(registry.getSupportedRpcServices(),
   Sets.newHashSet("test.create", "test.get", "test.overridden", "test.exception",
     "test.futureException", "test.override.rpcname", "test.echo", "test.noArg"));
}
origin: org.gatein.shindig/shindig-common

@Test
public void testOverrideHandlerRPC() throws Exception {
 assertNotNull(registry.getRpcHandler(new JSONObject("{method : test.overidden}")));
}
origin: org.apache.shindig/shindig-common

@Test
public void testRestPath() {
 DefaultHandlerRegistry.RestPath restPath =
   new DefaultHandlerRegistry.RestPath("/service/const1/{p1}/{p2}+/const2/{p3}", null);
 DefaultHandlerRegistry.RestInvocationWrapper wrapper =
   restPath.accept("service/const1/a/b,c/const2/d".split("/"));
 assertArrayEquals(wrapper.pathParams.get("p1"), new String[]{"a"});
 assertArrayEquals(wrapper.pathParams.get("p2"), new String[]{"b","c"});
 assertArrayEquals(wrapper.pathParams.get("p3"), new String[]{"d"});
 wrapper = restPath.accept("service/const1/a/b/const2".split("/"));
 assertArrayEquals(wrapper.pathParams.get("p1"), new String[]{"a"});
 assertArrayEquals(wrapper.pathParams.get("p2"), new String[]{"b"});
 assertNull(wrapper.pathParams.get("p3"));
 assertNull(restPath.accept("service/const1/{p1}/{p2}+".split("/")));
 assertNull(restPath.accept("service/constmiss/{p1}/{p2}+/const2".split("/")));
}
origin: org.gatein.shindig/shindig-common

@Test
public void testNonFutureException() throws Exception {
 // Test calling a handler method which does not return a future
 JSONObject rpc = new JSONObject("{ method : test.exception }");
 RpcHandler handler = registry.getRpcHandler(rpc);
 Future<?> future = handler.execute(null, null, null);
 try {
  future.get();
  fail("Service method did not produce NullPointerException from Future");
 } catch (ExecutionException ee) {
  assertSame(ee.getCause().getClass(), NullPointerException.class);
 }
}
origin: org.gatein.shindig/shindig-common

@Test
public void testSupportedRestServices() throws Exception {
 assertEquals(registry.getSupportedRestServices(),
   Sets.newHashSet("GET /test/{someParam}/{someOtherParam}",
     "PUT /test/{someParam}/{someOtherParam}",
     "DELETE /test/{someParam}/{someOtherParam}",
     "POST /test/{someParam}/{someOtherParam}",
     "GET /test/overridden/method",
     "GET /test/echo"));
}
origin: com.lmco.shindig/shindig-common

@Test
public void testOverrideHandlerRPC() throws Exception {
 assertNotNull(registry.getRpcHandler(new JSONObject("{method : test.overidden}")));
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testRestPath() {
 DefaultHandlerRegistry.RestPath restPath =
   new DefaultHandlerRegistry.RestPath("/service/const1/{p1}/{p2}+/const2/{p3}", null);
 DefaultHandlerRegistry.RestInvocationWrapper wrapper =
   restPath.accept("service/const1/a/b,c/const2/d".split("/"));
 assertArrayEquals(wrapper.pathParams.get("p1"), new String[]{"a"});
 assertArrayEquals(wrapper.pathParams.get("p2"), new String[]{"b","c"});
 assertArrayEquals(wrapper.pathParams.get("p3"), new String[]{"d"});
 wrapper = restPath.accept("service/const1/a/b/const2".split("/"));
 assertArrayEquals(wrapper.pathParams.get("p1"), new String[]{"a"});
 assertArrayEquals(wrapper.pathParams.get("p2"), new String[]{"b"});
 assertNull(wrapper.pathParams.get("p3"));
 assertNull(restPath.accept("service/const1/{p1}/{p2}+".split("/")));
 assertNull(restPath.accept("service/constmiss/{p1}/{p2}+/const2".split("/")));
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testFutureException() throws Exception {
 // Test calling a handler method which does not return a future
 JSONObject rpc = new JSONObject("{ method : test.futureException }");
 RpcHandler handler = registry.getRpcHandler(rpc);
 Future<?> future = handler.execute(null, null, null);
 try {
  future.get();
  fail("Service method did not produce ExecutionException from Future");
 } catch (ExecutionException ee) {
  assertSame(ee.getCause().getClass(), ProtocolException.class);
 }
}
origin: apache/shindig

@Test
public void testSupportedRpcServices() throws Exception {
 assertEquals(registry.getSupportedRpcServices(),
   Sets.newHashSet("test.create", "test.get", "test.overridden", "test.exception",
     "test.futureException", "test.override.rpcname", "test.echo", "test.noArg"));
}
origin: com.lmco.shindig/shindig-common

@Test
public void testGetHandlerRPC() throws Exception {
 assertNotNull(registry.getRpcHandler(new JSONObject("{method : test.get}")));
}
origin: com.lmco.shindig/shindig-common

@Test
public void testRestPath() {
 DefaultHandlerRegistry.RestPath restPath =
   new DefaultHandlerRegistry.RestPath("/service/const1/{p1}/{p2}+/const2/{p3}", null);
 DefaultHandlerRegistry.RestInvocationWrapper wrapper =
   restPath.accept("service/const1/a/b,c/const2/d".split("/"));
 assertArrayEquals(wrapper.pathParams.get("p1"), new String[]{"a"});
 assertArrayEquals(wrapper.pathParams.get("p2"), new String[]{"b","c"});
 assertArrayEquals(wrapper.pathParams.get("p3"), new String[]{"d"});
 wrapper = restPath.accept("service/const1/a/b/const2".split("/"));
 assertArrayEquals(wrapper.pathParams.get("p1"), new String[]{"a"});
 assertArrayEquals(wrapper.pathParams.get("p2"), new String[]{"b"});
 assertNull(wrapper.pathParams.get("p3"));
 assertNull(restPath.accept("service/const1/{p1}/{p2}+".split("/")));
 assertNull(restPath.accept("service/constmiss/{p1}/{p2}+/const2".split("/")));
}
origin: org.apache.shindig/shindig-common

@Test
public void testNonFutureException() throws Exception {
 // Test calling a handler method which does not return a future
 JSONObject rpc = new JSONObject("{ method : test.exception }");
 RpcHandler handler = registry.getRpcHandler(rpc);
 Future<?> future = handler.execute(null, null, null);
 try {
  future.get();
  fail("Service method did not produce NullPointerException from Future");
 } catch (ExecutionException ee) {
  assertSame(ee.getCause().getClass(), NullPointerException.class);
 }
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testSupportedRpcServices() throws Exception {
 assertEquals(registry.getSupportedRpcServices(),
   Sets.newHashSet("test.create", "test.get", "test.overridden", "test.exception",
     "test.futureException", "test.override.rpcname", "test.echo", "test.noArg"));
}
origin: com.lmco.shindig/shindig-common

@Test
public void testOverrideHandlerRPCName() throws Exception {
 assertNotNull(registry.getRpcHandler(new JSONObject("{method : test.override.rpcname}")));
}
org.apache.shindig.protocolDefaultHandlerRegistryTest

Javadoc

Tests BasicHandleRregistry

Most used methods

  • assertArrayEquals
  • assertEquals
  • assertNotNull
  • assertNull
  • assertSame
  • fail

Popular in Java

  • Updating database using SQL prepared statement
  • putExtra (Intent)
  • runOnUiThread (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JLabel (javax.swing)
  • Top plugins for WebStorm
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