Skip to content

Commit

Permalink
Merge pull request mybatis#1300 from kazuki43zoo/drop-usesjava8
Browse files Browse the repository at this point in the history
Move parent from usesjava8 on test
  • Loading branch information
kazuki43zoo committed Sep 8, 2018
2 parents debee0b + a3bc43c commit 3469c66
Show file tree
Hide file tree
Showing 55 changed files with 111 additions and 160 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--
-- Copyright 2009-2016 the original author or authors.
-- Copyright 2009-2018 the original author or authors.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.submitted.usesjava8.default_method;
package org.apache.ibatis.submitted.default_method;

import static org.junit.Assert.*;

Expand All @@ -24,7 +24,7 @@
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.apache.ibatis.submitted.usesjava8.default_method.Mapper.SubMapper;
import org.apache.ibatis.submitted.default_method.Mapper.SubMapper;
import org.junit.BeforeClass;
import org.junit.Test;

Expand All @@ -36,13 +36,13 @@ public class DefaultMethodTest {
public static void setUp() throws Exception {
// create an SqlSessionFactory
try (Reader reader = Resources.getResourceAsReader(
"org/apache/ibatis/submitted/usesjava8/default_method/mybatis-config.xml")) {
"org/apache/ibatis/submitted/default_method/mybatis-config.xml")) {
sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
}

// populate in-memory database
BaseDataTest.runScript(sqlSessionFactory.getConfiguration().getEnvironment().getDataSource(),
"org/apache/ibatis/submitted/usesjava8/default_method/CreateDB.sql");
"org/apache/ibatis/submitted/default_method/CreateDB.sql");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2017 the original author or authors.
* Copyright 2009-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.submitted.usesjava8.default_method;
package org.apache.ibatis.submitted.default_method;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2017 the original author or authors.
* Copyright 2009-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.submitted.usesjava8.default_method;
package org.apache.ibatis.submitted.default_method;

import org.apache.ibatis.annotations.Select;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2016 the original author or authors.
* Copyright 2009-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.submitted.usesjava8.default_method;
package org.apache.ibatis.submitted.default_method;

public class User {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright 2009-2017 the original author or authors.
Copyright 2009-2018 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,9 +36,9 @@
</environments>

<mappers>
<mapper class="org.apache.ibatis.submitted.usesjava8.default_method.Mapper" />
<mapper class="org.apache.ibatis.submitted.usesjava8.default_method.Mapper$SubMapper" />
<mapper class="org.apache.ibatis.submitted.usesjava8.default_method.PackageMapper" />
<mapper class="org.apache.ibatis.submitted.default_method.Mapper" />
<mapper class="org.apache.ibatis.submitted.default_method.Mapper$SubMapper" />
<mapper class="org.apache.ibatis.submitted.default_method.PackageMapper" />
</mappers>

</configuration>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--
-- Copyright 2009-2017 the original author or authors.
-- Copyright 2009-2018 the original author or authors.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2017 the original author or authors.
* Copyright 2009-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.submitted.usesjava8.keycolumn;
package org.apache.ibatis.submitted.keycolumn;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright 2009-2017 the original author or authors.
Copyright 2009-2018 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -19,8 +19,8 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.ibatis.submitted.usesjava8.keycolumn.InsertMapper" >
<insert id="insertNameMapped" parameterType="org.apache.ibatis.submitted.usesjava8.keycolumn.Name" useGeneratedKeys="true" keyProperty="id" keyColumn="name_id">
<mapper namespace="org.apache.ibatis.submitted.keycolumn.InsertMapper" >
<insert id="insertNameMapped" parameterType="org.apache.ibatis.submitted.keycolumn.Name" useGeneratedKeys="true" keyProperty="id" keyColumn="name_id">
insert into mbtest.test_identity
(first_name, last_name)
values(#{firstName,jdbcType=VARCHAR}, #{lastName,jdbcType=VARCHAR})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.submitted.usesjava8.keycolumn;
package org.apache.ibatis.submitted.keycolumn;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
Expand Down Expand Up @@ -64,7 +64,7 @@ public static void setUp() throws Exception {
sqlSessionFactory = new SqlSessionFactoryBuilder().build(configuration);

BaseDataTest.runScript(sqlSessionFactory.getConfiguration().getEnvironment().getDataSource(),
"org/apache/ibatis/submitted/usesjava8/keycolumn/CreateDB.sql");
"org/apache/ibatis/submitted/keycolumn/CreateDB.sql");
}

@AfterClass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2017 the original author or authors.
* Copyright 2009-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.submitted.usesjava8.keycolumn;
package org.apache.ibatis.submitted.keycolumn;

public class Name {
private Integer id;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--
-- Copyright 2009-2017 the original author or authors.
-- Copyright 2009-2018 the original author or authors.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2017 the original author or authors.
* Copyright 2009-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.submitted.usesjava8.multiple_resultsets;
package org.apache.ibatis.submitted.multiple_resultsets;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2009-2017 the original author or authors.
Copyright 2009-2018 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="org.apache.ibatis.submitted.usesjava8.multiple_resultsets.Mapper">
<mapper namespace="org.apache.ibatis.submitted.multiple_resultsets.Mapper">

<select id="getUsersAndGroups" resultMap="usersResult,groupsResult">
select * from mbtest.order_detail order by order_id, line_number ; select * from mbtest.order_header order by order_id
Expand All @@ -33,8 +33,8 @@
select * from mbtest.order_header order by order_id
</select>

<resultMap type="org.apache.ibatis.submitted.usesjava8.multiple_resultsets.OrderDetail" id="usersResult" />
<resultMap type="org.apache.ibatis.submitted.multiple_resultsets.OrderDetail" id="usersResult" />

<resultMap type="org.apache.ibatis.submitted.usesjava8.multiple_resultsets.OrderHeader" id="groupsResult" />
<resultMap type="org.apache.ibatis.submitted.multiple_resultsets.OrderHeader" id="groupsResult" />

</mapper>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.submitted.usesjava8.multiple_resultsets;
package org.apache.ibatis.submitted.multiple_resultsets;

import java.io.IOException;
import java.nio.file.Paths;
Expand Down Expand Up @@ -63,7 +63,7 @@ public static void setUp() throws Exception {
sqlSessionFactory = new SqlSessionFactoryBuilder().build(configuration);

BaseDataTest.runScript(sqlSessionFactory.getConfiguration().getEnvironment().getDataSource(),
"org/apache/ibatis/submitted/usesjava8/multiple_resultsets/CreateDB.sql");
"org/apache/ibatis/submitted/multiple_resultsets/CreateDB.sql");
}

@AfterClass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2017 the original author or authors.
* Copyright 2009-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.submitted.usesjava8.multiple_resultsets;
package org.apache.ibatis.submitted.multiple_resultsets;

public class OrderDetail {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2017 the original author or authors.
* Copyright 2009-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.submitted.usesjava8.multiple_resultsets;
package org.apache.ibatis.submitted.multiple_resultsets;

public class OrderHeader {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.submitted.named_constructor_args.usesjava8;
package org.apache.ibatis.submitted.named_constructor_args;

import static org.junit.Assert.*;

Expand All @@ -24,7 +24,6 @@
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.apache.ibatis.submitted.named_constructor_args.User;
import org.junit.BeforeClass;
import org.junit.Test;

Expand All @@ -39,7 +38,7 @@ public static void setUp() throws Exception {
sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
}

sqlSessionFactory.getConfiguration().addMapper(Mapper.class);
sqlSessionFactory.getConfiguration().addMapper(UseActualNameMapper.class);

// populate in-memory database
BaseDataTest.runScript(sqlSessionFactory.getConfiguration().getEnvironment().getDataSource(),
Expand All @@ -49,7 +48,7 @@ public static void setUp() throws Exception {
@Test
public void argsByActualNames() {
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
Mapper mapper = sqlSession.getMapper(Mapper.class);
UseActualNameMapper mapper = sqlSession.getMapper(UseActualNameMapper.class);
User user = mapper.mapConstructorWithoutParamAnnos(1);
assertEquals(Integer.valueOf(1), user.getId());
assertEquals("User1", user.getName());
Expand All @@ -59,7 +58,7 @@ public void argsByActualNames() {
@Test
public void argsByActualNamesXml() {
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
Mapper mapper = sqlSession.getMapper(Mapper.class);
UseActualNameMapper mapper = sqlSession.getMapper(UseActualNameMapper.class);
User user = mapper.mapConstructorWithoutParamAnnosXml(1);
assertEquals(Integer.valueOf(1), user.getId());
assertEquals("User1", user.getName());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2017 the original author or authors.
* Copyright 2009-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,14 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.submitted.named_constructor_args.usesjava8;
package org.apache.ibatis.submitted.named_constructor_args;

import org.apache.ibatis.annotations.Arg;
import org.apache.ibatis.annotations.ConstructorArgs;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.submitted.named_constructor_args.User;

public interface Mapper {
public interface UseActualNameMapper {

@ConstructorArgs({
@Arg(column = "name", name = "name"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2009-2017 the original author or authors.
Copyright 2009-2018 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="org.apache.ibatis.submitted.named_constructor_args.usesjava8.Mapper">
<mapper namespace="org.apache.ibatis.submitted.named_constructor_args.UseActualNameMapper">

<resultMap type="org.apache.ibatis.submitted.named_constructor_args.User"
id="twoArgsConstructorRM">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--
-- Copyright 2009-2016 the original author or authors.
-- Copyright 2009-2018 the original author or authors.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 3469c66

Please sign in to comment.