Skip to content

Commit

Permalink
adding http scan capability, had to move tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
  • Loading branch information
ceki committed Oct 7, 2024
1 parent 67c24f6 commit a496a04
Show file tree
Hide file tree
Showing 57 changed files with 937 additions and 709 deletions.
16 changes: 16 additions & 0 deletions logback-classic-blackbox/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,24 @@
<artifactId>logback-classic</artifactId>
</dependency>

<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.eclipse.jetty.ee10</groupId>
<artifactId>jetty-ee10-servlet</artifactId>
<version>${jetty.version}</version>
</dependency>


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

<dependency>
Expand Down Expand Up @@ -66,6 +81,7 @@
</exclusion>
</exclusions>
</dependency>

</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!DOCTYPE x>


<configuration scan="true" scanPeriod="5 milliseconds">
<configuration debug="true" scan="true" scanPeriod="5 milliseconds">
<include resource="asResource/inner1.xml"/>
</configuration>

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

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

</configuration>


Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

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

<appender name="default" class="ch.qos.logback.classic.RecursivelyLoggingAppender474">
<appender name="default" class="ch.qos.logback.classic.blackbox.joran.RecursivelyLoggingAppender474">
</appender>

<logger name="Ignore" level="ERROR" additivity="false"/>
Expand All @@ -11,4 +11,4 @@
</root>

</configuration>


Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
/*
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2015, QOS.ch. All rights reserved.
* Copyright (C) 1999-2024, 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
Expand All @@ -11,10 +11,10 @@
* 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.issue.lbclassic135;
package ch.qos.logback.classic.blackbox.issue.lbclassic135;

import org.slf4j.Logger;
import ch.qos.logback.core.contention.RunnableWithCounterAndDone;
import ch.qos.logback.core.testUtil.RunnableWithCounterAndDone;

public class LoggingRunnable extends RunnableWithCounterAndDone {

Expand Down
38 changes: 19 additions & 19 deletions ...lbclassic135/LoggingToFileThroughput.java → ...lbclassic135/LoggingToFileThroughput.java
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
/*
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2015, QOS.ch. All rights reserved.
* Copyright (C) 1999-2024, 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
Expand All @@ -11,15 +11,15 @@
* 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.issue.lbclassic135;
package ch.qos.logback.classic.blackbox.issue.lbclassic135;

import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.encoder.PatternLayoutEncoder;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.FileAppender;
import ch.qos.logback.core.contention.RunnableWithCounterAndDone;
import ch.qos.logback.core.contention.ThreadedThroughputCalculator;
import ch.qos.logback.core.testUtil.RunnableWithCounterAndDone;
//import ch.qos.logback.core.contention.ThreadedThroughputCalculator;

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

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

ThreadedThroughputCalculator tp = new ThreadedThroughputCalculator(OVERALL_DURATION_IN_MILLIS);
tp.printEnvironmentInfo("lbclassic135 LoggingToFileThrouhput");

LoggerContext lc = new LoggerContext();
Logger logger = buildLoggerContext(lc);

for (int i = 0; i < 2; i++) {
tp.execute(buildArray(logger));
}

RunnableWithCounterAndDone[] runnnableArray = buildArray(logger);
tp.execute(runnnableArray);
tp.printThroughput(runnnableArray, "File: ");
lc.stop();
// ThreadedThroughputCalculator tp = new ThreadedThroughputCalculator(OVERALL_DURATION_IN_MILLIS);
// tp.printEnvironmentInfo("lbclassic135 LoggingToFileThrouhput");
//
// LoggerContext lc = new LoggerContext();
// Logger logger = buildLoggerContext(lc);
//
// for (int i = 0; i < 2; i++) {
// tp.execute(buildArray(logger));
// }
//
// RunnableWithCounterAndDone[] runnnableArray = buildArray(logger);
// tp.execute(runnnableArray);
// tp.printThroughput(runnnableArray, "File: ");
// lc.stop();
}

static Logger buildLoggerContext(LoggerContext lc) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
* Copyright (C) 1999-2024, 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
Expand All @@ -12,8 +12,9 @@
* as published by the Free Software Foundation.
*/

package ch.qos.logback.classic.joran;
package ch.qos.logback.classic.blackbox.joran;

import ch.qos.logback.classic.joran.ReconfigureOnChangeTask;
import ch.qos.logback.core.spi.ConfigurationEvent;
import ch.qos.logback.core.spi.ConfigurationEventListener;

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

countDownLatch.countDown();
Object data = configurationEvent.getData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* as published by the Free Software Foundation.
*/

package ch.qos.logback.classic.joran;
package ch.qos.logback.classic.blackbox.joran;

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

countDownLatch.countDown();
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
* Copyright (C) 1999-2024, 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
Expand All @@ -12,8 +12,9 @@
* as published by the Free Software Foundation.
*/

package ch.qos.logback.classic.joran;
package ch.qos.logback.classic.blackbox.joran;

import ch.qos.logback.classic.joran.ReconfigureOnChangeTask;
import ch.qos.logback.core.spi.ConfigurationEvent;
import ch.qos.logback.core.spi.ConfigurationEventListener;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
* Copyright (C) 1999-2024, 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
Expand All @@ -12,8 +12,9 @@
* as published by the Free Software Foundation.
*/

package ch.qos.logback.classic.joran;
package ch.qos.logback.classic.blackbox.joran;

import ch.qos.logback.classic.joran.ReconfigureOnChangeTask;
import ch.qos.logback.core.spi.ConfigurationEvent;
import ch.qos.logback.core.spi.ConfigurationEventListener;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2022, QOS.ch. All rights reserved.
* Copyright (C) 1999-2024, 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
Expand All @@ -12,10 +12,10 @@
* as published by the Free Software Foundation.
*/

package ch.qos.logback.classic.joran;
package ch.qos.logback.classic.blackbox.joran;

import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.core.contention.AbstractMultiThreadedHarness;
import ch.qos.logback.core.testUtil.AbstractMultiThreadedHarness;
import ch.qos.logback.core.status.InfoStatus;

import java.util.concurrent.CountDownLatch;
Expand Down
Loading

0 comments on commit a496a04

Please sign in to comment.