From 19129f372177c05bea461ce483d93e33fc478f90 Mon Sep 17 00:00:00 2001 From: kwoyke Date: Wed, 16 Jun 2021 12:38:07 +0200 Subject: [PATCH] BAEL-5001: Fix typo in C3P0 (#10886) Co-authored-by: Krzysztof Woyke --- .../{C3poDataSource.java => C3p0DataSource.java} | 4 ++-- .../connectionpool/C3p0DataSourceUnitTest.java | 13 +++++++++++++ .../connectionpool/C3poDataSourceUnitTest.java | 13 ------------- 3 files changed, 15 insertions(+), 15 deletions(-) rename persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/{C3poDataSource.java => C3p0DataSource.java} (91%) create mode 100644 persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/C3p0DataSourceUnitTest.java delete mode 100644 persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/C3poDataSourceUnitTest.java diff --git a/persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/C3poDataSource.java b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/C3p0DataSource.java similarity index 91% rename from persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/C3poDataSource.java rename to persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/C3p0DataSource.java index 78642459d5..431427d332 100644 --- a/persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/C3poDataSource.java +++ b/persistence-modules/core-java-persistence/src/main/java/com/baeldung/connectionpool/C3p0DataSource.java @@ -5,7 +5,7 @@ import java.beans.PropertyVetoException; import java.sql.Connection; import java.sql.SQLException; -public class C3poDataSource { +public class C3p0DataSource { private static final ComboPooledDataSource cpds = new ComboPooledDataSource(); @@ -24,5 +24,5 @@ public class C3poDataSource { return cpds.getConnection(); } - private C3poDataSource(){} + private C3p0DataSource(){} } \ No newline at end of file diff --git a/persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/C3p0DataSourceUnitTest.java b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/C3p0DataSourceUnitTest.java new file mode 100644 index 0000000000..1095214e24 --- /dev/null +++ b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/C3p0DataSourceUnitTest.java @@ -0,0 +1,13 @@ +package com.baeldung.connectionpool; + +import java.sql.SQLException; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class C3p0DataSourceUnitTest { + + @Test + public void givenC3p0DataSourceClass_whenCallGetConnection_thenCorrect() throws SQLException { + assertTrue(C3p0DataSource.getConnection().isValid(1)); + } +} \ No newline at end of file diff --git a/persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/C3poDataSourceUnitTest.java b/persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/C3poDataSourceUnitTest.java deleted file mode 100644 index acad9fe5e4..0000000000 --- a/persistence-modules/core-java-persistence/src/test/java/com/baeldung/connectionpool/C3poDataSourceUnitTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.baeldung.connectionpool; - -import java.sql.SQLException; -import static org.junit.Assert.assertTrue; -import org.junit.Test; - -public class C3poDataSourceUnitTest { - - @Test - public void givenC3poDataSourceClass_whenCalledgetConnection_thenCorrect() throws SQLException { - assertTrue(C3poDataSource.getConnection().isValid(1)); - } -} \ No newline at end of file