"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/AbstractJdbcAppenderDataSourceTest.java" between
apache-log4j-2.12.3-src.tar.gz and apache-log4j-2.12.4-src.tar.gz

About: Apache Log4j 2 is a logging library for Java. Source distribution (Java).
Caution: Release 2.12.3 is the last 2.x release to support Java 7 (Java 8 users should use 2.17.0 or greater) and have fixed a critical remote code execution vulnerability (CVE-2021-44228).

AbstractJdbcAppenderDataSourceTest.java  (apache-log4j-2.12.3-src):AbstractJdbcAppenderDataSourceTest.java  (apache-log4j-2.12.4-src)
skipping to change at line 19 skipping to change at line 19
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the license for the specific language governing permissions and * See the license for the specific language governing permissions and
* limitations under the license. * limitations under the license.
*/ */
package org.apache.logging.log4j.core.appender.db.jdbc; package org.apache.logging.log4j.core.appender.db.jdbc;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.sql.Connection; import java.sql.Connection;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
import javax.sql.DataSource; import javax.sql.DataSource;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.util.Throwables; import org.apache.logging.log4j.core.util.Throwables;
import org.apache.logging.log4j.junit.JdbcRule; import org.apache.logging.log4j.junit.JdbcRule;
import org.apache.logging.log4j.junit.JndiRule; import org.apache.logging.log4j.junit.JndiRule;
import org.apache.logging.log4j.junit.LoggerContextRule; import org.apache.logging.log4j.junit.LoggerContextRule;
import org.h2.util.IOUtils; import org.h2.util.IOUtils;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.RuleChain; import org.junit.rules.RuleChain;
import org.mockito.invocation.InvocationOnMock; import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer; import org.mockito.stubbing.Answer;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
/** /**
* Abstract unit test for JdbcAppender using a {@link DataSource} configuration. * Abstract unit test for JdbcAppender using a {@link DataSource} configuration.
*/ */
public abstract class AbstractJdbcAppenderDataSourceTest { public abstract class AbstractJdbcAppenderDataSourceTest extends AbstractJdbcDat aSourceTest {
@Rule @Rule
public final RuleChain rules; public final RuleChain rules;
private final JdbcRule jdbcRule; private final JdbcRule jdbcRule;
protected AbstractJdbcAppenderDataSourceTest(final JdbcRule jdbcRule) { protected AbstractJdbcAppenderDataSourceTest(final JdbcRule jdbcRule) {
this.rules = RuleChain.emptyRuleChain() this.rules = RuleChain.emptyRuleChain()
.around(new JndiRule("java:/comp/env/jdbc/TestDataSourceAppender", c reateMockDataSource())) .around(new JndiRule("java:/comp/env/jdbc/TestDataSourceAppender", c reateMockDataSource()))
.around(jdbcRule) .around(jdbcRule)
.around(new LoggerContextRule( .around(new LoggerContextRule(
 End of changes. 4 change blocks. 
5 lines changed or deleted 8 lines changed or added

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