}
public void testInterceptorWriterError() throws Exception {
ApplicationContext context = new ClassPathXmlApplicationContext(getConfigLocation());
IndexDao test = (IndexDao)context.getBean(BEAN_ID);
MockIndexFactory mockIndexFactory = (MockIndexFactory)context.getBean(INDEX_FACTORY_ID);
try {
test.myMethod2();
fail();
} catch(LuceneIndexingException ex) { }
assertEquals(mockIndexFactory.getCallNumberWriter(), 1);
assertEquals(mockIndexFactory.getCallNumberReader(), 0);
}