Skip to content

Commit

Permalink
Merged cdk-1.4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Jan 3, 2012
2 parents 418f895 + f01e9f1 commit 2691cc4
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 47 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -63,6 +63,7 @@ Gilleain Torrance
Andreas Truszkowski
Paul Turner
Joerg Wegner
Yap Chun Wei
Stephane Werner
Egon Willighagen
Lars Willighagen
Expand Down
2 changes: 0 additions & 2 deletions src/META-INF/inchi.libdepends
@@ -1,4 +1,2 @@
vecmath*.jar
xom*.jar
jniinchi-0.7.jar
cmlxom-2.5-b1.jar
2 changes: 0 additions & 2 deletions src/META-INF/test-inchi.libdepends
@@ -1,5 +1,3 @@
vecmath*.jar
xom*.jar
jniinchi-0.7.jar
cmlxom-2.5-b1.jar
log4j*.jar
1 change: 1 addition & 0 deletions src/META-INF/test-log4j.cdkdepends
Expand Up @@ -3,3 +3,4 @@ cdk-interfaces.jar
cdk-core.jar
cdk-log4j.jar
cdk-test.jar
cdk-test-core.jar
6 changes: 5 additions & 1 deletion src/main/org/openscience/cdk/tools/SystemOutLoggingTool.java
Expand Up @@ -108,7 +108,11 @@ public void debug(Object object, Object... objects) {
StringBuilder result = new StringBuilder();
result.append(object.toString());
for (Object obj : objects) {
result.append(obj.toString());
if (obj == null) {
result.append("null");
} else {
result.append(obj.toString());
}
}
debugString(result.toString());
}
Expand Down
80 changes: 40 additions & 40 deletions src/test/org/openscience/cdk/tools/AbstractLoggingToolTest.java
Expand Up @@ -24,201 +24,201 @@
import org.openscience.cdk.CDKTestCase;

/**
* @cdk.module test-log4j
* @cdk.module test-core
*/
public abstract class AbstractLoggingToolTest extends CDKTestCase {

public abstract LoggingTool getLoggingTool();
public abstract ILoggingTool getLoggingTool();

@Test public void testLoggingTool_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
Assert.assertNotNull(logger);
}

@Test public void testDebug_Object_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.debug(this, this);
}

@Test public void testDebug_Object_int() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.debug(this, 1);
}

@Test public void testDebug_Object_double() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.debug(this, 1.0);
}

@Test public void testDebug_Object_boolean() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.debug(this, true);
}

@Test public void testDebug_Object_Object_Object_Object_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.debug(this, this, this, this, this);
}

@Test public void testDebug_Object_Object_Object_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.debug(this, this, this, this);
}

@Test public void testDebug_Object_Object_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.debug(this, this, this);
}

@Test public void testDebug_ExceptionWithNullMessage() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
Exception exc = new Exception((String)null);
logger.debug(exc);
}

@Test public void testError_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.error(this);
}

@Test public void testError_Object_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.error(this, this);
}

@Test public void testError_Object_int() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.error(this, 1);
}

@Test public void testError_Object_double() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.error(this, 1.0);
}

@Test public void testError_Object_boolean() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.error(this, true);
}

@Test public void testError_Object_Object_Object_Object_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.error(this, this, this, this, this);
}

@Test public void testError_Object_Object_Object_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.error(this, this, this, this);
}

@Test public void testError_Object_Object_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.error(this, this, this);
}

@Test public void testWarn_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.warn(this);
}

@Test public void testWarn_Object_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.warn(this, this);
}

@Test public void testWarn_Object_int() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.warn(this, 1);
}

@Test public void testWarn_Object_double() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.warn(this, 1.0);
}

@Test public void testWarn_Object_boolean() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.warn(this, true);
}

@Test public void testWarn_Object_Object_Object_Object_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.warn(this, this, this, this, this);
}

@Test public void testWarn_Object_Object_Object_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.warn(this, this, this, this);
}

@Test public void testWarn_Object_Object_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.warn(this, this, this);
}

@Test public void testInfo_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.info(this);
}

@Test public void testInfo_Object_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.info(this, this);
}

@Test public void testInfo_Object_int() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.info(this, 1);
}

@Test public void testInfo_Object_double() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.info(this, 1.0);
}

@Test public void testInfo_Object_boolean() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.info(this, true);
}

@Test public void testInfo_Object_Object_Object_Object_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.info(this, this, this, this, this);
}

@Test
public void testInfo_Object_Object_Object_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.info(this, this, this, this);
}

@Test public void testInfo_Object_Object_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.info(this, this, this);
}

@Test public void testFatal_Object() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.fatal(this);
}

@Test public void testSetStackLength_int() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.setStackLength(20);
}

@Test public void testDumpClasspath() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.dumpClasspath();
}

@Test public void testDumpSystemProperties() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.dumpSystemProperties();
}

@Test public void testIsDebugEnabled() throws Exception {
LoggingTool logger = getLoggingTool();
ILoggingTool logger = getLoggingTool();
logger.isDebugEnabled();
}

Expand Down
Expand Up @@ -24,12 +24,11 @@

import org.junit.Assert;
import org.junit.Test;
import org.openscience.cdk.CDKTestCase;

/**
* @cdk.module test-core
*/
public class SystemOutLoggingToolTest extends CDKTestCase {
public class SystemOutLoggingToolTest extends AbstractLoggingToolTest {

@Test public void testLoggingTool_Class() throws Exception {
ILoggingTool logger = new SystemOutLoggingTool(this.getClass());
Expand Down Expand Up @@ -670,5 +669,10 @@ public void testInfo_Object_Object_Object_Object() throws Exception {
ILoggingTool logger = SystemOutLoggingTool.create(this.getClass());
Assert.assertNotNull(logger);
}

@Override
public ILoggingTool getLoggingTool() {
return new SystemOutLoggingTool(this.getClass());
}
}

0 comments on commit 2691cc4

Please sign in to comment.