|
From: <caw...@us...> - 2007-01-16 14:53:13
|
Revision: 1774
http://svn.sourceforge.net/rubyeclipse/?rev=1774&view=rev
Author: cawilliams
Date: 2007-01-16 06:52:22 -0800 (Tue, 16 Jan 2007)
Log Message:
-----------
make test use a VERBOSE flag to determine whether to spit out debug stuff to command line (and set flag to false by default).
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java 2007-01-16 00:51:23 UTC (rev 1773)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java 2007-01-16 14:52:22 UTC (rev 1774)
@@ -20,9 +20,9 @@
public class TestData {
public TestData(String formattedText, String unformattedText, String assertionMessage) {
- this.formattedText = formattedText ;
- this.unformattedText = unformattedText ;
- this.assertionMessage = assertionMessage ;
+ this.formattedText = formattedText;
+ this.unformattedText = unformattedText;
+ this.assertionMessage = assertionMessage;
}
public String formattedText;
@@ -30,6 +30,8 @@
public String assertionMessage;
}
+ private static final boolean VERBOSE = false; // set to true if you want output to command line
+
private Hashtable testMap;
public TC_CodeFormatter(String name) throws SAXException, IOException, ParserConfigurationException, FactoryConfigurationError {
super(name);
@@ -84,14 +86,20 @@
for (int i = 0; i < partList.size(); i++) {
TestData data = (TestData) partList.get(i);
String formatted = new OldCodeFormatter().formatString(data.unformattedText);
- System.out.println("---------- " + data.assertionMessage + " --------") ;
- System.out.println(data.unformattedText) ;
- System.out.println("------------") ;
- System.out.println(formatted) ;
+ log("---------- " + data.assertionMessage + " --------") ;
+ log(data.unformattedText) ;
+ log("------------") ;
+ log(formatted) ;
Assert.assertEquals(data.assertionMessage, data.formattedText, formatted);
}
}
+ private void log(String formatted) {
+ if (VERBOSE)
+ System.out.println(formatted);
+
+ }
+
public void testSimple() {
this.doTest("Keywords");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|