[Htmlparser-cvs] htmlparser/src/org/htmlparser/tests/nodeDecoratorTests AllTests.java,1.11,1.12 Deco
Brought to you by:
derrickoswald
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/nodeDecoratorTests In directory sc8-pr-cvs1:/tmp/cvs-serv21682/nodeDecoratorTests Modified Files: AllTests.java DecodingNodeTest.java EscapeCharacterRemovingNodeTest.java NonBreakingSpaceConvertingNodeTest.java Log Message: Consolidated the various testing main() methods into ParserTestCase. All unit test classes in the org.htmlparser.tests heirarchy should now be executable. Index: AllTests.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/nodeDecoratorTests/AllTests.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** AllTests.java 22 Sep 2003 02:40:06 -0000 1.11 --- AllTests.java 21 Oct 2003 02:24:00 -0000 1.12 *************** *** 31,36 **** import junit.framework.TestSuite; ! public class AllTests extends junit.framework.TestCase { public AllTests(String name) { super(name); --- 31,43 ---- import junit.framework.TestSuite; ! import org.htmlparser.tests.ParserTestCase; ! ! public class AllTests extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.nodeDecoratorTests.AllTests", "AllTests"); + } + public AllTests(String name) { super(name); *************** *** 43,109 **** suite.addTestSuite(NonBreakingSpaceConvertingNodeTest.class); return suite; - } - - /** - * Mainline for all suites of tests. - * @param args Command line arguments. The following options - * are understood: - * <pre> - * -text -- use junit.textui.TestRunner - * -awt -- use junit.awtui.TestRunner - * -swing -- use junit.swingui.TestRunner (default) - * </pre> - * All other options are passed on to the junit framework. - */ - public static void main(String[] args) - { - String runner; - int i; - String arguments[]; - Class cls; - - runner = null; - for (i = 0; (i < args.length) && (null == runner); i++) - { - if (args[i].equalsIgnoreCase ("-text")) - runner = "junit.textui.TestRunner"; - else if (args[i].equalsIgnoreCase ("-awt")) - runner = "junit.awtui.TestRunner"; - else if (args[i].equalsIgnoreCase ("-swing")) - runner = "junit.swingui.TestRunner"; - } - if (null != runner) - { - // remove it from the arguments - arguments = new String[args.length - 1]; - System.arraycopy (args, 0, arguments, 0, i - 1); - System.arraycopy (args, i, arguments, i - 1, args.length - i); - args = arguments; - } - else - runner = "junit.swingui.TestRunner"; - - // append the test class - arguments = new String[args.length + 1]; - System.arraycopy (args, 0, arguments, 0, args.length); - arguments[args.length] = "org.htmlparser.tests.nodeDecoratorTests.AllTests"; - - // invoke main() of the test runner - try - { - cls = Class.forName (runner); - java.lang.reflect.Method method = cls.getDeclaredMethod ( - "main", new Class[] { String[].class }); - method.invoke ( - null, - new Object[] { arguments }); - } - catch (Throwable t) - { - System.err.println ( - "cannot run unit test (" - + t.getMessage () - + ")"); - } } } --- 50,53 ---- Index: DecodingNodeTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/nodeDecoratorTests/DecodingNodeTest.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** DecodingNodeTest.java 22 Sep 2003 02:40:07 -0000 1.12 --- DecodingNodeTest.java 21 Oct 2003 02:24:00 -0000 1.13 *************** *** 38,41 **** --- 38,46 ---- public class DecodingNodeTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.nodeDecoratorTests.DecodingNodeTest", "DecodingNodeTest"); + } + public DecodingNodeTest(String name) { super(name); Index: EscapeCharacterRemovingNodeTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/nodeDecoratorTests/EscapeCharacterRemovingNodeTest.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** EscapeCharacterRemovingNodeTest.java 22 Sep 2003 02:40:07 -0000 1.12 --- EscapeCharacterRemovingNodeTest.java 21 Oct 2003 02:24:00 -0000 1.13 *************** *** 37,40 **** --- 37,46 ---- public class EscapeCharacterRemovingNodeTest extends ParserTestCase { + + static + { + System.setProperty ("org.htmlparser.tests.nodeDecoratorTests.EscapeCharacterRemovingNodeTest", "EscapeCharacterRemovingNodeTest"); + } + public EscapeCharacterRemovingNodeTest(String name) { super(name); Index: NonBreakingSpaceConvertingNodeTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/nodeDecoratorTests/NonBreakingSpaceConvertingNodeTest.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** NonBreakingSpaceConvertingNodeTest.java 22 Sep 2003 02:40:07 -0000 1.11 --- NonBreakingSpaceConvertingNodeTest.java 21 Oct 2003 02:24:00 -0000 1.12 *************** *** 37,40 **** --- 37,45 ---- public class NonBreakingSpaceConvertingNodeTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.nodeDecoratorTests.NonBreakingSpaceConvertingNodeTest", "NonBreakingSpaceConvertingNodeTest"); + } + public NonBreakingSpaceConvertingNodeTest(String name) { super(name); |