"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSourceTest.java" between
apache-log4j-2.11.1-src.tar.gz and apache-log4j-2.11.2-src.tar.gz

About: Apache Log4j 2 is a logging library for Java. Source distribution (Java).

DriverManagerConnectionSourceTest.java  (apache-log4j-2.11.1-src):DriverManagerConnectionSourceTest.java  (apache-log4j-2.11.2-src)
skipping to change at line 31 skipping to change at line 31
import java.sql.SQLException; import java.sql.SQLException;
import org.apache.logging.log4j.core.config.Property; import org.apache.logging.log4j.core.config.Property;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
public class DriverManagerConnectionSourceTest { public class DriverManagerConnectionSourceTest {
@Test @Test
public void testH2Properties() throws SQLException { public void testH2Properties() throws SQLException {
Property[] properties = new Property[] { final Property[] properties = new Property[] {
// @formatter:off // @formatter:off
Property.createProperty("username", JdbcH2TestHelper.USER_NAME), Property.createProperty("username", JdbcH2TestHelper.USER_NAME),
Property.createProperty("password", JdbcH2TestHelper.PASSWORD), Property.createProperty("password", JdbcH2TestHelper.PASSWORD),
// @formatter:on // @formatter:on
}; };
// @formatter:off // @formatter:off
DriverManagerConnectionSource source = DriverManagerConnectionSource.new final DriverManagerConnectionSource source = DriverManagerConnectionSour
Builder() ce.newBuilder()
.setConnectionString(JdbcH2TestHelper.CONNECTION_STRING) .setConnectionString(JdbcH2TestHelper.CONNECTION_STRING_MEM)
.setProperties(properties) .setProperties(properties)
.build(); .build();
// @formatter:on // @formatter:on
try (Connection conn = source.getConnection()) { try (Connection conn = source.getConnection()) {
Assert.assertFalse(conn.isClosed()); Assert.assertFalse(conn.isClosed());
} }
} }
@Test @Test
public void testH2UserAndPassword() throws SQLException { public void testH2UserAndPassword() throws SQLException {
// @formatter:off // @formatter:off
DriverManagerConnectionSource source = DriverManagerConnectionSource.new final DriverManagerConnectionSource source = DriverManagerConnectionSour
Builder() ce.newBuilder()
.setConnectionString(JdbcH2TestHelper.CONNECTION_STRING) .setConnectionString(JdbcH2TestHelper.CONNECTION_STRING_MEM)
.setUserName(JdbcH2TestHelper.USER_NAME.toCharArray()) .setUserName(JdbcH2TestHelper.USER_NAME.toCharArray())
.setPassword(JdbcH2TestHelper.PASSWORD.toCharArray()) .setPassword(JdbcH2TestHelper.PASSWORD.toCharArray())
.build(); .build();
// @formatter:on // @formatter:on
try (Connection conn = source.getConnection()) { try (Connection conn = source.getConnection()) {
Assert.assertFalse(conn.isClosed()); Assert.assertFalse(conn.isClosed());
} }
} }
} }
 End of changes. 3 change blocks. 
7 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)