public void testSetExceptions_OneExceptionOutflow() throws Exception { Map<String, Object> exceptionConfiguration = new HashMap<String, Object>(); exceptionConfiguration.put("java.lang.NullPointerException", "/nullPointerException"); _node.setExceptions(exceptionConfiguration); _node.elaborate(); _node.configure(); assertEquals(1, _node.getOutflows().size()); assertEquals(0, _node.getDataOuflowNames().size()); assertEquals( "/nullPointerException", _node.getOutflows().get("java.lang.NullPointerException").getBinding()); assertEquals(1, _node._caughtExceptions.size()); }
public void testSetExceptions_ClassNotFound() throws Exception { Map<String, Object> exceptionConfiguration = new HashMap<String, Object>(); exceptionConfiguration.put("NotAnException", "/notAnException"); _node.setExceptions(exceptionConfiguration); Exception exception = null; try { _node.elaborate(); } catch (Exception e) { exception = e; } assertNotNull(exception); assertEquals( "Error registering actor exception handler for node TestNode. " + "No such class NotAnException", exception.getMessage()); exception.getMessage(); }