Skip to content

Commit

Permalink
Remove unnecessary public access modifier in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuki43zoo committed Mar 14, 2020
1 parent 72208ff commit 42818bf
Show file tree
Hide file tree
Showing 19 changed files with 46 additions and 47 deletions.
6 changes: 3 additions & 3 deletions src/test/java/org/apache/ibatis/binding/FlushTest.java
Expand Up @@ -35,11 +35,11 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

public class FlushTest {
class FlushTest {
private static SqlSessionFactory sqlSessionFactory;

@BeforeAll
public static void setup() throws Exception {
static void setup() throws Exception {
DataSource dataSource = BaseDataTest.createBlogDataSource();
TransactionFactory transactionFactory = new JdbcTransactionFactory();
Environment environment = new Environment("Production", transactionFactory, dataSource);
Expand All @@ -52,7 +52,7 @@ public static void setup() throws Exception {
}

@Test
public void invokeFlushStatementsViaMapper() {
void invokeFlushStatementsViaMapper() {
try (SqlSession session = sqlSessionFactory.openSession()) {

BoundAuthorMapper mapper = session.getMapper(BoundAuthorMapper.class);
Expand Down
Expand Up @@ -205,7 +205,7 @@ void shouldFailedLoadXMLMapperFile() throws Exception {
// }

@Test
public void erorrResultMapLocation() throws Exception {
void erorrResultMapLocation() throws Exception {
Configuration configuration = new Configuration();
String resource = "org/apache/ibatis/builder/ProblemResultMapper.xml";
try (InputStream inputStream = Resources.getResourceAsStream(resource)) {
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2019 the original author or authors.
* Copyright 2009-2020 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,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.ibatis.datasource.unpooled;

import static org.junit.jupiter.api.Assertions.*;
Expand All @@ -26,7 +25,7 @@
import org.junit.jupiter.api.Test;

@Tag("TestcontainersTests")
public class NetworkTimeoutTest {
class NetworkTimeoutTest {

@Test
void testNetworkTimeout_UnpooledDataSource() throws Exception {
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2019 the original author or authors.
* Copyright 2009-2020 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 @@ -373,7 +373,7 @@ void shouldFetchOneOrphanedPostWithNoBlog() throws Exception {
}

@Test
public void shouldFetchPostWithBlogWithCompositeKey() throws Exception {
void shouldFetchPostWithBlogWithCompositeKey() throws Exception {

Executor executor = createExecutor(new JdbcTransaction(ds, null, false));
try {
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2019 the original author or authors.
* Copyright 2009-2020 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 @@ -33,7 +33,7 @@
import org.mockito.junit.jupiter.MockitoExtension;

@ExtendWith(MockitoExtension.class)
public class StatementLoggerTest {
class StatementLoggerTest {

@Mock
Statement statement;
Expand Down
Expand Up @@ -195,7 +195,7 @@ private void testEvalMethod(XPathParser parser) {
}

@Test
public void formatXNodeToString() {
void formatXNodeToString() {
XPathParser parser = new XPathParser("<users><user><id>100</id><name>Tom</name><age>30</age><cars><car>BMW</car><car>Audi</car><car>Benz</car></cars></user></users>");
String usersNodeToString = parser.evalNode("/users").toString();
String userNodeToString = parser.evalNode("/users/user").toString();
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/apache/ibatis/reflection/ReflectorTest.java
Expand Up @@ -224,7 +224,7 @@ public void setProp2(boolean arg) {}
}

@Test
public void shouldTwoGettersForNonBooleanPropertyThrowException() throws Exception {
void shouldTwoGettersForNonBooleanPropertyThrowException() throws Exception {
@SuppressWarnings("unused")
class BeanClass {
public Integer getProp1() {return 1;}
Expand Down Expand Up @@ -256,7 +256,7 @@ class BeanClass {
}

@Test
public void shouldTwoGettersWithDifferentTypesThrowException() throws Exception {
void shouldTwoGettersWithDifferentTypesThrowException() throws Exception {
@SuppressWarnings("unused")
class BeanClass {
public Integer getProp1() {return 1;}
Expand Down
Expand Up @@ -29,7 +29,7 @@

import org.junit.jupiter.api.Test;

public class OgnlCacheTest {
class OgnlCacheTest {
@Test
void concurrentAccess() throws Exception {
class DataClass {
Expand Down
Expand Up @@ -100,13 +100,13 @@ void shouldImplicitlyRollbackInsertedAuthor() {
}

@Test
public void shouldFindAllPostLites() throws Exception {
void shouldFindAllPostLites() throws Exception {
List<PostLite> posts = manager.selectList("org.apache.ibatis.domain.blog.mappers.PostMapper.selectPostLite");
assertEquals(2, posts.size()); // old gcode issue #392, new #1848
}

@Test
public void shouldFindAllMutablePostLites() throws Exception {
void shouldFindAllMutablePostLites() throws Exception {
List<PostLite> posts = manager.selectList("org.apache.ibatis.domain.blog.mappers.PostMapper.selectMutablePostLite");
assertEquals(2, posts.size()); // old gcode issue #392, new #1848
}
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2019 the original author or authors.
* Copyright 2009-2020 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 @@ -28,12 +28,12 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class ArrayTypeHandlerTest {
class ArrayTypeHandlerTest {

private SqlSessionFactory sqlSessionFactory;

@BeforeEach
public void setUp() throws Exception {
void setUp() throws Exception {
try (Reader reader = Resources
.getResourceAsReader("org/apache/ibatis/submitted/array_type_handler/mybatis-config.xml")) {
sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
Expand All @@ -44,7 +44,7 @@ public void setUp() throws Exception {
}

@Test
public void shouldInsertArrayValue() throws Exception {
void shouldInsertArrayValue() throws Exception {
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
User user = new User();
user.setId(1);
Expand All @@ -64,7 +64,7 @@ public void shouldInsertArrayValue() throws Exception {
}

@Test
public void shouldInsertNullValue() throws Exception {
void shouldInsertNullValue() throws Exception {
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
User user = new User();
user.setId(1);
Expand Down
Expand Up @@ -31,10 +31,10 @@
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

public class AnnotationMapperTest {
class AnnotationMapperTest {

@Test
public void applyDefaultValueOnAnnotationMapper() throws IOException {
void applyDefaultValueOnAnnotationMapper() throws IOException {

Properties props = new Properties();
props.setProperty(PropertyParser.KEY_ENABLE_DEFAULT_VALUE, "true");
Expand All @@ -56,7 +56,7 @@ public void applyDefaultValueOnAnnotationMapper() throws IOException {
}

@Test
public void applyPropertyValueOnAnnotationMapper() throws IOException {
void applyPropertyValueOnAnnotationMapper() throws IOException {

Properties props = new Properties();
props.setProperty(PropertyParser.KEY_ENABLE_DEFAULT_VALUE, "true");
Expand Down
Expand Up @@ -28,7 +28,7 @@
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

public class XmlMapperTest {
class XmlMapperTest {

@Test
void applyDefaultValueOnXmlMapper() throws IOException {
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2018 the original author or authors.
* Copyright 2009-2020 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 @@ -15,7 +15,7 @@
*/
package org.apache.ibatis.submitted.lazyload_proxyfactory_comparison;

public class CglibLazyTest extends AbstractLazyTest {
class CglibLazyTest extends AbstractLazyTest {
@Override
protected String getConfiguration() {
return "cglib";
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2018 the original author or authors.
* Copyright 2009-2020 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 @@ -15,7 +15,7 @@
*/
package org.apache.ibatis.submitted.lazyload_proxyfactory_comparison;

public class DefaultLazyTest extends AbstractLazyTest {
class DefaultLazyTest extends AbstractLazyTest {
@Override
protected String getConfiguration() {
return "default";
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2019 the original author or authors.
* Copyright 2009-2020 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 @@ -18,7 +18,7 @@
import org.junit.jupiter.api.Disabled;

@Disabled("See Issue 664: Javassist ProxyFactory does not handle interfaces with generics correctly.")
public class JavassistLazyTest
class JavassistLazyTest
extends AbstractLazyTest {
@Override
protected String getConfiguration() {
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2019 the original author or authors.
* Copyright 2009-2020 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 @@ -28,7 +28,7 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

public class LocalTimeTest {
class LocalTimeTest {

private static SqlSessionFactory sqlSessionFactory;

Expand Down
Expand Up @@ -27,13 +27,13 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

public class MultiDbTest {
class MultiDbTest {

protected static SqlSessionFactory sqlSessionFactory;
protected static SqlSessionFactory sqlSessionFactory2;

@BeforeAll
public static void setUp() throws Exception {
static void setUp() throws Exception {
try (Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/multidb/MultiDbConfig.xml")) {
sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
}
Expand All @@ -43,7 +43,7 @@ public static void setUp() throws Exception {
}

@Test
public void shouldExecuteHsqlQuery() {
void shouldExecuteHsqlQuery() {
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
MultiDbMapper mapper = sqlSession.getMapper(MultiDbMapper.class);
String answer = mapper.select1(1);
Expand All @@ -52,7 +52,7 @@ public void shouldExecuteHsqlQuery() {
}

@Test
public void shouldExecuteCommonQuery() {
void shouldExecuteCommonQuery() {
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
MultiDbMapper mapper = sqlSession.getMapper(MultiDbMapper.class);
String answer = mapper.select2(1);
Expand All @@ -61,7 +61,7 @@ public void shouldExecuteCommonQuery() {
}

@Test
public void shouldExecuteHsqlQueryWithDynamicIf() {
void shouldExecuteHsqlQueryWithDynamicIf() {
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
MultiDbMapper mapper = sqlSession.getMapper(MultiDbMapper.class);
String answer = mapper.select3(1);
Expand All @@ -70,7 +70,7 @@ public void shouldExecuteHsqlQueryWithDynamicIf() {
}

@Test
public void shouldExecuteHsqlQueryWithInclude() {
void shouldExecuteHsqlQueryWithInclude() {
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
MultiDbMapper mapper = sqlSession.getMapper(MultiDbMapper.class);
String answer = mapper.select4(1);
Expand All @@ -79,7 +79,7 @@ public void shouldExecuteHsqlQueryWithInclude() {
}

@Test
public void shouldInsertInCommonWithSelectKey() {
void shouldInsertInCommonWithSelectKey() {
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
MultiDbMapper mapper = sqlSession.getMapper(MultiDbMapper.class);
mapper.insert(new User(2, "test"));
Expand All @@ -89,7 +89,7 @@ public void shouldInsertInCommonWithSelectKey() {
}

@Test
public void shouldInsertInCommonWithSelectKey2() {
void shouldInsertInCommonWithSelectKey2() {
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
MultiDbMapper mapper = sqlSession.getMapper(MultiDbMapper.class);
mapper.insert2(new User(2, "test"));
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2018 the original author or authors.
* Copyright 2009-2020 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 @@ -24,9 +24,9 @@
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public class RefidResolutionTest {
class RefidResolutionTest {
@Test
public void testIncludes() throws Exception {
void testIncludes() throws Exception {
String resource = "org/apache/ibatis/submitted/refid_resolution/MapperConfig.xml";
Reader reader = Resources.getResourceAsReader(resource);
SqlSessionFactoryBuilder builder = new SqlSessionFactoryBuilder();
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2019 the original author or authors.
* Copyright 2009-2020 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,7 +36,7 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class TimezoneEdgeCaseTest {
class TimezoneEdgeCaseTest {

private static SqlSessionFactory sqlSessionFactory;
private TimeZone timeZone;
Expand Down

0 comments on commit 42818bf

Please sign in to comment.