Skip to content

Commit 52ff55f

Browse files
committed
[ci] More formatting efforts
1 parent a788a61 commit 52ff55f

File tree

42 files changed

+309
-300
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+309
-300
lines changed
Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2019 the original author or authors.
2+
* Copyright 2009-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,59 +30,60 @@
3030

3131
class EnumWithOgnlTest {
3232

33-
private static SqlSessionFactory sqlSessionFactory;
33+
private static SqlSessionFactory sqlSessionFactory;
3434

35-
@BeforeAll
36-
static void initDatabase() throws Exception {
37-
try (Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/ognl_enum/ibatisConfig.xml")) {
38-
sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
39-
}
40-
41-
BaseDataTest.runScript(sqlSessionFactory.getConfiguration().getEnvironment().getDataSource(),
42-
"org/apache/ibatis/submitted/ognl_enum/CreateDB.sql");
35+
@BeforeAll
36+
static void initDatabase() throws Exception {
37+
try (Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/ognl_enum/ibatisConfig.xml")) {
38+
sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
4339
}
4440

45-
@Test
46-
void testEnumWithOgnl() {
47-
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
48-
PersonMapper personMapper = sqlSession.getMapper(PersonMapper.class);
49-
List<Person> persons = personMapper.selectAllByType(null);
50-
Assertions.assertEquals(3, persons.size(), "Persons must contain 3 persons");
51-
}
41+
BaseDataTest.runScript(sqlSessionFactory.getConfiguration().getEnvironment().getDataSource(),
42+
"org/apache/ibatis/submitted/ognl_enum/CreateDB.sql");
43+
}
44+
45+
@Test
46+
void testEnumWithOgnl() {
47+
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
48+
PersonMapper personMapper = sqlSession.getMapper(PersonMapper.class);
49+
List<Person> persons = personMapper.selectAllByType(null);
50+
Assertions.assertEquals(3, persons.size(), "Persons must contain 3 persons");
5251
}
52+
}
5353

54-
@Test
55-
void testEnumWithOgnlDirector() {
56-
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
57-
PersonMapper personMapper = sqlSession.getMapper(PersonMapper.class);
58-
List<Person> persons = personMapper.selectAllByType(Person.Type.DIRECTOR);
59-
Assertions.assertEquals(1, persons.size(), "Persons must contain 1 persons");
60-
}
54+
@Test
55+
void testEnumWithOgnlDirector() {
56+
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
57+
PersonMapper personMapper = sqlSession.getMapper(PersonMapper.class);
58+
List<Person> persons = personMapper.selectAllByType(Person.Type.DIRECTOR);
59+
Assertions.assertEquals(1, persons.size(), "Persons must contain 1 persons");
6160
}
61+
}
6262

63-
@Test
64-
void testEnumWithOgnlDirectorNameAttribute() {
65-
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
66-
PersonMapper personMapper = sqlSession.getMapper(PersonMapper.class);
67-
List<Person> persons = personMapper.selectAllByTypeNameAttribute(Person.Type.DIRECTOR);
68-
Assertions.assertEquals(1, persons.size(), "Persons must contain 1 persons");
69-
}
63+
@Test
64+
void testEnumWithOgnlDirectorNameAttribute() {
65+
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
66+
PersonMapper personMapper = sqlSession.getMapper(PersonMapper.class);
67+
List<Person> persons = personMapper.selectAllByTypeNameAttribute(Person.Type.DIRECTOR);
68+
Assertions.assertEquals(1, persons.size(), "Persons must contain 1 persons");
7069
}
70+
}
7171

72-
@Test
73-
void testEnumWithOgnlDirectorWithInterface() {
74-
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
75-
PersonMapper personMapper = sqlSession.getMapper(PersonMapper.class);
76-
List<Person> persons = personMapper.selectAllByTypeWithInterface(() -> Type.DIRECTOR);
77-
Assertions.assertEquals(1, persons.size(), "Persons must contain 1 persons");
78-
}
72+
@Test
73+
void testEnumWithOgnlDirectorWithInterface() {
74+
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
75+
PersonMapper personMapper = sqlSession.getMapper(PersonMapper.class);
76+
List<Person> persons = personMapper.selectAllByTypeWithInterface(() -> Type.DIRECTOR);
77+
Assertions.assertEquals(1, persons.size(), "Persons must contain 1 persons");
7978
}
80-
@Test
81-
void testEnumWithOgnlDirectorNameAttributeWithInterface() {
82-
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
83-
PersonMapper personMapper = sqlSession.getMapper(PersonMapper.class);
84-
List<Person> persons = personMapper.selectAllByTypeNameAttributeWithInterface(() -> Type.DIRECTOR);
85-
Assertions.assertEquals(1, persons.size(), "Persons must contain 1 persons");
86-
}
79+
}
80+
81+
@Test
82+
void testEnumWithOgnlDirectorNameAttributeWithInterface() {
83+
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
84+
PersonMapper personMapper = sqlSession.getMapper(PersonMapper.class);
85+
List<Person> persons = personMapper.selectAllByTypeNameAttributeWithInterface(() -> Type.DIRECTOR);
86+
Assertions.assertEquals(1, persons.size(), "Persons must contain 1 persons");
8787
}
88+
}
8889
}
Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2019 the original author or authors.
2+
* Copyright 2009-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,30 +16,36 @@
1616
package org.apache.ibatis.submitted.ognl_enum;
1717

1818
public class Person {
19-
public enum Type {
20-
EMPLOYEE,
21-
DIRECTOR
22-
}
23-
24-
private Long id;
25-
private String firstName;
26-
private String lastName;
27-
public String getFirstName() {
28-
return firstName;
29-
}
30-
public void setFirstName(String firstName) {
31-
this.firstName = firstName;
32-
}
33-
public String getLastName() {
34-
return lastName;
35-
}
36-
public void setLastName(String lastName) {
37-
this.lastName = lastName;
38-
}
39-
public Long getId() {
40-
return id;
41-
}
42-
public void setId(Long id) {
43-
this.id = id;
44-
}
19+
public enum Type {
20+
EMPLOYEE,
21+
DIRECTOR
22+
}
23+
24+
private Long id;
25+
private String firstName;
26+
private String lastName;
27+
28+
public String getFirstName() {
29+
return firstName;
30+
}
31+
32+
public void setFirstName(String firstName) {
33+
this.firstName = firstName;
34+
}
35+
36+
public String getLastName() {
37+
return lastName;
38+
}
39+
40+
public void setLastName(String lastName) {
41+
this.lastName = lastName;
42+
}
43+
44+
public Long getId() {
45+
return id;
46+
}
47+
48+
public void setId(Long id) {
49+
this.id = id;
50+
}
4551
}

src/test/java/org/apache/ibatis/submitted/ognl_enum/PersonMapper.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2019 the original author or authors.
2+
* Copyright 2009-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,12 +19,15 @@
1919

2020
public interface PersonMapper {
2121

22-
interface PersonType {
23-
Person.Type getType();
24-
}
22+
interface PersonType {
23+
Person.Type getType();
24+
}
2525

26-
List<Person> selectAllByType(Person.Type type);
27-
List<Person> selectAllByTypeNameAttribute(Person.Type type);
28-
List<Person> selectAllByTypeWithInterface(PersonType personType);
29-
List<Person> selectAllByTypeNameAttributeWithInterface(PersonType personType);
26+
List<Person> selectAllByType(Person.Type type);
27+
28+
List<Person> selectAllByTypeNameAttribute(Person.Type type);
29+
30+
List<Person> selectAllByTypeWithInterface(PersonType personType);
31+
32+
List<Person> selectAllByTypeNameAttributeWithInterface(PersonType personType);
3033
}

src/test/java/org/apache/ibatis/submitted/ognlstatic/OgnlStaticTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2019 the original author or authors.
2+
* Copyright 2009-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ static void setUp() throws Exception {
3939

4040
// populate in-memory database
4141
BaseDataTest.runScript(sqlSessionFactory.getConfiguration().getEnvironment().getDataSource(),
42-
"org/apache/ibatis/submitted/ognlstatic/CreateDB.sql");
42+
"org/apache/ibatis/submitted/ognlstatic/CreateDB.sql");
4343
}
4444

4545
/**

src/test/java/org/apache/ibatis/submitted/optional_on_mapper_method/OptionalOnMapperMethodTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ class OptionalOnMapperMethodTest {
4343
@BeforeAll
4444
static void setUp() throws Exception {
4545
// create an SqlSessionFactory
46-
try (Reader reader = Resources.getResourceAsReader(
47-
"org/apache/ibatis/submitted/optional_on_mapper_method/mybatis-config.xml")) {
46+
try (Reader reader = Resources
47+
.getResourceAsReader("org/apache/ibatis/submitted/optional_on_mapper_method/mybatis-config.xml")) {
4848
sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
4949
}
5050

src/test/java/org/apache/ibatis/submitted/order_prefix_removed/OrderPrefixRemovedTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2019 the original author or authors.
2+
* Copyright 2009-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,12 +34,13 @@ class OrderPrefixRemovedTest {
3434

3535
@BeforeAll
3636
static void initDatabase() throws Exception {
37-
try (Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/order_prefix_removed/ibatisConfig.xml")) {
37+
try (Reader reader = Resources
38+
.getResourceAsReader("org/apache/ibatis/submitted/order_prefix_removed/ibatisConfig.xml")) {
3839
sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
3940
}
4041

4142
BaseDataTest.runScript(sqlSessionFactory.getConfiguration().getEnvironment().getDataSource(),
42-
"org/apache/ibatis/submitted/order_prefix_removed/CreateDB.sql");
43+
"org/apache/ibatis/submitted/order_prefix_removed/CreateDB.sql");
4344
}
4445

4546
@Test

src/test/java/org/apache/ibatis/submitted/overwritingproperties/FooMapperTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ class FooMapperTest {
4040

4141
@BeforeAll
4242
static void setUpBeforeClass() throws Exception {
43-
final SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(Resources.getResourceAsReader(SQL_MAP_CONFIG));
43+
final SqlSessionFactory factory = new SqlSessionFactoryBuilder()
44+
.build(Resources.getResourceAsReader(SQL_MAP_CONFIG));
4445
session = factory.openSession();
4546
conn = session.getConnection();
4647

src/test/java/org/apache/ibatis/submitted/primitive_array/PrimitiveArrayTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ class PrimitiveArrayTest {
3333
@BeforeAll
3434
static void setUp() throws Exception {
3535
// create an SqlSessionFactory
36-
try (Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/primitive_array/mybatis-config.xml")) {
36+
try (Reader reader = Resources
37+
.getResourceAsReader("org/apache/ibatis/submitted/primitive_array/mybatis-config.xml")) {
3738
sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
3839
}
3940

src/test/java/org/apache/ibatis/submitted/propertiesinmapperfiles/PropertiesInMappersTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ static void setUp() throws Exception {
3939
p.put("property", "id");
4040

4141
// create a SqlSessionFactory
42-
try (Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/propertiesinmapperfiles/mybatis-config.xml")) {
42+
try (Reader reader = Resources
43+
.getResourceAsReader("org/apache/ibatis/submitted/propertiesinmapperfiles/mybatis-config.xml")) {
4344
sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader, p);
4445
}
4546

src/test/java/org/apache/ibatis/submitted/quotedcolumnnames/QuotedColumnNamesTest.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2019 the original author or authors.
2+
* Copyright 2009-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,18 +34,20 @@ class QuotedColumnNamesTest {
3434

3535
@BeforeAll
3636
static void setUp() throws Exception {
37-
try (Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/quotedcolumnnames/MapperConfig.xml")) {
37+
try (Reader reader = Resources
38+
.getResourceAsReader("org/apache/ibatis/submitted/quotedcolumnnames/MapperConfig.xml")) {
3839
sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
3940
}
4041

4142
BaseDataTest.runScript(sqlSessionFactory.getConfiguration().getEnvironment().getDataSource(),
42-
"org/apache/ibatis/submitted/quotedcolumnnames/CreateDB.sql");
43+
"org/apache/ibatis/submitted/quotedcolumnnames/CreateDB.sql");
4344
}
4445

4546
@Test
4647
void testIt() {
4748
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
48-
List<Map<String, Object>> list = sqlSession.selectList("org.apache.ibatis.submitted.quotedcolumnnames.Map.doSelect");
49+
List<Map<String, Object>> list = sqlSession
50+
.selectList("org.apache.ibatis.submitted.quotedcolumnnames.Map.doSelect");
4951
printList(list);
5052
assertColumnNames(list);
5153
}
@@ -54,7 +56,8 @@ void testIt() {
5456
@Test
5557
void testItWithResultMap() {
5658
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
57-
List<Map<String, Object>> list = sqlSession.selectList("org.apache.ibatis.submitted.quotedcolumnnames.Map.doSelectWithResultMap");
59+
List<Map<String, Object>> list = sqlSession
60+
.selectList("org.apache.ibatis.submitted.quotedcolumnnames.Map.doSelectWithResultMap");
5861
printList(list);
5962
assertColumnNames(list);
6063
}

0 commit comments

Comments
 (0)