[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.27-5-g0ee73e6
added by portage for gitosis-gentoo
git-noreply at pixie.qos.ch
Thu Dec 30 15:42:16 CET 2010
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".
The branch, master has been updated
via 0ee73e69b47e35deeaa9dc02d8f003d12a2f2e72 (commit)
from d66cfee00547c4ca2b309dcae5f8e905f6f0a00d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=0ee73e69b47e35deeaa9dc02d8f003d12a2f2e72
http://github.com/ceki/logback/commit/0ee73e69b47e35deeaa9dc02d8f003d12a2f2e72
commit 0ee73e69b47e35deeaa9dc02d8f003d12a2f2e72
Author: Ceki Gulcu <ceki at qos.ch>
Date: Thu Dec 30 15:36:08 2010 +0100
temporarily abandoning attempt to parellize tests in logback-classic
diff --git a/logback-classic/pom.xml b/logback-classic/pom.xml
index b939132..b61e6d6 100644
--- a/logback-classic/pom.xml
+++ b/logback-classic/pom.xml
@@ -221,6 +221,24 @@
</plugin>
<plugin>
+ <groupId>org.scala-tools</groupId>
+ <artifactId>maven-scala-plugin</artifactId>
+ <version>2.14.3</version>
+ <configuration>
+ <testSourceDir>src/test/scala</testSourceDir>
+ </configuration>
+ <executions>
+ <execution>
+ <id>scala-test-compile</id>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
@@ -300,7 +318,6 @@
<configuration>
<!-- once, never, -->
<forkMode>once</forkMode>
- <parallel>classes</parallel>
<reportFormat>plain</reportFormat>
<trimStackTrace>false</trimStackTrace>
<excludes>
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/net/SimpleSocketServer.java b/logback-classic/src/main/java/ch/qos/logback/classic/net/SimpleSocketServer.java
index eb2ba4f..2679c2f 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/net/SimpleSocketServer.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/net/SimpleSocketServer.java
@@ -53,7 +53,7 @@ public class SimpleSocketServer extends Thread {
private boolean closed = false;
private ServerSocket serverSocket;
private List<SocketNode> socketNodeList = new ArrayList<SocketNode>();
-
+
public static void main(String argv[]) throws Exception {
int port = -1;
if (argv.length == 2) {
@@ -81,6 +81,7 @@ public class SimpleSocketServer extends Thread {
serverSocket = new ServerSocket(port);
while (!closed) {
logger.info("Waiting to accept a new client.");
+ signalAlmostReadiness();
Socket socket = serverSocket.accept();
logger.info("Connected to client at " + socket.getInetAddress());
logger.info("Starting new socket node.");
@@ -89,7 +90,6 @@ public class SimpleSocketServer extends Thread {
socketNodeList.add(newSocketNode);
}
new Thread(newSocketNode).start();
- signalSocketNodeCreation();
}
} catch (Exception e) {
if(closed) {
@@ -104,7 +104,7 @@ public class SimpleSocketServer extends Thread {
* Signal another thread that we have established a conneciton
* This is useful for testing purposes.
*/
- void signalSocketNodeCreation() {
+ void signalAlmostReadiness() {
synchronized(this) {
this.notifyAll();
}
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/net/SocketNode.java b/logback-classic/src/main/java/ch/qos/logback/classic/net/SocketNode.java
index 96f389e..f5a6f36 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/net/SocketNode.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/net/SocketNode.java
@@ -48,7 +48,7 @@ public class SocketNode implements Runnable {
ObjectInputStream ois;
SocketAddress remoteSocketAddress;
- static Logger logger = (Logger) LoggerFactory.getLogger(SocketNode.class);
+ Logger logger;
boolean closed = false;
SimpleSocketServer socketServer;
@@ -57,6 +57,8 @@ public class SocketNode implements Runnable {
this.socket = socket;
remoteSocketAddress = socket.getRemoteSocketAddress();
this.context = context;
+ logger = context.getLogger(SocketNode.class);
+
try {
ois = new ObjectInputStream(new BufferedInputStream(socket
.getInputStream()));
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/LoggerPerfTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/LoggerPerfTest.java
index c6723de..b050772 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/LoggerPerfTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/LoggerPerfTest.java
@@ -44,7 +44,7 @@ public class LoggerPerfTest {
@Test
public void durationOfDisabledLogsWith_1_NOPFilter() {
double avg = computeDurationOfDisabledLogsWith_1_NOPFilter(1,
- NORMAL_RUN_LENGTH);
+ NORMAL_RUN_LENGTH);
System.out.println("durationOfDisabledLogsWith_1_NOPFilter=" + avg);
long referencePerf = 60;
@@ -52,7 +52,7 @@ public class LoggerPerfTest {
}
double computeDurationOfDisabledLogsWith_1_NOPFilter(int numOfFilters,
- long len) {
+ long len) {
for (int i = 0; i < numOfFilters; i++) {
lc.addTurboFilter(new NOPTurboFilter());
}
@@ -81,6 +81,9 @@ public class LoggerPerfTest {
lbLogger.setLevel(Level.OFF);
for (long i = 0; i < len; i++)
logger.isDebugEnabled();
+ Thread.yield();
+ for (long i = 0; i < len; i++)
+ logger.isDebugEnabled();
long start = System.nanoTime();
for (long i = 0; i < len; i++)
@@ -102,6 +105,10 @@ public class LoggerPerfTest {
lbLogger.setLevel(Level.OFF);
for (long i = 0; i < len; i++)
logger.debug("Toto");
+ Thread.yield();
+ for (long i = 0; i < len; i++)
+ logger.debug("Toto");
+ Thread.yield();
long start = System.nanoTime();
for (long i = 0; i < len; i++)
@@ -118,7 +125,7 @@ public class LoggerPerfTest {
long referencePerf = 30;
BogoPerf.assertDuration(avgDuration, referencePerf,
- CoreConstants.REFERENCE_BIPS);
+ CoreConstants.REFERENCE_BIPS);
}
double computeDurationOfDisabledLog_1_Parameter(long len) {
@@ -148,7 +155,7 @@ public class LoggerPerfTest {
long referencePerf = 800;
BogoPerf.assertDuration(avgDuration, referencePerf,
- CoreConstants.REFERENCE_BIPS);
+ CoreConstants.REFERENCE_BIPS);
}
double computeDurationOfEnabledLog(long len) {
@@ -201,14 +208,14 @@ public class LoggerPerfTest {
double tolerance = threadCount * .125; // Very little thread contention
// should occur in this test.
double max = ((((double) NANOS_PER_CALL) / NANOS_IN_ONE_SEC) * iterCount)
- * tolerance;
+ * tolerance;
double serialized = (((double) NANOS_PER_CALL) / NANOS_IN_ONE_SEC)
- * iterCount * threadCount;
+ * iterCount * threadCount;
double actual = ((double) (end - start)) / NANOS_IN_ONE_SEC;
System.out
- .printf(
- "Sleep duration: %,.4f seconds. Max expected: %,.4f seconds, Serialized: %,.4f\n",
- actual, max, serialized);
+ .printf(
+ "Sleep duration: %,.4f seconds. Max expected: %,.4f seconds, Serialized: %,.4f\n",
+ actual, max, serialized);
assertTrue("Exceeded maximum expected time.", actual < max);
}
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/LoggerSerializationTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/LoggerSerializationTest.java
index f4a6d32..f6bdfba 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/LoggerSerializationTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/LoggerSerializationTest.java
@@ -22,9 +22,12 @@ import java.io.ObjectOutputStream;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.slf4j.LoggerFactory;
public class LoggerSerializationTest {
+ // force SLF4J initialization for subsequent Logger readResolce ooperaiton
+ org.slf4j.Logger unused = LoggerFactory.getLogger(this.getClass());
LoggerContext lc;
Logger logger;
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/html/HTMLLayoutTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/html/HTMLLayoutTest.java
index d3706ac..0002f04 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/html/HTMLLayoutTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/html/HTMLLayoutTest.java
@@ -158,6 +158,7 @@ public class HTMLLayoutTest {
{
Element tdElement = (Element) trElement.elements().get(1);
String regex = ClassicTestConstants.NAKED_MAIN_REGEX;
+ System.out.println(tdElement.getText());
assertTrue(tdElement.getText().matches(regex));
}
{
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/net/SocketAppenderTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/net/SocketAppenderTest.java
index b5b6935..96059a1 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/net/SocketAppenderTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/net/SocketAppenderTest.java
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertTrue;
import java.util.Map;
import ch.qos.logback.core.testUtil.RandomUtil;
+import org.junit.Before;
import org.junit.Test;
import org.slf4j.MDC;
import org.slf4j.Marker;
@@ -40,8 +41,9 @@ public class SocketAppenderTest {
static final int JOIN_OR_WAIT_TIMEOUT = 200;
static final int SLEEP_AFTER_LOG = 100;
- int port = 4561;
int diff = RandomUtil.getPositiveInt();
+
+ int port = 1024+(diff%30000);
String mdcKey = "key"+diff;
LoggerContext lc = new LoggerContext();
@@ -51,17 +53,22 @@ public class SocketAppenderTest {
private boolean includeCallerData = false;
private SimpleSocketServer simpleSocketServer;
+ @Before
+ public void setUp() {
+ System.out.println("SocketAppenderTest, start at "+System.currentTimeMillis()+", port="+port);
+ }
+
@Test
public void startFailNoRemoteHost() {
SocketAppender appender = new SocketAppender();
appender.setContext(lc);
- appender.setPort(123);
+ appender.setPort(port);
appender.start();
assertEquals(1, lc.getStatusManager().getCount());
}
@Test
- public void recieveMessage() throws InterruptedException {
+ public void receiveMessage() throws InterruptedException {
fireServer();
waitForServerToStart();
configureClient();
@@ -83,7 +90,7 @@ public class SocketAppenderTest {
}
@Test
- public void recieveWithContext() throws InterruptedException {
+ public void receiveWithContext() throws InterruptedException {
fireServer();
waitForServerToStart();
configureClient();
@@ -118,10 +125,10 @@ public class SocketAppenderTest {
waitForServerToStart();
configureClient();
- Logger logger = lc.getLogger(Logger.ROOT_LOGGER_NAME);
+ Logger root = lc.getLogger(Logger.ROOT_LOGGER_NAME);
MDC.put(mdcKey, "testValue");
- logger.debug("test msg");
+ root.debug("test msg");
Thread.sleep(SLEEP_AFTER_LOG);
simpleSocketServer.close();
@@ -188,13 +195,13 @@ public class SocketAppenderTest {
configureClient();
- Logger logger = lc.getLogger(Logger.ROOT_LOGGER_NAME);
+ Logger root = lc.getLogger(Logger.ROOT_LOGGER_NAME);
MDC.put(mdcKey, "testValue");
- logger.debug("test msg");
+ root.debug("test msg");
MDC.put(mdcKey, "updatedTestValue");
- logger.debug("test msg 2");
+ root.debug("test msg 2");
Thread.sleep(SLEEP_AFTER_LOG);
simpleSocketServer.close();
@@ -245,6 +252,9 @@ public class SocketAppenderTest {
private void fireServer() throws InterruptedException {
Logger root = serverLC.getLogger("root");
+ Logger socketNodeLogger = serverLC.getLogger(SocketNode.class);
+ socketNodeLogger.setLevel(Level.WARN);
+
la.setName(LIST_APPENDER_NAME);
la.setContext(serverLC);
la.start();
@@ -252,6 +262,7 @@ public class SocketAppenderTest {
simpleSocketServer = new SimpleSocketServer(serverLC, port);
simpleSocketServer.start();
Thread.yield();
+ Thread.sleep(50);
}
ListAppender<ILoggingEvent> getListAppender() {
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/spi/BogusClassLoader.java b/logback-classic/src/test/java/ch/qos/logback/classic/spi/BogusClassLoader.java
index 361a80b..a96093d 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/spi/BogusClassLoader.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/spi/BogusClassLoader.java
@@ -20,7 +20,7 @@ import java.net.URLClassLoader;
* A trivial class loader which throws a NoClassDefFoundError if the requested
* class name contains the string "Bogus".
*
- * @author Ceki Gülcü
+ * @author Ceki Gulcu
*/
public class BogusClassLoader extends URLClassLoader {
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/spi/LocalFirstClassLoader.java b/logback-classic/src/test/java/ch/qos/logback/classic/spi/LocalFirstClassLoader.java
index 9a06d42..83e3ebf 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/spi/LocalFirstClassLoader.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/spi/LocalFirstClassLoader.java
@@ -20,7 +20,7 @@ import java.net.URLClassLoader;
* An almost trivial no fuss implementation of a class loader following the
* child-first delegation model.
*
- * @author Ceki Gülcü
+ * @author Ceki Gulcu
*/
public class LocalFirstClassLoader extends URLClassLoader {
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/spi/LoggingEventSerializationPerfTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/spi/LoggingEventSerializationPerfTest.java
index 465dec6..637e5b3 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/spi/LoggingEventSerializationPerfTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/spi/LoggingEventSerializationPerfTest.java
@@ -95,7 +95,7 @@ public class LoggingEventSerializationPerfTest {
}
double rt = doLoop(builder, LOOP_LEN);
System.out
- .println("avetage time per logging event " + rt + " nanoseconds");
+ .println("average time per logging event " + rt + " nanoseconds");
long averageSize = (long) (noos.size() / (LOOP_LEN));
System.out.println("noos size " + noos.size() + " average size="
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java
index f080e50..17331fd 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java
@@ -60,7 +60,7 @@ public class ReconfigureOnChangeTest {
// it actually takes time for Windows to propagate file modification changes
// values below 100 milliseconds can be problematic the same propagation
// latency occurs in Linux but is even larger (>600 ms)
- final static int DEFAULT_SLEEP_BETWEEN_UPDATES = 110;
+ final static int DEFAULT_SLEEP_BETWEEN_UPDATES = 210;
int sleepBetweenUpdates = DEFAULT_SLEEP_BETWEEN_UPDATES;
@@ -72,7 +72,7 @@ public class ReconfigureOnChangeTest {
@Before
public void setUp() {
- System.out.println("======== TEST START");
+ System.out.println("======== TEST START, time"+System.currentTimeMillis());
// take into account propagation latency occurs on Linux or Mac
if (Env.isLinux() || Env.isMac()) {
sleepBetweenUpdates = 950;
@@ -129,8 +129,8 @@ public class ReconfigureOnChangeTest {
loggerContext.getStatusManager().add(
new InfoStatus("end of execution ", this));
- long expectedRreconfigurations = runnableArray[0].getCounter();
- verify(expectedRreconfigurations);
+ long expectedReconfigurations = runnableArray[0].getCounter();
+ verify(expectedReconfigurations);
}
@Test
@@ -170,7 +170,7 @@ public class ReconfigureOnChangeTest {
int effectiveResets = checker
.matchCount("Resetting and reconfiguring context");
// the number of effective resets must be equal or less than
- // expectedRreconfigurations
+ // expectedReconfigurations
assertTrue(effectiveResets <= expectedReconfigurations);
// however, there should be some effective resets
String failMsg = "effective=" + effectiveResets + ", expected="
diff --git a/logback-core/pom.xml b/logback-core/pom.xml
index 05eb067..9297f98 100644
--- a/logback-core/pom.xml
+++ b/logback-core/pom.xml
@@ -140,7 +140,8 @@
<excludes>
<exclude>**/All*Test.java</exclude>
<exclude>**/PackageTest.java</exclude>
- <exclude>**/ConsoleAppenderTest.java</exclude>
+ <exclude>**/ConsoleAppenderTest.java</exclude>
+ <exclude>**/TimeBasedRollingTest.java</exclude>
</excludes>
</configuration>
</plugin>
diff --git a/logback-core/src/test/java/ch/qos/logback/core/rolling/PackageTest.java b/logback-core/src/test/java/ch/qos/logback/core/rolling/PackageTest.java
index c9d64df..684b16a 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/rolling/PackageTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/rolling/PackageTest.java
@@ -18,7 +18,7 @@ import org.junit.runners.Suite;
@RunWith(Suite.class)
@Suite.SuiteClasses( { RenameUtilTest.class, SizeBasedRollingTest.class,
- TimeBasedRollingTest.class, TimeBasedRollingWithArchiveRemovalTest.class,
+ TimeBasedRolling2Test.class, TimeBasedRollingWithArchiveRemovalTest.class,
MultiThreadedRollingTest.class,
SizeAndTimeBasedFNATP_Test.class,
RollingFileAppenderTest.class,
diff --git a/logback-core/src/test/java/ch/qos/logback/core/rolling/RenameUtilTest.java b/logback-core/src/test/java/ch/qos/logback/core/rolling/RenameUtilTest.java
index 282974c..899a429 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/rolling/RenameUtilTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/rolling/RenameUtilTest.java
@@ -90,8 +90,8 @@ public class RenameUtilTest {
filenames[0] = randomOutputDirAsStr + "test-" + sdf.format(currentTime);
- // set currentTime to next second plus 50 millis
- currentTime += 1000 - (currentTime % 1000) + 50;
+ // set currentTime to next second plus 250 millis
+ currentTime += 1000 - (currentTime % 1000) + 250;
tbnatp.setCurrentTime(currentTime);
rfa.doAppend("Hello 1");
-----------------------------------------------------------------------
Summary of changes:
logback-classic/pom.xml | 19 ++++++++++++-
.../logback/classic/net/SimpleSocketServer.java | 6 ++--
.../ch/qos/logback/classic/net/SocketNode.java | 4 ++-
.../ch/qos/logback/classic/LoggerPerfTest.java | 25 +++++++++++------
.../logback/classic/LoggerSerializationTest.java | 3 ++
.../qos/logback/classic/html/HTMLLayoutTest.java | 1 +
.../logback/classic/net/SocketAppenderTest.java | 29 +++++++++++++------
.../qos/logback/classic/spi/BogusClassLoader.java | 2 +-
.../logback/classic/spi/LocalFirstClassLoader.java | 2 +-
.../spi/LoggingEventSerializationPerfTest.java | 2 +-
.../classic/turbo/ReconfigureOnChangeTest.java | 10 +++---
logback-core/pom.xml | 3 +-
.../ch/qos/logback/core/rolling/PackageTest.java | 2 +-
.../qos/logback/core/rolling/RenameUtilTest.java | 4 +-
14 files changed, 77 insertions(+), 35 deletions(-)
hooks/post-receive
--
Logback: the generic, reliable, fast and flexible logging framework.
More information about the logback-dev
mailing list