forked from qos-ch/slf4j
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
298 changed files
with
29,301 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Copyright (c) 2004-2008 QOS.ch | ||
All rights reserved. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
if ($#ARGV < 1) { | ||
print "Usage: binderVersion.pl VER FILE {FILE, FILE}\n"; | ||
exit; | ||
} | ||
|
||
$V= $ARGV[0]; | ||
# Trim -SNAPSHOT | ||
$V =~ s/-SNAPSHOT//; | ||
|
||
print "VER:${V}\r\n"; | ||
shift(@ARGV); | ||
|
||
sub replace () { | ||
my $filename = $_[0]; | ||
|
||
if(-s $filename) { | ||
print "Processing [" . $filename . "]\r\n"; | ||
|
||
my $original = "$filename.original"; | ||
|
||
rename($filename, $original); | ||
open(OUT, ">$filename"); | ||
open(IN, "$original"); | ||
|
||
while(<IN>) { | ||
if(/VERSION\s+=\s+".*";/) { | ||
s/VERSION\s+=\s+".*";/VERSION = "${V}";/; | ||
} | ||
print OUT; | ||
} | ||
close(IN); | ||
close(OUT); | ||
unlink($original); | ||
} else { | ||
print "File [" . $filename . "] does not exist\r\n" | ||
} | ||
} | ||
|
||
foreach $ARG (@ARGV) { | ||
do replace($ARG); | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
VER=$1 | ||
echo "Will use version '${VER}'" | ||
echo "Changing pom.xml files" | ||
find . -name "pom.xml" |xargs perl version.pl ${VER} | ||
echo "Changing Java files" | ||
find . -name "StaticLoggerBinder.java" |xargs perl binderVersion.pl ${VER} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<project name="integration" default="testAll" basedir="."> | ||
|
||
<!-- | ||
This build file is usually run indirectly via Maven. | ||
When running this build file through Ant directly, you must | ||
define the currentVersion property on the command line, e.g.: | ||
ant -DcurrentVersion=1.5.4-SNAPSHOT | ||
--> | ||
|
||
<echo message="compile classpath: ${compile_classpath}" /> | ||
<echo message="runtime classpath: ${runtime_classpath}" /> | ||
<echo message="test classpath: ${test_classpath}" /> | ||
<echo message="plugin classpath: ${plugin_classpath}" /> | ||
|
||
<path id="path150"> | ||
<pathelement location="xtarget/classes/" /> | ||
<pathelement location="target/test-classes/" /> | ||
<pathelement location="../slf4j-api/target/slf4j-api-${currentVersion}.jar" /> | ||
<pathelement location="./lib/slf4j-simple-1.5.0.jar" /> | ||
</path > | ||
|
||
<path id="pathIncompatible"> | ||
<pathelement location="xtarget/classes/" /> | ||
<pathelement location="target/test-classes/" /> | ||
<pathelement location="../slf4j-api/target/slf4j-api-${currentVersion}.jar" /> | ||
<pathelement location="./lib/slf4j-simple-INCOMPATIBLE.jar" /> | ||
</path > | ||
|
||
<path id="pathCurrent"> | ||
<pathelement location="xtarget/classes/" /> | ||
<pathelement location="target/test-classes/" /> | ||
<pathelement location="../slf4j-api/target/slf4j-api-${currentVersion}.jar" /> | ||
<pathelement location="../slf4j-simple/target/slf4j-simple-${currentVersion}.jar" /> | ||
</path > | ||
|
||
<!-- this is really very ugly, but it's the only way to circumvent | ||
http://jira.codehaus.org/browse/MANTRUN-95 | ||
--> | ||
<taskdef name="junit" classpath="${plugin_classpath};${compile_classpath}" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" /> | ||
|
||
<target name="init"> | ||
<mkdir dir="target/unit-reports" /> | ||
</target> | ||
|
||
<target name="testAll" depends="init, | ||
testMismatch, | ||
testPre155, | ||
testMatch"> | ||
</target> | ||
|
||
<target name="testMismatch"> | ||
<junit printsummary="yes" fork="no" haltonfailure="yes"> | ||
<classpath refid="pathIncompatible" /> | ||
<formatter type="plain" /> | ||
<test fork="yes" todir="target/unit-reports" name="org.slf4j.VersionMismatchTest" /> | ||
</junit> | ||
</target> | ||
|
||
<target name="testPre155"> | ||
<junit printsummary="yes" fork="no" haltonfailure="yes"> | ||
<classpath refid="path150" /> | ||
<formatter type="plain" /> | ||
<test fork="yes" todir="target/unit-reports" name="org.slf4j.Pre155VersionTest" /> | ||
</junit> | ||
</target> | ||
|
||
<target name="testMatch"> | ||
<junit printsummary="yes" fork="no" haltonfailure="yes"> | ||
<classpath refid="pathCurrent" /> | ||
<formatter type="plain" /> | ||
<test fork="yes" todir="target/unit-reports" name="org.slf4j.VersionMatchTest" /> | ||
</junit> | ||
</target> | ||
|
||
</project> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<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/maven-v4_0_0.xsd"> | ||
|
||
<parent> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-parent</artifactId> | ||
<version>1.5.6</version> | ||
</parent> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.slf4j</groupId> | ||
<artifactId>integration</artifactId> | ||
<packaging>jar</packaging> | ||
<name>SLF4J Integration tests</name> | ||
|
||
<url>http://www.slf4j.org</url> | ||
<description>SLF4J integration tests</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</dependency> | ||
|
||
<!-- declaration to cimcumvent http://jira.codehaus.org/browse/MANTRUN-95 --> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>3.8.1</version> | ||
</dependency> | ||
<!-- declaration to cimcumvent http://jira.codehaus.org/browse/MANTRUN-95 --> | ||
<dependency> | ||
<groupId>ant</groupId> | ||
<artifactId>ant-junit</artifactId> | ||
<version>1.6.5</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-antrun-plugin</artifactId> | ||
<version>1.2</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>3.8.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>ant</groupId> | ||
<artifactId>ant-junit</artifactId> | ||
<version>1.6.5</version> | ||
</dependency> | ||
</dependencies> | ||
<executions> | ||
<execution> | ||
<id>ant-test</id> | ||
<phase>package</phase> | ||
<configuration> | ||
<tasks> | ||
<property name="currentVersion" value="${version}" /> | ||
<property name="compile_classpath" refid="maven.compile.classpath"/> | ||
<property name="runtime_classpath" refid="maven.runtime.classpath"/> | ||
<property name="test_classpath" refid="maven.test.classpath"/> | ||
<property name="plugin_classpath" refid="maven.plugin.classpath"/> | ||
<ant antfile="${basedir}/build.xml"/> | ||
</tasks> | ||
</configuration> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<forkMode>once</forkMode> | ||
<reportFormat>plain</reportFormat> | ||
<trimStackTrace>false</trimStackTrace> | ||
<excludes> | ||
<exclude>**/*Test.java</exclude> | ||
</excludes> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
|
||
|
||
</build> | ||
|
||
</project> |
35 changes: 35 additions & 0 deletions
35
trunk/integration/src/test/java/org/slf4j/Pre155VersionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.slf4j; | ||
|
||
import java.io.PrintStream; | ||
import java.util.Random; | ||
|
||
import junit.framework.TestCase; | ||
|
||
public class Pre155VersionTest extends TestCase { | ||
|
||
StringPrintStream sps = new StringPrintStream(System.err); | ||
PrintStream old = System.err; | ||
int diff = 1024 + new Random().nextInt(10000); | ||
|
||
public Pre155VersionTest(String name) { | ||
super(name); | ||
} | ||
|
||
protected void setUp() throws Exception { | ||
super.setUp(); | ||
System.setErr(sps); | ||
} | ||
|
||
protected void tearDown() throws Exception { | ||
super.tearDown(); | ||
System.setErr(old); | ||
} | ||
|
||
public void test() throws Exception { | ||
Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
String msg = "hello world " + diff; | ||
logger.info(msg); | ||
String s0 = (String) sps.stringList.get(0); | ||
assertTrue(s0.contains(msg)); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
trunk/integration/src/test/java/org/slf4j/StringPrintStream.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.slf4j; | ||
|
||
import java.io.PrintStream; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class StringPrintStream extends PrintStream { | ||
|
||
public static final String LINE_SEP = System.getProperty("line.separator"); | ||
PrintStream other; | ||
List stringList = new ArrayList(); | ||
|
||
public StringPrintStream(PrintStream ps) { | ||
super(ps); | ||
other = ps; | ||
} | ||
|
||
public void print(String s) { | ||
other.print(s); | ||
stringList.add(s); | ||
} | ||
|
||
public void println(String s) { | ||
other.println(s); | ||
stringList.add(s); | ||
|
||
} | ||
|
||
public void println(Object o) { | ||
other.println(o); | ||
stringList.add(o); | ||
} | ||
} | ||
|
38 changes: 38 additions & 0 deletions
38
trunk/integration/src/test/java/org/slf4j/VersionMatchTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.slf4j; | ||
|
||
import java.io.PrintStream; | ||
import java.util.Random; | ||
|
||
import junit.framework.TestCase; | ||
|
||
public class VersionMatchTest extends TestCase { | ||
|
||
|
||
StringPrintStream sps = new StringPrintStream(System.err); | ||
PrintStream old = System.err; | ||
int diff = 1024 + new Random().nextInt(10000); | ||
|
||
public VersionMatchTest(String name) { | ||
super(name); | ||
} | ||
|
||
protected void setUp() throws Exception { | ||
super.setUp(); | ||
System.setErr(sps); | ||
} | ||
|
||
protected void tearDown() throws Exception { | ||
super.tearDown(); | ||
System.setErr(old); | ||
} | ||
|
||
|
||
public void test() throws Exception { | ||
Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
String msg = "hello world "+diff; | ||
logger.info(msg); | ||
assertEquals(1, sps.stringList.size()); | ||
String s0 = (String) sps.stringList.get(0); | ||
assertTrue(s0.contains(msg)); | ||
} | ||
} |
Oops, something went wrong.