Codota Logo
DefaultHandlerRegistryTest
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
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 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: 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 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 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

  • Making http requests using okhttp
  • getContentResolver (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • JFileChooser (javax.swing)
  • JTable (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
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