Skip to content

Commit

Permalink
Merge pull request #1 from qos-ch/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
dimitrisli committed Apr 8, 2015
2 parents fd4ce79 + 58f018d commit 27e3eea
Show file tree
Hide file tree
Showing 245 changed files with 15,669 additions and 16,458 deletions.
3 changes: 3 additions & 0 deletions .travis.yml 100644 → 100755
@@ -1 +1,4 @@
language: java
notifications:
email:
- slf4j-dev@qos.ch
518 changes: 259 additions & 259 deletions codeStyle.xml

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions integration/pom.xml
@@ -1,17 +1,15 @@
<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/xsd/maven-4.0.0.xsd">
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
<version>1.7.11-SNAPSHOT</version>
<version>1.7.13-SNAPSHOT</version>
</parent>


<artifactId>integration</artifactId>
<packaging>jar</packaging>
<name>SLF4J Integration tests</name>
Expand All @@ -38,7 +36,6 @@
<version>1.6.5</version>
</dependency>


<!-- some test run Felix in hosted mode -->
<dependency>
<groupId>org.apache.felix</groupId>
Expand Down
2 changes: 1 addition & 1 deletion integration/src/IBUNDLE-META-INF/MANIFEST.MF
Expand Up @@ -10,6 +10,6 @@ Implementation-Title: iBundle
Bundle-ManifestVersion: 2
Bundle-SymbolicName: iBundle
Bundle-Name: abundle
Bundle-RequiredExecutionEnvironment: J2SE-1.3
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: apack
Import-Package: org.osgi.framework, org.slf4j;version=1.5
32 changes: 16 additions & 16 deletions integration/src/test/java/integrator/Activator.java
Expand Up @@ -37,24 +37,24 @@
*/
public class Activator implements BundleActivator {

private BundleContext m_context = null;
private BundleContext m_context = null;

public void start(BundleContext context) {
Logger logger = LoggerFactory.getLogger(this.getClass());
logger.info("Activator.start()");
m_context = context;
}
public void start(BundleContext context) {
Logger logger = LoggerFactory.getLogger(this.getClass());
logger.info("Activator.start()");
m_context = context;
}

public void stop(BundleContext context) {
m_context = null;
Logger logger = LoggerFactory.getLogger(this.getClass());
logger.info("Activator.stop");
}
public void stop(BundleContext context) {
m_context = null;
Logger logger = LoggerFactory.getLogger(this.getClass());
logger.info("Activator.stop");
}

public Bundle[] getBundles() {
if (m_context != null) {
return m_context.getBundles();
public Bundle[] getBundles() {
if (m_context != null) {
return m_context.getBundles();
}
return null;
}
return null;
}
}
53 changes: 26 additions & 27 deletions integration/src/test/java/org/slf4j/CompatibilityAssertionTest.java
Expand Up @@ -32,31 +32,30 @@

public class CompatibilityAssertionTest extends TestCase {

StringPrintStream sps = new StringPrintStream(System.err);
PrintStream old = System.err;
int diff = 1024 + new Random().nextInt(10000);

public CompatibilityAssertionTest(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));
}
StringPrintStream sps = new StringPrintStream(System.err);
PrintStream old = System.err;
int diff = 1024 + new Random().nextInt(10000);

public CompatibilityAssertionTest(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));
}
}
Expand Up @@ -32,44 +32,43 @@

public class IncompatibleMultiBindingAssertionTest extends TestCase {

StringPrintStream sps = new StringPrintStream(System.err);
PrintStream old = System.err;
int diff = 1024 + new Random().nextInt(10000);
StringPrintStream sps = new StringPrintStream(System.err);
PrintStream old = System.err;
int diff = 1024 + new Random().nextInt(10000);

public IncompatibleMultiBindingAssertionTest(String name) {
super(name);
}

protected void setUp() throws Exception {
super.setUp();
System.setErr(sps);
}
public IncompatibleMultiBindingAssertionTest(String name) {
super(name);
}

protected void tearDown() throws Exception {
super.tearDown();
System.setErr(old);
}
protected void setUp() throws Exception {
super.setUp();
System.setErr(sps);
}

public void test() throws Exception {
try {
Logger logger = LoggerFactory.getLogger(this.getClass());
String msg = "hello world " + diff;
logger.info(msg);
fail("was expecting NoSuchMethodError");
} catch (NoSuchMethodError e) {
protected void tearDown() throws Exception {
super.tearDown();
System.setErr(old);
}
List<String> list = sps.stringList;
assertMsgContains(list, 0, "Class path contains multiple SLF4J bindings.");
assertMsgContains(list, 1, "Found binding in");
assertMsgContains(list, 2, "Found binding in");
assertMsgContains(list, 3, "See http://www.slf4j.org/codes.html");
assertMsgContains(list, 4,
"slf4j-api 1.6.x (or later) is incompatible with this binding");
assertMsgContains(list, 5, "Your binding is version 1.5.5 or earlier.");

}
public void test() throws Exception {
try {
Logger logger = LoggerFactory.getLogger(this.getClass());
String msg = "hello world " + diff;
logger.info(msg);
fail("was expecting NoSuchMethodError");
} catch (NoSuchMethodError e) {
}
List<String> list = sps.stringList;
assertMsgContains(list, 0, "Class path contains multiple SLF4J bindings.");
assertMsgContains(list, 1, "Found binding in");
assertMsgContains(list, 2, "Found binding in");
assertMsgContains(list, 3, "See http://www.slf4j.org/codes.html");
assertMsgContains(list, 4, "slf4j-api 1.6.x (or later) is incompatible with this binding");
assertMsgContains(list, 5, "Your binding is version 1.5.5 or earlier.");

void assertMsgContains(List<String> strList, int index, String msg) {
assertTrue(((String) strList.get(index)).contains(msg));
}
}

void assertMsgContains(List<String> strList, int index, String msg) {
assertTrue(((String) strList.get(index)).contains(msg));
}
}
Expand Up @@ -31,57 +31,53 @@

public class MissingSingletonMethodAssertionTest extends TestCase {

StringPrintStream sps = new StringPrintStream(System.err);
PrintStream old = System.err;
int diff = 1024 + new Random().nextInt(10000);
StringPrintStream sps = new StringPrintStream(System.err);
PrintStream old = System.err;
int diff = 1024 + new Random().nextInt(10000);

public MissingSingletonMethodAssertionTest(String name) {
super(name);
}

protected void setUp() throws Exception {
super.setUp();
System.setErr(sps);
}
public MissingSingletonMethodAssertionTest(String name) {
super(name);
}

protected void tearDown() throws Exception {
super.tearDown();
System.setErr(old);
}
protected void setUp() throws Exception {
super.setUp();
System.setErr(sps);
}

public void test() throws Exception {
try {
Logger logger = LoggerFactory.getLogger(this.getClass());
String msg = "hello world " + diff;
logger.info(msg);
fail("NoSuchMethodError expected");
} catch (NoSuchMethodError e) {
protected void tearDown() throws Exception {
super.tearDown();
System.setErr(old);
}

int lineCount = sps.stringList
.size();
assertTrue("number of lines should be 3 but was "+lineCount, lineCount == 3);


// expected output:
// SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding.
// SLF4J: Your binding is version 1.4.x or earlier.
// SLF4J: Upgrade your binding to version 1.6.x. or 2.0.x
public void test() throws Exception {
try {
Logger logger = LoggerFactory.getLogger(this.getClass());
String msg = "hello world " + diff;
logger.info(msg);
fail("NoSuchMethodError expected");
} catch (NoSuchMethodError e) {
}

{
String s = (String) sps.stringList.get(0);
assertTrue(s
.contains("SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding."));
}
{
String s = (String) sps.stringList.get(1);
assertTrue(s.contains("SLF4J: Your binding is version 1.5.5 or earlier."));
}
{
String s = (String) sps.stringList.get(2);
assertTrue(s
.contains("SLF4J: Upgrade your binding to version 1.6.x."));
}
int lineCount = sps.stringList.size();
assertTrue("number of lines should be 3 but was " + lineCount, lineCount == 3);

// expected output:
// SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding.
// SLF4J: Your binding is version 1.4.x or earlier.
// SLF4J: Upgrade your binding to version 1.6.x. or 2.0.x

}
{
String s = (String) sps.stringList.get(0);
assertTrue(s.contains("SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding."));
}
{
String s = (String) sps.stringList.get(1);
assertTrue(s.contains("SLF4J: Your binding is version 1.5.5 or earlier."));
}
{
String s = (String) sps.stringList.get(2);
assertTrue(s.contains("SLF4J: Upgrade your binding to version 1.6.x."));
}

}
}
56 changes: 28 additions & 28 deletions integration/src/test/java/org/slf4j/MultiBindingAssertionTest.java
Expand Up @@ -32,37 +32,37 @@

public class MultiBindingAssertionTest extends TestCase {

StringPrintStream sps = new StringPrintStream(System.err);
PrintStream old = System.err;
int diff = 1024 + new Random().nextInt(10000);
StringPrintStream sps = new StringPrintStream(System.err);
PrintStream old = System.err;
int diff = 1024 + new Random().nextInt(10000);

public MultiBindingAssertionTest(String name) {
super(name);
}
public MultiBindingAssertionTest(String name) {
super(name);
}

protected void setUp() throws Exception {
super.setUp();
System.setErr(sps);
}
protected void setUp() throws Exception {
super.setUp();
System.setErr(sps);
}

protected void tearDown() throws Exception {
super.tearDown();
System.setErr(old);
}
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);
List<String> list = sps.stringList;
assertMsgContains(list, 0, "Class path contains multiple SLF4J bindings.");
assertMsgContains(list, 1, "Found binding in");
assertMsgContains(list, 2, "Found binding in");
assertMsgContains(list, 3, "See http://www.slf4j.org/codes.html");
assertMsgContains(list, 4, "Actual binding is of type [");
}
public void test() throws Exception {
Logger logger = LoggerFactory.getLogger(this.getClass());
String msg = "hello world " + diff;
logger.info(msg);
List<String> list = sps.stringList;
assertMsgContains(list, 0, "Class path contains multiple SLF4J bindings.");
assertMsgContains(list, 1, "Found binding in");
assertMsgContains(list, 2, "Found binding in");
assertMsgContains(list, 3, "See http://www.slf4j.org/codes.html");
assertMsgContains(list, 4, "Actual binding is of type [");
}

void assertMsgContains(List<String> strList, int index, String msg) {
assertTrue(((String) strList.get(index)).contains(msg));
}
void assertMsgContains(List<String> strList, int index, String msg) {
assertTrue(((String) strList.get(index)).contains(msg));
}
}

0 comments on commit 27e3eea

Please sign in to comment.