mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-10-06 12:21:27 +00:00
quiet excessive logging
This commit is contained in:
1 parent
92f5ca2a45
commit
d336ea760f
5 files changed
+29
-22
No files matched your search
@@ -186,8 +186,8 @@ public class ReplayCharSequenceTest extends TmpDirTestCase
|
||||
bytes, 1, "testSingleByteEncodings-latin1.txt", 0);
|
||||
ReplayCharSequence rcs = ros.getReplayCharSequence("latin1");
|
||||
String result = rcs.toString();
|
||||
logger.info("latin1[0] " + toHexString(latin1String));
|
||||
logger.info("latin1[1] " + toHexString(result));
|
||||
logger.fine("latin1[0] " + toHexString(latin1String));
|
||||
logger.fine("latin1[1] " + toHexString(result));
|
||||
assertEquals("latin1 strings don't match", result, latin1String);
|
||||
|
||||
String w1252String = new String(bytes, "windows-1252");
|
||||
@@ -195,8 +195,8 @@ public class ReplayCharSequenceTest extends TmpDirTestCase
|
||||
bytes, 1, "testSingleByteEncodings-windows-1252.txt", 0);
|
||||
rcs = ros.getReplayCharSequence("windows-1252");
|
||||
result = rcs.toString();
|
||||
logger.info("windows-1252[0] " + toHexString(w1252String));
|
||||
logger.info("windows-1252[1] " + toHexString(result));
|
||||
logger.fine("windows-1252[0] " + toHexString(w1252String));
|
||||
logger.fine("windows-1252[1] " + toHexString(result));
|
||||
assertEquals("windows-1252 strings don't match", result, w1252String);
|
||||
|
||||
String asciiString = new String(bytes, "ascii");
|
||||
@@ -204,8 +204,8 @@ public class ReplayCharSequenceTest extends TmpDirTestCase
|
||||
bytes, 1, "testSingleByteEncodings-ascii.txt", 0);
|
||||
rcs = ros.getReplayCharSequence("ascii");
|
||||
result = rcs.toString();
|
||||
logger.info("ascii[0] " + toHexString(asciiString));
|
||||
logger.info("ascii[1] " + toHexString(result));
|
||||
logger.fine("ascii[0] " + toHexString(asciiString));
|
||||
logger.fine("ascii[1] " + toHexString(result));
|
||||
assertEquals("ascii strings don't match", result, asciiString);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,10 +23,13 @@ import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class ANVLRecordTest extends TestCase {
|
||||
private final Logger logger = Logger.getLogger(this.getClass().getName());
|
||||
|
||||
public void testAdd() throws Exception {
|
||||
ANVLRecord am = new ANVLRecord();
|
||||
am.add(new Element(new Label("entry")));
|
||||
@@ -42,9 +45,9 @@ public class ANVLRecordTest extends TestCase {
|
||||
new Value("The Yeoman of \r the guard")));
|
||||
am.add(new Element(new Label("when/created"),
|
||||
new Value("1888")));
|
||||
System.out.println(am.toString());
|
||||
logger.fine(am.toString());
|
||||
Map<String,String> m = am.asMap();
|
||||
System.out.println(m.toString());
|
||||
logger.fine(m.toString());
|
||||
}
|
||||
|
||||
public void testEmptyRecord() throws Exception {
|
||||
@@ -71,16 +74,16 @@ public class ANVLRecordTest extends TestCase {
|
||||
"\r\nx:\r\n # z\r\n\r\n";
|
||||
ANVLRecord r = ANVLRecord.load(new ByteArrayInputStream(
|
||||
record.getBytes("ISO-8859-1")));
|
||||
System.out.println(r);
|
||||
logger.fine(r.toString());
|
||||
assertEquals(r.get(0).toString(), "a: b");
|
||||
record = " a: b\r\n\r\nsdfsdsdfds";
|
||||
r = ANVLRecord.load(new ByteArrayInputStream(
|
||||
record.getBytes("ISO-8859-1")));
|
||||
System.out.println(r);
|
||||
logger.fine(r.toString());
|
||||
record = "x:\r\n # z\r\ny:\r\n\r\n";
|
||||
r = ANVLRecord.load(new ByteArrayInputStream(
|
||||
record.getBytes("ISO-8859-1")));
|
||||
System.out.println(r);
|
||||
logger.fine(r.toString());
|
||||
assertEquals(r.get(0).toString(), "x:");
|
||||
}
|
||||
|
||||
@@ -93,7 +96,7 @@ public class ANVLRecordTest extends TestCase {
|
||||
"when/created:\t 1888\r\n\r\n";
|
||||
ANVLRecord r = ANVLRecord.load(new ByteArrayInputStream(
|
||||
sample.getBytes("ISO-8859-1")));
|
||||
System.out.println(r);
|
||||
logger.fine(r.toString());
|
||||
}
|
||||
|
||||
public void testPoundLabel()
|
||||
@@ -104,7 +107,7 @@ public class ANVLRecordTest extends TestCase {
|
||||
"\t\tthe Guard\r\n" +
|
||||
"when/created:\t 1888\r\n\r\n";
|
||||
ANVLRecord r = ANVLRecord.load(sample);
|
||||
System.out.println(r);
|
||||
logger.fine(r.toString());
|
||||
}
|
||||
|
||||
public void testNewlineLabel()
|
||||
|
||||
@@ -32,6 +32,7 @@ import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.apache.poi.hdf.extractor.WordDocument;
|
||||
|
||||
@@ -39,6 +40,7 @@ import junit.framework.TestCase;
|
||||
|
||||
|
||||
public class DocTest extends TestCase {
|
||||
private final Logger logger = Logger.getLogger(this.getClass().getName());
|
||||
|
||||
|
||||
final private static File TEST_DIR;
|
||||
@@ -63,7 +65,7 @@ public class DocTest extends TestCase {
|
||||
}
|
||||
} finally {
|
||||
long duration = System.currentTimeMillis() - start;
|
||||
System.out.println("Duration in milliseconds: " + duration);
|
||||
logger.fine("Duration in milliseconds: " + duration);
|
||||
}
|
||||
}
|
||||
if (errors > 0) {
|
||||
@@ -73,7 +75,7 @@ public class DocTest extends TestCase {
|
||||
|
||||
|
||||
private int runDoc(File doc) throws IOException {
|
||||
System.out.println("===== Now processing " + doc.getName());
|
||||
logger.fine("===== Now processing " + doc.getName());
|
||||
String name = doc.getName();
|
||||
int p = name.lastIndexOf('.');
|
||||
String expectedName = name.substring(0, p) + ".txt";
|
||||
@@ -136,7 +138,7 @@ public class DocTest extends TestCase {
|
||||
go = false;
|
||||
if ((ch >= 0) || (expectedCh >= 0)) {
|
||||
errors++;
|
||||
System.out.println("File lengths differ.");
|
||||
logger.fine("File lengths differ.");
|
||||
}
|
||||
}
|
||||
if (ch != expectedCh) {
|
||||
@@ -155,7 +157,7 @@ public class DocTest extends TestCase {
|
||||
msg.append(expected).append(" (").append(toChar(expected));
|
||||
msg.append(") but got ").append(actual).append(" (");
|
||||
msg.append(toChar(actual)).append(").");
|
||||
System.out.println(msg);
|
||||
logger.fine(msg.toString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user