DataSource ds = BaseDataTest.createJPetstoreDataSource();
Environment env = new Environment("test",new JdbcTransactionFactory(),ds);
Configuration config = new Configuration(env);
config.addMapper(JPetStoreMapper.class);
SqlSessionFactoryBuilder builder = new SqlSessionFactoryBuilder();
SqlSessionFactory sqlMapper = builder.build(config);
SqlSession session = sqlMapper.openSession();
try {
JPetStoreMapper mapper = session.getMapper(JPetStoreMapper.class);
int n = mapper.insertCategory("MONKEYS",null,"Big hairy friendly (sometimes) mammals...");
assertEquals(1,n);