congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
DefaultHandlerRegistryTest.assertSame
Code IndexAdd Tabnine to your IDE (free)

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

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

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: 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: com.lmco.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 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 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 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 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.wso2.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: apache/shindig

@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: com.lmco.shindig/shindig-common

@Test
public void testRestHandler_serviceDoesntExist() {
 RestHandler restHandler = registry.getRestHandler("/makebelieve", "GET");
 try {
  Future<?> future = restHandler.execute(Maps.<String, String[]>newHashMap(), null, null, null);
  future.get();
  fail("Expect exception for missing method");
 } catch (ExecutionException t) {
  assertSame(t.getCause().getClass(), ProtocolException.class);
  Assert.assertEquals(HttpServletResponse.SC_NOT_IMPLEMENTED, ((ProtocolException) t.getCause()).getCode());
 } catch (Throwable t) {
  fail("Unexpected exception " + t.toString());
 }
}
origin: org.gatein.shindig/shindig-common

@Test
public void testRestHandler_serviceDoesntExist() {
 RestHandler restHandler = registry.getRestHandler("/makebelieve", "GET");
 try {
  Future<?> future = restHandler.execute(Maps.<String, String[]>newHashMap(), null, null, null);
  future.get();
  fail("Expect exception for missing method");
 } catch (ExecutionException t) {
  assertSame(t.getCause().getClass(), ProtocolException.class);
  Assert.assertEquals(HttpServletResponse.SC_NOT_IMPLEMENTED, ((ProtocolException) t.getCause()).getCode());
 } catch (Throwable t) {
  fail("Unexpected exception " + t.toString());
 }
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testRestHandler_serviceDoesntExist() {
 RestHandler restHandler = registry.getRestHandler("/makebelieve", "GET");
 try {
  Future<?> future = restHandler.execute(Maps.<String, String[]>newHashMap(), null, null, null);
  future.get();
  fail("Expect exception for missing method");
 } catch (ExecutionException t) {
  assertSame(t.getCause().getClass(), ProtocolException.class);
  Assert.assertEquals(HttpServletResponse.SC_NOT_IMPLEMENTED, ((ProtocolException) t.getCause()).getCode());
 } catch (Throwable t) {
  fail("Unexpected exception " + t.toString());
 }
}
origin: org.apache.shindig/shindig-common

@Test
public void testRestHandler_serviceDoesntExist() {
 RestHandler restHandler = registry.getRestHandler("/makebelieve", "GET");
 try {
  Future<?> future = restHandler.execute(Maps.<String, String[]>newHashMap(), null, null, null);
  future.get();
  fail("Expect exception for missing method");
 } catch (ExecutionException t) {
  assertSame(t.getCause().getClass(), ProtocolException.class);
  Assert.assertEquals(HttpServletResponse.SC_NOT_IMPLEMENTED, ((ProtocolException) t.getCause()).getCode());
 } catch (Throwable t) {
  fail("Unexpected exception " + t.toString());
 }
}
origin: apache/shindig

@Test
public void testRestHandler_serviceDoesntExist() {
 RestHandler restHandler = registry.getRestHandler("/makebelieve", "GET");
 try {
  Future<?> future = restHandler.execute(Maps.<String, String[]>newHashMap(), null, null, null);
  future.get();
  fail("Expect exception for missing method");
 } catch (ExecutionException t) {
  assertSame(t.getCause().getClass(), ProtocolException.class);
  Assert.assertEquals(HttpServletResponse.SC_NOT_IMPLEMENTED, ((ProtocolException) t.getCause()).getCode());
 } catch (Throwable t) {
  fail("Unexpected exception " + t.toString());
 }
}
origin: org.apache.shindig/shindig-common

@Test
public void testRpcHandler_serviceDoesntExist() throws Exception {
 JSONObject rpc = new JSONObject("{method : makebelieve.get}");
 RpcHandler rpcHandler = registry.getRpcHandler(rpc);
 try {
  Future<?> future = rpcHandler.execute(null, null, null);
  future.get();
  fail("Expect exception for missing method");
 } catch (ExecutionException t) {
  assertSame(t.getCause().getClass(), ProtocolException.class);
  Assert.assertEquals(HttpServletResponse.SC_NOT_IMPLEMENTED, ((ProtocolException) t.getCause()).getCode());
 } catch (Throwable t) {
  fail("Unexpected exception " + t.toString());
 }
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testRpcHandler_serviceDoesntExist() throws Exception {
 JSONObject rpc = new JSONObject("{method : makebelieve.get}");
 RpcHandler rpcHandler = registry.getRpcHandler(rpc);
 try {
  Future<?> future = rpcHandler.execute(null, null, null);
  future.get();
  fail("Expect exception for missing method");
 } catch (ExecutionException t) {
  assertSame(t.getCause().getClass(), ProtocolException.class);
  Assert.assertEquals(HttpServletResponse.SC_NOT_IMPLEMENTED, ((ProtocolException) t.getCause()).getCode());
 } catch (Throwable t) {
  fail("Unexpected exception " + t.toString());
 }
}
origin: com.lmco.shindig/shindig-common

@Test
public void testRpcHandler_serviceDoesntExist() throws Exception {
 JSONObject rpc = new JSONObject("{method : makebelieve.get}");
 RpcHandler rpcHandler = registry.getRpcHandler(rpc);
 try {
  Future<?> future = rpcHandler.execute(null, null, null);
  future.get();
  fail("Expect exception for missing method");
 } catch (ExecutionException t) {
  assertSame(t.getCause().getClass(), ProtocolException.class);
  Assert.assertEquals(HttpServletResponse.SC_NOT_IMPLEMENTED, ((ProtocolException) t.getCause()).getCode());
 } catch (Throwable t) {
  fail("Unexpected exception " + t.toString());
 }
}
origin: org.gatein.shindig/shindig-common

@Test
public void testRpcHandler_serviceDoesntExist() throws Exception {
 JSONObject rpc = new JSONObject("{method : makebelieve.get}");
 RpcHandler rpcHandler = registry.getRpcHandler(rpc);
 try {
  Future<?> future = rpcHandler.execute(null, null, null);
  future.get();
  fail("Expect exception for missing method");
 } catch (ExecutionException t) {
  assertSame(t.getCause().getClass(), ProtocolException.class);
  Assert.assertEquals(HttpServletResponse.SC_NOT_IMPLEMENTED, ((ProtocolException) t.getCause()).getCode());
 } catch (Throwable t) {
  fail("Unexpected exception " + t.toString());
 }
}
origin: apache/shindig

@Test
public void testRpcHandler_serviceDoesntExist() throws Exception {
 JSONObject rpc = new JSONObject("{method : makebelieve.get}");
 RpcHandler rpcHandler = registry.getRpcHandler(rpc);
 try {
  Future<?> future = rpcHandler.execute(null, null, null);
  future.get();
  fail("Expect exception for missing method");
 } catch (ExecutionException t) {
  assertSame(t.getCause().getClass(), ProtocolException.class);
  Assert.assertEquals(HttpServletResponse.SC_NOT_IMPLEMENTED, ((ProtocolException) t.getCause()).getCode());
 } catch (Throwable t) {
  fail("Unexpected exception " + t.toString());
 }
}
org.apache.shindig.protocolDefaultHandlerRegistryTestassertSame

Popular methods of DefaultHandlerRegistryTest

  • assertArrayEquals
  • assertEquals
  • assertNotNull
  • assertNull
  • fail

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • findViewById (Activity)
  • onRequestPermissionsResult (Fragment)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Top 17 PhpStorm Plugins
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