setupFactoryBean();
factoryBean.setConfigLocation(new org.springframework.core.io.ClassPathResource(
"org/mybatis/spring/mybatis-config.xml"));
SqlSessionFactory factory = factoryBean.getObject();
assertEquals(factory.getConfiguration().getEnvironment().getId(), SqlSessionFactoryBean.class.getSimpleName());
assertSame(factory.getConfiguration().getEnvironment().getDataSource(), dataSource);
assertSame(factory.getConfiguration().getEnvironment().getTransactionFactory().getClass(),
org.mybatis.spring.transaction.SpringManagedTransactionFactory.class);
// properties explicitly set differently than the defaults in the config xml
assertFalse(factory.getConfiguration().isCacheEnabled());
assertTrue(factory.getConfiguration().isUseGeneratedKeys());
assertSame(factory.getConfiguration().getDefaultExecutorType(), org.apache.ibatis.session.ExecutorType.REUSE);
// for each statement in the xml file: org.mybatis.spring.TestMapper.xxx & xxx
assertEquals(8, factory.getConfiguration().getMappedStatementNames().size());
assertEquals(0, factory.getConfiguration().getResultMapNames().size());
assertEquals(0, factory.getConfiguration().getParameterMapNames().size());
}