Skip to content

Commit

Permalink
move disabled tests to logback-classic-blackbox
Browse files Browse the repository at this point in the history
  • Loading branch information
ceki committed Oct 2, 2022
1 parent c3d75b2 commit 74a44b9
Show file tree
Hide file tree
Showing 21 changed files with 474 additions and 55 deletions.
92 changes: 92 additions & 0 deletions logback-access-blackbox/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-parent</artifactId>
<version>1.4.2-SNAPSHOT</version>
</parent>

<artifactId>logback-access-blackbox</artifactId>
<packaging>jar</packaging>
<name>Logback Access Blackbox Testing</name>
<description>Logback Access Blackbox Testing Module</description>

<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-access</artifactId>
</dependency>

<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
</dependency>

<dependency>
<groupId>jakarta.mail</groupId>
<artifactId>jakarta.mail-api</artifactId>
<scope>compile</scope>
</dependency>


</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>default-test</id>
<configuration>

<argLine>
</argLine>
<parallel>classes</parallel>
<threadCount>8</threadCount>
<!--<useUnlimitedThreads>false</useUnlimitedThreads>-->
<forkCount>1C</forkCount>
<reuseForks>true</reuseForks>
<reportFormat>plain</reportFormat>
<trimStackTrace>false</trimStackTrace>
<!-- See https://issues.apache.org/jira/browse/SUREFIRE-1265 -->
<!--<childDelegation>true</childDelegation>-->
<useModulePath>true</useModulePath>

<excludes>
</excludes>
</configuration>
</execution>

<execution>
<id>singleJVM</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<forkCount>4</forkCount>
<reuseForks>false</reuseForks>
<includes>
</includes>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>

</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration>

<configuration>

<evaluator name="helloEval">
<Expression>m.matches(message)</Expression>
<matcher>
<name>m</name>
<regex>^hello.*</regex>
<CaseSensitive>false</CaseSensitive>
</matcher>
</evaluator>

<appender name="STR_LIST"
class="ch.qos.logback.core.testUtil.StringListAppender">
<layout>
<Pattern>%caller{4, helloEval}%d %level - %m%n</Pattern>
</layout>
</appender>

<root>
<level value="DEBUG" />
<appender-ref ref="STR_LIST" />
</root>



</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<configuration>

<appender name="LIST"
class="ch.qos.logback.core.read.ListAppender">

<filter class="ch.qos.logback.core.filter.EvaluatorFilter">
<Name>myFilter</Name>
<OnMatch>DENY</OnMatch>
<Evaluator>
<Name>mdcEvaluator</Name>
<Expression>"to be ignored".equals(message)</Expression>
</Evaluator>
</filter>
</appender>

<root level="debug">
<appender-ref ref="LIST" />
</root>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<configuration>

<import class="ch.qos.logback.core.read.ListAppender"/>
<import class="ch.qos.logback.core.filter.EvaluatorFilter"/>

<appender name="LIST" class="ListAppender">

<filter class="EvaluatorFilter">
<Name>myFilter</Name>
<OnMatch>DENY</OnMatch>
<Evaluator>
<Name>mdcEvaluator</Name>
<Expression>"to be ignored".equals(message)</Expression>
</Evaluator>
</filter>
</appender>

<root level="debug">
<appender-ref ref="LIST" />
</root>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<configuration debug="false">

<appender name="LIST" class="ch.qos.logback.core.read.ListAppender"/>

<!-- Uncomment this property if you need the extra appender -->
<!-- property name="EXTRA" value="ON" /> -->
<if condition='isDefined("EXTRA")'>
<then>
<appender name="EXTRA_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
...
</appender>
</then>
</if>

<root level="INFO">
<appender-ref ref="LIST"/>
<if condition='isDefined("EXTRA")'>
<then>
<appender-ref ref="EXTRA_APPENDER"/>
</then>
</if>
</root>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<configuration debug="false">



<appender name="LIST_THEN" class="ch.qos.logback.core.read.ListAppender"/>
<appender name="LIST_ELSE" class="ch.qos.logback.core.read.ListAppender"/>

<root level="INFO"/>

<if condition='isDefined("EXTRA")'>
<then>
<root>
<appender-ref ref="LIST_THEN"/>
</root>
</then>
<else>
<root>
<appender-ref ref="LIST_ELSE"/>
</root>
</else>
</if>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<configuration debug="false">

<if condition='isDefined("EXTRA")'>
<then>
<appender name="EXTRA_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
...
</appender>
</then>
</if>
...

<root level="INFO">
<appender-ref ref="CONSOLE" />
<if condition='isDefined("EXTRA")'>
<then>
<appender-ref ref="EXTRA_APPENDER" />
</then>
</if>
</root>

</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
*
* This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation
*
* or (per the licensee's choosing)
*
* under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation.
*/

package ch.qos.logback.classic.blackbox;

public class BlackboxClassicTestConstants {

public static final String TEST_SRC_PREFIX = "src/test/";
public static final String TEST_INPUT_PREFIX = TEST_SRC_PREFIX + "blackboxInput/";
public static final String JORAN_INPUT_PREFIX = TEST_INPUT_PREFIX + "joran/";
}
Loading

0 comments on commit 74a44b9

Please sign in to comment.