Skip to content

Commit a496a04

Browse files
committed
adding http scan capability, had to move tests
Signed-off-by: Ceki Gulcu <[email protected]>
1 parent 67c24f6 commit a496a04

File tree

57 files changed

+937
-709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+937
-709
lines changed

logback-classic-blackbox/pom.xml

+16
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,24 @@
2222
<artifactId>logback-classic</artifactId>
2323
</dependency>
2424

25+
<dependency>
26+
<groupId>org.eclipse.jetty</groupId>
27+
<artifactId>jetty-server</artifactId>
28+
<version>${jetty.version}</version>
29+
<scope>test</scope>
30+
</dependency>
31+
32+
<dependency>
33+
<groupId>org.eclipse.jetty.ee10</groupId>
34+
<artifactId>jetty-ee10-servlet</artifactId>
35+
<version>${jetty.version}</version>
36+
</dependency>
37+
38+
2539
<dependency>
2640
<groupId>jakarta.servlet</groupId>
2741
<artifactId>jakarta.servlet-api</artifactId>
42+
<version>6.0.0</version>
2843
</dependency>
2944

3045
<dependency>
@@ -66,6 +81,7 @@
6681
</exclusion>
6782
</exclusions>
6883
</dependency>
84+
6985
</dependencies>
7086

7187
<build>

logback-classic/src/test/input/joran/roct/inclusion/topByResource.xml renamed to logback-classic-blackbox/src/test/blackboxInput/joran/roct/inclusion/topByResource.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!DOCTYPE x>
33

44

5-
<configuration scan="true" scanPeriod="5 milliseconds">
5+
<configuration debug="true" scan="true" scanPeriod="5 milliseconds">
66
<include resource="asResource/inner1.xml"/>
77
</configuration>
88

logback-classic/src/test/input/joran/roct/inclusion/topLevel0.xml renamed to logback-classic-blackbox/src/test/blackboxInput/joran/roct/inclusion/topLevel0.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<configuration scan="true" scanPeriod="5 milliseconds">
55

6-
<include file="src/test/input/joran/roct/inclusion/inner0.xml"/>
6+
<include file="src/test/blackboxInput/joran/roct/inclusion/inner0.xml"/>
77

88
</configuration>
9-
9+
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
<configuration scan="true" scanPeriod="25 millisecond">
33

4-
<appender name="default" class="ch.qos.logback.classic.RecursivelyLoggingAppender474">
4+
<appender name="default" class="ch.qos.logback.classic.blackbox.joran.RecursivelyLoggingAppender474">
55
</appender>
66

77
<logger name="Ignore" level="ERROR" additivity="false"/>
@@ -11,4 +11,4 @@
1111
</root>
1212

1313
</configuration>
14-
14+

logback-classic/src/test/java/ch/qos/logback/classic/issue/lbclassic135/LoggingRunnable.java renamed to logback-classic-blackbox/src/test/java/ch/qos/logback/classic/blackbox/issue/lbclassic135/LoggingRunnable.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/**
1+
/*
22
* Logback: the reliable, generic, fast and flexible logging framework.
3-
* Copyright (C) 1999-2015, QOS.ch. All rights reserved.
3+
* Copyright (C) 1999-2024, QOS.ch. All rights reserved.
44
*
55
* This program and the accompanying materials are dual-licensed under
66
* either the terms of the Eclipse Public License v1.0 as published by
@@ -11,10 +11,10 @@
1111
* under the terms of the GNU Lesser General Public License version 2.1
1212
* as published by the Free Software Foundation.
1313
*/
14-
package ch.qos.logback.classic.issue.lbclassic135;
14+
package ch.qos.logback.classic.blackbox.issue.lbclassic135;
1515

1616
import org.slf4j.Logger;
17-
import ch.qos.logback.core.contention.RunnableWithCounterAndDone;
17+
import ch.qos.logback.core.testUtil.RunnableWithCounterAndDone;
1818

1919
public class LoggingRunnable extends RunnableWithCounterAndDone {
2020

logback-classic/src/test/java/ch/qos/logback/classic/issue/lbclassic135/LoggingToFileThroughput.java renamed to logback-classic-blackbox/src/test/java/ch/qos/logback/classic/blackbox/issue/lbclassic135/LoggingToFileThroughput.java

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/**
1+
/*
22
* Logback: the reliable, generic, fast and flexible logging framework.
3-
* Copyright (C) 1999-2015, QOS.ch. All rights reserved.
3+
* Copyright (C) 1999-2024, QOS.ch. All rights reserved.
44
*
55
* This program and the accompanying materials are dual-licensed under
66
* either the terms of the Eclipse Public License v1.0 as published by
@@ -11,15 +11,15 @@
1111
* under the terms of the GNU Lesser General Public License version 2.1
1212
* as published by the Free Software Foundation.
1313
*/
14-
package ch.qos.logback.classic.issue.lbclassic135;
14+
package ch.qos.logback.classic.blackbox.issue.lbclassic135;
1515

1616
import ch.qos.logback.classic.Logger;
1717
import ch.qos.logback.classic.LoggerContext;
1818
import ch.qos.logback.classic.encoder.PatternLayoutEncoder;
1919
import ch.qos.logback.classic.spi.ILoggingEvent;
2020
import ch.qos.logback.core.FileAppender;
21-
import ch.qos.logback.core.contention.RunnableWithCounterAndDone;
22-
import ch.qos.logback.core.contention.ThreadedThroughputCalculator;
21+
import ch.qos.logback.core.testUtil.RunnableWithCounterAndDone;
22+
//import ch.qos.logback.core.contention.ThreadedThroughputCalculator;
2323

2424
/**
2525
* Short sample code testing the throughput of a fair lock.
@@ -33,20 +33,20 @@ public class LoggingToFileThroughput {
3333

3434
public static void main(String args[]) throws InterruptedException {
3535

36-
ThreadedThroughputCalculator tp = new ThreadedThroughputCalculator(OVERALL_DURATION_IN_MILLIS);
37-
tp.printEnvironmentInfo("lbclassic135 LoggingToFileThrouhput");
38-
39-
LoggerContext lc = new LoggerContext();
40-
Logger logger = buildLoggerContext(lc);
41-
42-
for (int i = 0; i < 2; i++) {
43-
tp.execute(buildArray(logger));
44-
}
45-
46-
RunnableWithCounterAndDone[] runnnableArray = buildArray(logger);
47-
tp.execute(runnnableArray);
48-
tp.printThroughput(runnnableArray, "File: ");
49-
lc.stop();
36+
// ThreadedThroughputCalculator tp = new ThreadedThroughputCalculator(OVERALL_DURATION_IN_MILLIS);
37+
// tp.printEnvironmentInfo("lbclassic135 LoggingToFileThrouhput");
38+
//
39+
// LoggerContext lc = new LoggerContext();
40+
// Logger logger = buildLoggerContext(lc);
41+
//
42+
// for (int i = 0; i < 2; i++) {
43+
// tp.execute(buildArray(logger));
44+
// }
45+
//
46+
// RunnableWithCounterAndDone[] runnnableArray = buildArray(logger);
47+
// tp.execute(runnnableArray);
48+
// tp.printThroughput(runnnableArray, "File: ");
49+
// lc.stop();
5050
}
5151

5252
static Logger buildLoggerContext(LoggerContext lc) {

logback-classic/src/test/java/ch/qos/logback/classic/joran/ChangeDetectedListener.java renamed to logback-classic-blackbox/src/test/java/ch/qos/logback/classic/blackbox/joran/ChangeDetectedListener.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Logback: the reliable, generic, fast and flexible logging framework.
3-
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
3+
* Copyright (C) 1999-2024, QOS.ch. All rights reserved.
44
*
55
* This program and the accompanying materials are dual-licensed under
66
* either the terms of the Eclipse Public License v1.0 as published by
@@ -12,8 +12,9 @@
1212
* as published by the Free Software Foundation.
1313
*/
1414

15-
package ch.qos.logback.classic.joran;
15+
package ch.qos.logback.classic.blackbox.joran;
1616

17+
import ch.qos.logback.classic.joran.ReconfigureOnChangeTask;
1718
import ch.qos.logback.core.spi.ConfigurationEvent;
1819
import ch.qos.logback.core.spi.ConfigurationEventListener;
1920

@@ -33,7 +34,7 @@ class ChangeDetectedListener implements ConfigurationEventListener {
3334
public void listen(ConfigurationEvent configurationEvent) {
3435
switch (configurationEvent.getEventType()) {
3536
case CHANGE_DETECTED:
36-
System.out.println(this.toString() + "#listen Change detected " + configurationEvent +" count="+countDownLatch.getCount());
37+
//System.out.println(this.toString() + "#listen Change detected " + configurationEvent +" count="+countDownLatch.getCount());
3738

3839
countDownLatch.countDown();
3940
Object data = configurationEvent.getData();

logback-classic/src/test/java/ch/qos/logback/classic/joran/PartialConfigurationEndedSuccessfullyEventListener.java renamed to logback-classic-blackbox/src/test/java/ch/qos/logback/classic/blackbox/joran/PartialConfigurationEndedSuccessfullyEventListener.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* as published by the Free Software Foundation.
1313
*/
1414

15-
package ch.qos.logback.classic.joran;
15+
package ch.qos.logback.classic.blackbox.joran;
1616

1717
import ch.qos.logback.core.spi.ConfigurationEvent;
1818
import ch.qos.logback.core.spi.ConfigurationEventListener;
@@ -31,7 +31,7 @@ class PartialConfigurationEndedSuccessfullyEventListener implements Configuratio
3131
public void listen(ConfigurationEvent configurationEvent) {
3232
switch (configurationEvent.getEventType()) {
3333
case PARTIAL_CONFIGURATION_ENDED_SUCCESSFULLY:
34-
System.out.println(this.toString() + "#listen PARTIAL_CONFIGURATION_ENDED_SUCCESSFULLY detected " + configurationEvent +" count="+countDownLatch.getCount());
34+
//System.out.println(this.toString() + "#listen PARTIAL_CONFIGURATION_ENDED_SUCCESSFULLY detected " + configurationEvent +" count="+countDownLatch.getCount());
3535

3636
countDownLatch.countDown();
3737
break;

logback-classic/src/test/java/ch/qos/logback/classic/joran/ReconfigurationDoneListener.java renamed to logback-classic-blackbox/src/test/java/ch/qos/logback/classic/blackbox/joran/ReconfigurationDoneListener.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Logback: the reliable, generic, fast and flexible logging framework.
3-
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
3+
* Copyright (C) 1999-2024, QOS.ch. All rights reserved.
44
*
55
* This program and the accompanying materials are dual-licensed under
66
* either the terms of the Eclipse Public License v1.0 as published by
@@ -12,8 +12,9 @@
1212
* as published by the Free Software Foundation.
1313
*/
1414

15-
package ch.qos.logback.classic.joran;
15+
package ch.qos.logback.classic.blackbox.joran;
1616

17+
import ch.qos.logback.classic.joran.ReconfigureOnChangeTask;
1718
import ch.qos.logback.core.spi.ConfigurationEvent;
1819
import ch.qos.logback.core.spi.ConfigurationEventListener;
1920

logback-classic/src/test/java/ch/qos/logback/classic/joran/ReconfigurationTaskRegisteredConfigEventListener.java renamed to logback-classic-blackbox/src/test/java/ch/qos/logback/classic/blackbox/joran/ReconfigurationTaskRegisteredConfigEventListener.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Logback: the reliable, generic, fast and flexible logging framework.
3-
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
3+
* Copyright (C) 1999-2024, QOS.ch. All rights reserved.
44
*
55
* This program and the accompanying materials are dual-licensed under
66
* either the terms of the Eclipse Public License v1.0 as published by
@@ -12,8 +12,9 @@
1212
* as published by the Free Software Foundation.
1313
*/
1414

15-
package ch.qos.logback.classic.joran;
15+
package ch.qos.logback.classic.blackbox.joran;
1616

17+
import ch.qos.logback.classic.joran.ReconfigureOnChangeTask;
1718
import ch.qos.logback.core.spi.ConfigurationEvent;
1819
import ch.qos.logback.core.spi.ConfigurationEventListener;
1920

logback-classic/src/test/java/ch/qos/logback/classic/joran/ReconfigureOnChangeTaskHarness.java renamed to logback-classic-blackbox/src/test/java/ch/qos/logback/classic/blackbox/joran/ReconfigureOnChangeTaskHarness.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Logback: the reliable, generic, fast and flexible logging framework.
3-
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
3+
* Copyright (C) 1999-2024, QOS.ch. All rights reserved.
44
*
55
* This program and the accompanying materials are dual-licensed under
66
* either the terms of the Eclipse Public License v1.0 as published by
@@ -12,10 +12,10 @@
1212
* as published by the Free Software Foundation.
1313
*/
1414

15-
package ch.qos.logback.classic.joran;
15+
package ch.qos.logback.classic.blackbox.joran;
1616

1717
import ch.qos.logback.classic.LoggerContext;
18-
import ch.qos.logback.core.contention.AbstractMultiThreadedHarness;
18+
import ch.qos.logback.core.testUtil.AbstractMultiThreadedHarness;
1919
import ch.qos.logback.core.status.InfoStatus;
2020

2121
import java.util.concurrent.CountDownLatch;

0 commit comments

Comments
 (0)