From 8070c60245bd5c5b4ca860d05f0a543630591808 Mon Sep 17 00:00:00 2001 From: tanpenggood Date: Fri, 25 Aug 2023 01:38:58 +0800 Subject: [PATCH 1/2] typo: fix some typo --- .../apache/ibatis/builder/annotation/package-info.java | 2 +- src/main/java/org/apache/ibatis/jdbc/ScriptRunner.java | 2 +- .../java/org/apache/ibatis/binding/BindingTest.java | 4 ++-- .../org/apache/ibatis/binding/BoundBlogMapper.java | 4 ++-- .../apache/ibatis/executor/loader/CglibProxyTest.java | 2 +- .../ibatis/executor/loader/JavassistProxyTest.java | 2 +- .../ibatis/executor/loader/SerializableProxyTest.java | 2 +- .../org/apache/ibatis/io/ExternalResourcesTest.java | 2 +- .../java/org/apache/ibatis/jdbc/ScriptRunnerTest.java | 4 ++-- .../org/apache/ibatis/mapping/ResultMappingTest.java | 2 +- .../ibatis/submitted/automapping/AutomappingTest.java | 2 +- .../force_flush_on_select/ForceFlushOnSelectTest.java | 2 +- .../ibatis/submitted/keygen/Jdbc3KeyGeneratorTest.java | 10 +++++----- .../submitted/lazy_properties/LazyPropertiesTest.java | 6 +++--- .../{ResulthandlerTest.java => ResultHandlerTest.java} | 2 +- ...ndlerTest.java => SqlTimestampTypeHandlerTest.java} | 2 +- 16 files changed, 25 insertions(+), 25 deletions(-) rename src/test/java/org/apache/ibatis/submitted/result_handler/{ResulthandlerTest.java => ResultHandlerTest.java} (98%) rename src/test/java/org/apache/ibatis/type/{SqlTimetampTypeHandlerTest.java => SqlTimestampTypeHandlerTest.java} (97%) diff --git a/src/main/java/org/apache/ibatis/builder/annotation/package-info.java b/src/main/java/org/apache/ibatis/builder/annotation/package-info.java index 9915056d14a..d6ed2a2d7cd 100644 --- a/src/main/java/org/apache/ibatis/builder/annotation/package-info.java +++ b/src/main/java/org/apache/ibatis/builder/annotation/package-info.java @@ -14,6 +14,6 @@ * limitations under the License. */ /** - * Parses annotions to create a Configuration. + * Parses annotations to create a Configuration. */ package org.apache.ibatis.builder.annotation; diff --git a/src/main/java/org/apache/ibatis/jdbc/ScriptRunner.java b/src/main/java/org/apache/ibatis/jdbc/ScriptRunner.java index 092b30aaa31..0293b35c242 100644 --- a/src/main/java/org/apache/ibatis/jdbc/ScriptRunner.java +++ b/src/main/java/org/apache/ibatis/jdbc/ScriptRunner.java @@ -248,7 +248,7 @@ private void executeStatement(String command) throws SQLException { } try { boolean hasResults = statement.execute(sql); - // DO NOT try to 'imporove' the condition even if IDE tells you to! + // DO NOT try to 'improve' the condition even if IDE tells you to! // It's important that getUpdateCount() is called here. while (!(!hasResults && statement.getUpdateCount() == -1)) { checkWarnings(statement); diff --git a/src/test/java/org/apache/ibatis/binding/BindingTest.java b/src/test/java/org/apache/ibatis/binding/BindingTest.java index 348ad18bb7f..f3120442ceb 100644 --- a/src/test/java/org/apache/ibatis/binding/BindingTest.java +++ b/src/test/java/org/apache/ibatis/binding/BindingTest.java @@ -626,7 +626,7 @@ void shouldCacheMapperMethod() throws Exception { void shouldGetBlogsWithAuthorsAndPosts() { try (SqlSession session = sqlSessionFactory.openSession()) { BoundBlogMapper mapper = session.getMapper(BoundBlogMapper.class); - List blogs = mapper.selectBlogsWithAutorAndPosts(); + List blogs = mapper.selectBlogsWithAuthorAndPosts(); assertEquals(2, blogs.size()); assertTrue(blogs.get(0) instanceof Proxy); assertEquals(101, blogs.get(0).getAuthor().getId()); @@ -643,7 +643,7 @@ void shouldGetBlogsWithAuthorsAndPosts() { void shouldGetBlogsWithAuthorsAndPostsEagerly() { try (SqlSession session = sqlSessionFactory.openSession()) { BoundBlogMapper mapper = session.getMapper(BoundBlogMapper.class); - List blogs = mapper.selectBlogsWithAutorAndPostsEagerly(); + List blogs = mapper.selectBlogsWithAuthorAndPostsEagerly(); assertEquals(2, blogs.size()); assertFalse(blogs.get(0) instanceof Factory); assertEquals(101, blogs.get(0).getAuthor().getId()); diff --git a/src/test/java/org/apache/ibatis/binding/BoundBlogMapper.java b/src/test/java/org/apache/ibatis/binding/BoundBlogMapper.java index bc41486bbdf..8df5775b855 100644 --- a/src/test/java/org/apache/ibatis/binding/BoundBlogMapper.java +++ b/src/test/java/org/apache/ibatis/binding/BoundBlogMapper.java @@ -253,7 +253,7 @@ Blog selectBlogWithAParamNamedValue(@Param("column") String column, @Param("id") @Result(property = "posts", column = "id", many = @Many(select = "selectPostsById")) }) // @formatter:on - List selectBlogsWithAutorAndPosts(); + List selectBlogsWithAuthorAndPosts(); // @formatter:off @Select({ @@ -265,6 +265,6 @@ Blog selectBlogWithAParamNamedValue(@Param("column") String column, @Param("id") @Result(property = "posts", column = "id", many = @Many(select = "selectPostsById", fetchType = FetchType.EAGER)) }) // @formatter:on - List selectBlogsWithAutorAndPostsEagerly(); + List selectBlogsWithAuthorAndPostsEagerly(); } diff --git a/src/test/java/org/apache/ibatis/executor/loader/CglibProxyTest.java b/src/test/java/org/apache/ibatis/executor/loader/CglibProxyTest.java index efc9cb56802..651e96e0f2e 100644 --- a/src/test/java/org/apache/ibatis/executor/loader/CglibProxyTest.java +++ b/src/test/java/org/apache/ibatis/executor/loader/CglibProxyTest.java @@ -71,7 +71,7 @@ void shouldLetCallALoadedProperty() { } @Test - void shouldSerizalizeADeserlizaliedProxy() throws Exception { + void shouldSerializeADeserializedProxy() throws Exception { Object proxy = ((CglibProxyFactory) proxyFactory).createDeserializationProxy(author, new HashMap<>(), new DefaultObjectFactory(), new ArrayList<>(), new ArrayList<>()); Author author2 = (Author) deserialize(serialize((Serializable) proxy)); diff --git a/src/test/java/org/apache/ibatis/executor/loader/JavassistProxyTest.java b/src/test/java/org/apache/ibatis/executor/loader/JavassistProxyTest.java index a101d4796eb..d720c4ddb14 100644 --- a/src/test/java/org/apache/ibatis/executor/loader/JavassistProxyTest.java +++ b/src/test/java/org/apache/ibatis/executor/loader/JavassistProxyTest.java @@ -69,7 +69,7 @@ void shouldLetCallALoadedProperty() { } @Test - void shouldSerizalizeADeserlizaliedProxy() throws Exception { + void shouldSerializeADeserializedProxy() throws Exception { Object proxy = ((JavassistProxyFactory) proxyFactory).createDeserializationProxy(author, new HashMap<>(), new DefaultObjectFactory(), new ArrayList<>(), new ArrayList<>()); Author author2 = (Author) deserialize(serialize((Serializable) proxy)); diff --git a/src/test/java/org/apache/ibatis/executor/loader/SerializableProxyTest.java b/src/test/java/org/apache/ibatis/executor/loader/SerializableProxyTest.java index 24bc5101efe..a6b5758a92e 100644 --- a/src/test/java/org/apache/ibatis/executor/loader/SerializableProxyTest.java +++ b/src/test/java/org/apache/ibatis/executor/loader/SerializableProxyTest.java @@ -110,7 +110,7 @@ void shouldSerializeAProxyForABeanWithoutDefaultConstructorAndUnloadedProperties } @Test - void shouldSerizaliceAFullLoadedObjectToOriginalClass() throws Exception { + void shouldSerializeAFullLoadedObjectToOriginalClass() throws Exception { Object proxy = proxyFactory.createProxy(author, new ResultLoaderMap(), new Configuration(), new DefaultObjectFactory(), new ArrayList<>(), new ArrayList<>()); Object proxy2 = deserialize(serialize((Serializable) proxy)); diff --git a/src/test/java/org/apache/ibatis/io/ExternalResourcesTest.java b/src/test/java/org/apache/ibatis/io/ExternalResourcesTest.java index d74426e48a3..61a10d0b0c2 100644 --- a/src/test/java/org/apache/ibatis/io/ExternalResourcesTest.java +++ b/src/test/java/org/apache/ibatis/io/ExternalResourcesTest.java @@ -91,7 +91,7 @@ void testGetConfiguredTemplate() { templateName = ExternalResources.getConfiguredTemplate(tempFile.getAbsolutePath(), "new_command.template"); assertEquals("templates/col_new_template_migration.sql", templateName); } catch (Exception e) { - fail("Test failed with execption: " + e.getMessage()); + fail("Test failed with exception: " + e.getMessage()); } } diff --git a/src/test/java/org/apache/ibatis/jdbc/ScriptRunnerTest.java b/src/test/java/org/apache/ibatis/jdbc/ScriptRunnerTest.java index 2e6bb33d0df..f4e2e71c8da 100644 --- a/src/test/java/org/apache/ibatis/jdbc/ScriptRunnerTest.java +++ b/src/test/java/org/apache/ibatis/jdbc/ScriptRunnerTest.java @@ -115,7 +115,7 @@ void shouldReturnWarningIfEndOfLineTerminatorNotFound() throws Exception { } @Test - void commentAferStatementDelimiterShouldNotCauseRunnerFail() throws Exception { + void commentAfterStatementDelimiterShouldNotCauseRunnerFail() throws Exception { DataSource ds = createUnpooledDataSource(JPETSTORE_PROPERTIES); String resource = "org/apache/ibatis/jdbc/ScriptCommentAfterEOLTerminator.sql"; try (Connection conn = ds.getConnection(); Reader reader = Resources.getResourceAsReader(resource)) { @@ -185,7 +185,7 @@ void testLogging() throws Exception { } @Test - void testLoggingFullScipt() throws Exception { + void testLoggingFullScript() throws Exception { DataSource ds = createUnpooledDataSource(JPETSTORE_PROPERTIES); try (Connection conn = ds.getConnection()) { ScriptRunner runner = new ScriptRunner(conn); diff --git a/src/test/java/org/apache/ibatis/mapping/ResultMappingTest.java b/src/test/java/org/apache/ibatis/mapping/ResultMappingTest.java index 86407988a11..580b48743ea 100644 --- a/src/test/java/org/apache/ibatis/mapping/ResultMappingTest.java +++ b/src/test/java/org/apache/ibatis/mapping/ResultMappingTest.java @@ -38,7 +38,7 @@ void shouldThrowErrorWhenBothResultMapAndNestedSelectAreSet() { // Issue 4: column is mandatory on nested queries @Test - void shouldFailWithAMissingColumnInNetstedSelect() { + void shouldFailWithAMissingColumnInNestedSelect() { Assertions.assertThrows(IllegalStateException.class, () -> new ResultMapping.Builder(configuration, "prop").nestedQueryId("nested query ID").build()); } diff --git a/src/test/java/org/apache/ibatis/submitted/automapping/AutomappingTest.java b/src/test/java/org/apache/ibatis/submitted/automapping/AutomappingTest.java index 179bf380015..0082266d4a2 100644 --- a/src/test/java/org/apache/ibatis/submitted/automapping/AutomappingTest.java +++ b/src/test/java/org/apache/ibatis/submitted/automapping/AutomappingTest.java @@ -55,7 +55,7 @@ void shouldGetAUser() { } @Test - void shouldGetAUserWhithPhoneNumber() { + void shouldGetAUserWithPhoneNumber() { sqlSessionFactory.getConfiguration().setAutoMappingBehavior(AutoMappingBehavior.NONE); try (SqlSession sqlSession = sqlSessionFactory.openSession()) { Mapper mapper = sqlSession.getMapper(Mapper.class); diff --git a/src/test/java/org/apache/ibatis/submitted/force_flush_on_select/ForceFlushOnSelectTest.java b/src/test/java/org/apache/ibatis/submitted/force_flush_on_select/ForceFlushOnSelectTest.java index ae1e33870bb..c44400fd50f 100644 --- a/src/test/java/org/apache/ibatis/submitted/force_flush_on_select/ForceFlushOnSelectTest.java +++ b/src/test/java/org/apache/ibatis/submitted/force_flush_on_select/ForceFlushOnSelectTest.java @@ -118,7 +118,7 @@ void testUpdateShouldFlushLocalCache() { } @Test - void testSelectShouldFlushLocalCacheIfFlushLocalCacheAtferEachStatementIsTrue() throws SQLException { + void testSelectShouldFlushLocalCacheIfFlushLocalCacheAfterEachStatementIsTrue() throws SQLException { sqlSessionFactory.getConfiguration().setLocalCacheScope(LocalCacheScope.STATEMENT); try (SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.SIMPLE)) { PersonMapper personMapper = sqlSession.getMapper(PersonMapper.class); diff --git a/src/test/java/org/apache/ibatis/submitted/keygen/Jdbc3KeyGeneratorTest.java b/src/test/java/org/apache/ibatis/submitted/keygen/Jdbc3KeyGeneratorTest.java index 0e8342e93d6..872f1ed8355 100644 --- a/src/test/java/org/apache/ibatis/submitted/keygen/Jdbc3KeyGeneratorTest.java +++ b/src/test/java/org/apache/ibatis/submitted/keygen/Jdbc3KeyGeneratorTest.java @@ -197,7 +197,7 @@ void shouldAssignKeysToNamedList() { } @Test - void shouldAssingKeysToCollection() { + void shouldAssignKeysToCollection() { try (SqlSession sqlSession = sqlSessionFactory.openSession()) { try { CountryMapper mapper = sqlSession.getMapper(CountryMapper.class); @@ -215,7 +215,7 @@ void shouldAssingKeysToCollection() { } @Test - void shouldAssingKeysToNamedCollection() { + void shouldAssignKeysToNamedCollection() { try (SqlSession sqlSession = sqlSessionFactory.openSession()) { try { CountryMapper mapper = sqlSession.getMapper(CountryMapper.class); @@ -233,7 +233,7 @@ void shouldAssingKeysToNamedCollection() { } @Test - void shouldAssingKeysToArray() { + void shouldAssignKeysToArray() { try (SqlSession sqlSession = sqlSessionFactory.openSession()) { try { CountryMapper mapper = sqlSession.getMapper(CountryMapper.class); @@ -251,7 +251,7 @@ void shouldAssingKeysToArray() { } @Test - void shouldAssingKeysToNamedArray() { + void shouldAssignKeysToNamedArray() { try (SqlSession sqlSession = sqlSessionFactory.openSession()) { try { CountryMapper mapper = sqlSession.getMapper(CountryMapper.class); @@ -595,7 +595,7 @@ void shouldAssignKeyToAParamWithTrickyName() { } @Test - void shouldAssingKeysToAMap() { + void shouldAssignKeysToAMap() { try (SqlSession sqlSession = sqlSessionFactory.openSession()) { try { CountryMapper mapper = sqlSession.getMapper(CountryMapper.class); diff --git a/src/test/java/org/apache/ibatis/submitted/lazy_properties/LazyPropertiesTest.java b/src/test/java/org/apache/ibatis/submitted/lazy_properties/LazyPropertiesTest.java index 760bbb5f251..07abb58406d 100644 --- a/src/test/java/org/apache/ibatis/submitted/lazy_properties/LazyPropertiesTest.java +++ b/src/test/java/org/apache/ibatis/submitted/lazy_properties/LazyPropertiesTest.java @@ -155,16 +155,16 @@ void verifyCustomLazyLoadTriggerMethods() { @Test void shouldInvokingSetterInvalidateLazyLoading_Javassist() { - shoulInvokingSetterInvalidateLazyLoading(new JavassistProxyFactory()); + shouldInvokingSetterInvalidateLazyLoading(new JavassistProxyFactory()); } @Tag("RequireIllegalAccess") @Test void shouldInvokingSetterInvalidateLazyLoading_Cglib() { - shoulInvokingSetterInvalidateLazyLoading(new CglibProxyFactory()); + shouldInvokingSetterInvalidateLazyLoading(new CglibProxyFactory()); } - private void shoulInvokingSetterInvalidateLazyLoading(ProxyFactory proxyFactory) { + private void shouldInvokingSetterInvalidateLazyLoading(ProxyFactory proxyFactory) { Configuration config = sqlSessionFactory.getConfiguration(); config.setProxyFactory(proxyFactory); config.setAggressiveLazyLoading(false); diff --git a/src/test/java/org/apache/ibatis/submitted/result_handler/ResulthandlerTest.java b/src/test/java/org/apache/ibatis/submitted/result_handler/ResultHandlerTest.java similarity index 98% rename from src/test/java/org/apache/ibatis/submitted/result_handler/ResulthandlerTest.java rename to src/test/java/org/apache/ibatis/submitted/result_handler/ResultHandlerTest.java index 6ca7a50cbfe..91653fbcc4a 100644 --- a/src/test/java/org/apache/ibatis/submitted/result_handler/ResulthandlerTest.java +++ b/src/test/java/org/apache/ibatis/submitted/result_handler/ResultHandlerTest.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -class ResulthandlerTest { +class ResultHandlerTest { private static SqlSessionFactory sqlSessionFactory; diff --git a/src/test/java/org/apache/ibatis/type/SqlTimetampTypeHandlerTest.java b/src/test/java/org/apache/ibatis/type/SqlTimestampTypeHandlerTest.java similarity index 97% rename from src/test/java/org/apache/ibatis/type/SqlTimetampTypeHandlerTest.java rename to src/test/java/org/apache/ibatis/type/SqlTimestampTypeHandlerTest.java index 4276364acfc..57212a3e659 100644 --- a/src/test/java/org/apache/ibatis/type/SqlTimetampTypeHandlerTest.java +++ b/src/test/java/org/apache/ibatis/type/SqlTimestampTypeHandlerTest.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; -class SqlTimetampTypeHandlerTest extends BaseTypeHandlerTest { +class SqlTimestampTypeHandlerTest extends BaseTypeHandlerTest { private static final TypeHandler TYPE_HANDLER = new SqlTimestampTypeHandler(); private static final java.sql.Timestamp SQL_TIME = new java.sql.Timestamp(new Date().getTime()); From 5932aa117ec8419b3432f02b91573b0009fbac73 Mon Sep 17 00:00:00 2001 From: tanpenggood Date: Tue, 14 Jan 2025 13:21:05 +0800 Subject: [PATCH 2/2] [type: typo] (test) Fix "After" typo --- src/test/java/org/apache/ibatis/jdbc/ScriptRunnerTest.java | 2 +- .../submitted/force_flush_on_select/ForceFlushOnSelectTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/apache/ibatis/jdbc/ScriptRunnerTest.java b/src/test/java/org/apache/ibatis/jdbc/ScriptRunnerTest.java index 9f2b38d3078..41ba5e837e0 100644 --- a/src/test/java/org/apache/ibatis/jdbc/ScriptRunnerTest.java +++ b/src/test/java/org/apache/ibatis/jdbc/ScriptRunnerTest.java @@ -113,7 +113,7 @@ void shouldReturnWarningIfEndOfLineTerminatorNotFound() throws Exception { } @Test - void commentAferStatementDelimiterShouldNotCauseRunnerFail() throws Exception { + void commentAfterStatementDelimiterShouldNotCauseRunnerFail() throws Exception { DataSource ds = createUnpooledDataSource(JPETSTORE_PROPERTIES); String resource = "org/apache/ibatis/jdbc/ScriptCommentAfterEOLTerminator.sql"; try (Connection conn = ds.getConnection(); Reader reader = Resources.getResourceAsReader(resource)) { diff --git a/src/test/java/org/apache/ibatis/submitted/force_flush_on_select/ForceFlushOnSelectTest.java b/src/test/java/org/apache/ibatis/submitted/force_flush_on_select/ForceFlushOnSelectTest.java index 6603b828064..4942c8f77f3 100644 --- a/src/test/java/org/apache/ibatis/submitted/force_flush_on_select/ForceFlushOnSelectTest.java +++ b/src/test/java/org/apache/ibatis/submitted/force_flush_on_select/ForceFlushOnSelectTest.java @@ -118,7 +118,7 @@ void updateShouldFlushLocalCache() { } @Test - void selectShouldFlushLocalCacheIfFlushLocalCacheAtferEachStatementIsTrue() throws SQLException { + void selectShouldFlushLocalCacheIfFlushLocalCacheAfterEachStatementIsTrue() throws SQLException { sqlSessionFactory.getConfiguration().setLocalCacheScope(LocalCacheScope.STATEMENT); try (SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.SIMPLE)) { PersonMapper personMapper = sqlSession.getMapper(PersonMapper.class);