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

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

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

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 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 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 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.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 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 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 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 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 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);
 }
}
org.apache.shindig.protocolDefaultHandlerRegistryTestfail

Popular methods of DefaultHandlerRegistryTest

  • assertArrayEquals
  • assertEquals
  • assertNotNull
  • assertNull
  • assertSame

Popular in Java

  • Updating database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Table (org.hibernate.mapping)
    A relational table
  • Top Sublime Text plugins
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