public void testLocalSessionFactoryBeanWithFilterDefinitions() throws Exception {
XmlBeanFactory xbf = new XmlBeanFactory(new ClassPathResource("filterDefinitions.xml", getClass()));
FilterTestLocalSessionFactoryBean sf = (FilterTestLocalSessionFactoryBean) xbf.getBean("&sessionFactory");
assertEquals(2, sf.registeredFilterDefinitions.size());
FilterDefinition filter1 = (FilterDefinition) sf.registeredFilterDefinitions.get(0);
FilterDefinition filter2 = (FilterDefinition) sf.registeredFilterDefinitions.get(1);
assertEquals("filter1", filter1.getFilterName());
assertEquals(2, filter1.getParameterNames().size());
assertEquals(Hibernate.STRING, filter1.getParameterType("param1"));
assertEquals(Hibernate.LONG, filter1.getParameterType("otherParam"));
assertEquals("someCondition", filter1.getDefaultFilterCondition());
assertEquals("filter2", filter2.getFilterName());
assertEquals(1, filter2.getParameterNames().size());
assertEquals(Hibernate.INTEGER, filter2.getParameterType("myParam"));
}