diff --git a/integration/build.xml b/integration/build.xml index 7b675cd5..a73f9bfd 100644 --- a/integration/build.xml +++ b/integration/build.xml @@ -35,6 +35,15 @@ + + + + + + + + + @@ -47,7 +56,8 @@ + testMatch, + testMultiBinding"> @@ -74,4 +84,11 @@ + + + + + + + \ No newline at end of file diff --git a/integration/lib/slf4j-nop-1.5.6.jar b/integration/lib/slf4j-nop-1.5.6.jar new file mode 100644 index 00000000..a9a2cc0b Binary files /dev/null and b/integration/lib/slf4j-nop-1.5.6.jar differ diff --git a/integration/src/test/java/org/slf4j/MultiBindingTest.java b/integration/src/test/java/org/slf4j/MultiBindingTest.java new file mode 100644 index 00000000..f17bd257 --- /dev/null +++ b/integration/src/test/java/org/slf4j/MultiBindingTest.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2004-2009 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. + */ + +package org.slf4j; + +import java.io.PrintStream; +import java.util.Random; + +import junit.framework.TestCase; + +public class MultiBindingTest extends TestCase { + + StringPrintStream sps = new StringPrintStream(System.err); + PrintStream old = System.err; + int diff = 1024 + new Random().nextInt(10000); + + public MultiBindingTest(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); + assertTrue("number of lines should be greater than 4", sps.stringList + .size() > 4); + String s0 = (String) sps.stringList.get(0); + assertTrue(s0 + .contains("SLF4J: Class path contains multiple SLF4J bindins.")); + } +} diff --git a/integration/src/test/java/org/slf4j/Pre155VersionTest.java b/integration/src/test/java/org/slf4j/Pre155VersionTest.java index 1ab1f38c..f9fd3c38 100644 --- a/integration/src/test/java/org/slf4j/Pre155VersionTest.java +++ b/integration/src/test/java/org/slf4j/Pre155VersionTest.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2004-2009 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. + */ + package org.slf4j; import java.io.PrintStream; diff --git a/integration/src/test/java/org/slf4j/VersionMatchTest.java b/integration/src/test/java/org/slf4j/VersionMatchTest.java index 5e6ff789..d86884c6 100644 --- a/integration/src/test/java/org/slf4j/VersionMatchTest.java +++ b/integration/src/test/java/org/slf4j/VersionMatchTest.java @@ -1,3 +1,4 @@ + package org.slf4j; import java.io.PrintStream;