void doTest(String filename, Integer expectedInt, Class<?> exceptionClass) throws Exception { rulesMap.put(new ElementSelector("test"), new NOPAction()); rulesMap.put(new ElementSelector("test/badBegin"), new BadBeginAction()); rulesMap.put(new ElementSelector("test/badBegin/touch"), new TouchAction()); rulesMap.put(new ElementSelector("test/badEnd"), new BadEndAction()); rulesMap.put(new ElementSelector("test/badEnd/touch"), new TouchAction()); rulesMap.put(new ElementSelector("test/hello"), new HelloAction()); rulesMap.put(new ElementSelector("test/isolate"), new NOPAction()); rulesMap.put(new ElementSelector("test/isolate/badEnd"), new BadEndAction()); rulesMap.put(new ElementSelector("test/isolate/badEnd/touch"), new TouchAction()); rulesMap.put(new ElementSelector("test/isolate/touch"), new TouchAction()); rulesMap.put(new ElementSelector("test/hello"), new HelloAction()); TrivialConfigurator tc = new TrivialConfigurator(rulesMap); tc.setContext(context); tc.doConfigure(CoreTestConstants.TEST_SRC_PREFIX + "input/joran/skip/" + filename); String str = context.getProperty(HelloAction.PROPERTY_KEY); assertEquals("Hello John Doe.", str); Integer i = (Integer) context.getObject(TouchAction.KEY); if (expectedInt == null) { assertNull(i); } else { assertEquals(expectedInt, i); } // check the existence of an ERROR status List<Status> statusList = sm.getCopyOfStatusList(); Status s0 = statusList.get(0); assertEquals(Status.ERROR, s0.getLevel()); assertTrue(s0.getThrowable().getClass() == exceptionClass); }