Package org.apache.ibatis.submitted.integer_enum

Source Code of org.apache.ibatis.submitted.integer_enum.IntegerEnumTest

package org.apache.ibatis.submitted.integer_enum;

import org.apache.ibatis.BaseDataTest;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;

import javax.sql.DataSource;
import java.io.Reader;
import java.sql.Connection;

public class IntegerEnumTest extends BaseDataTest {

  @Test
  public void shouldParseMapWithIntegerJdbcType() throws Exception {
    DataSource ds = BaseDataTest.createJPetstoreDataSource();
    Connection conn = ds.getConnection();
    String resource = "org/apache/ibatis/submitted/integer_enum/MapperConfig.xml";
    Reader reader = Resources.getResourceAsReader(resource);
    SqlSessionFactoryBuilder builder = new SqlSessionFactoryBuilder();
    SqlSessionFactory sqlMapper = builder.build(reader);
    SqlSession session = sqlMapper.openSession(conn);
    try {
      assertNotNull(session);
    } finally {
      if (session != null) session.close();
      if (conn != null) conn.close();
    }
  }

}
TOP

Related Classes of org.apache.ibatis.submitted.integer_enum.IntegerEnumTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.