Author: cbegin Date: Sat Aug 15 04:46:18 2009 New Revision: 804434 URL: http://svn.apache.org/viewvc?rev=804434&view=rev Log: Added unit test for JIRA-625 (missed it in the last commit by accident).
Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/business/ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/business/Person.java (with props) ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/PersonMapper.java (with props) ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/PersonMapper.xml (with props) ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/ibatisConfig.xml (with props) ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/test/ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/test/MapperNameTest.java (with props) Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/business/Person.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/business/Person.java?rev=804434&view=auto ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/business/Person.java (added) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/business/Person.java Sat Aug 15 04:46:18 2009 @@ -0,0 +1,25 @@ +package org.apache.ibatis.submitted.map_class_name_conflict.business; + +public class Person { + private Long id; + private String firstName; + private String lastName; + public String getFirstName() { + return firstName; + } + public void setFirstName(String firstName) { + this.firstName = firstName; + } + public String getLastName() { + return lastName; + } + public void setLastName(String lastName) { + this.lastName = lastName; + } + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } +} Propchange: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/business/Person.java ------------------------------------------------------------------------------ svn:executable = * Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/PersonMapper.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/PersonMapper.java?rev=804434&view=auto ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/PersonMapper.java (added) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/PersonMapper.java Sat Aug 15 04:46:18 2009 @@ -0,0 +1,10 @@ +package org.apache.ibatis.submitted.map_class_name_conflict.mapper; + +import org.apache.ibatis.submitted.map_class_name_conflict.business.Person; + +public interface PersonMapper { + + public Person get(Long id); + + public void insert(Person person); +} Propchange: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/PersonMapper.java ------------------------------------------------------------------------------ svn:executable = * Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/PersonMapper.xml URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/PersonMapper.xml?rev=804434&view=auto ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/PersonMapper.xml (added) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/PersonMapper.xml Sat Aug 15 04:46:18 2009 @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE mapper + PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN" + "http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd"> + +<mapper namespace="org.apache.ibatis.submitted.map_class_name_conflict.mapper.PersonMapper"> + + <select id="get" resultType="Person" parameterType="long"> + SELECT id, firstName, lastName + FROM Person + WHERE id = #{id} + </select> + + <insert id="insert" parameterType="Person" useGeneratedKeys="true" keyProperty="id"> + INSERT INTO Person(firstName, lastName) + VALUES(#{firstName}, #{lastName}) + </insert> +</mapper> Propchange: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/PersonMapper.xml ------------------------------------------------------------------------------ svn:executable = * Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/ibatisConfig.xml URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/ibatisConfig.xml?rev=804434&view=auto ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/ibatisConfig.xml (added) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/ibatisConfig.xml Sat Aug 15 04:46:18 2009 @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE configuration + PUBLIC "-//ibatis.apache.org//DTD Config 3.0//EN" + "http://ibatis.apache.org/dtd/ibatis-3-config.dtd"> + +<configuration> + <typeAliases> + <typeAlias alias="Person" type="org.apache.ibatis.submitted.map_class_name_conflict.business.Person"/> + </typeAliases> + + <environments default="test"> + <environment id="test"> + <transactionManager type="JDBC"></transactionManager> + <dataSource type="UNPOOLED"> + <property name="driver" value="org.hsqldb.jdbcDriver"/> + <property name="url" value="jdbc:hsqldb:file:test.db"/> + <property name="username" value="sa"/> + <property name="password" value=""/> + </dataSource> + </environment> + </environments> + + <mappers> + <mapper resource="org/apache/ibatis/submitted/map_class_name_conflict/mapper/PersonMapper.xml"/> + </mappers> +</configuration> Propchange: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/mapper/ibatisConfig.xml ------------------------------------------------------------------------------ svn:executable = * Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/test/MapperNameTest.java URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/test/MapperNameTest.java?rev=804434&view=auto ============================================================================== --- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/test/MapperNameTest.java (added) +++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/test/MapperNameTest.java Sat Aug 15 04:46:18 2009 @@ -0,0 +1,18 @@ +package org.apache.ibatis.submitted.map_class_name_conflict.test; + +import java.io.IOException; +import java.io.Reader; + +import org.apache.ibatis.io.Resources; +import org.apache.ibatis.session.SqlSessionFactoryBuilder; +import org.junit.Test; + +public class MapperNameTest { + + @Test + public void initDatabase() throws IOException { + String resource = "org/apache/ibatis/submitted/map_class_name_conflict/mapper/ibatisConfig.xml"; + Reader reader = Resources.getResourceAsReader(resource); + new SqlSessionFactoryBuilder().build(reader); + } +} Propchange: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/submitted/map_class_name_conflict/test/MapperNameTest.java ------------------------------------------------------------------------------ svn:executable = *