Thread: [Htmlparser-cvs] htmlparser/src/org/htmlparser/tests/tagTests AllTests.java,1.44,1.45 AppletTagTest.
Brought to you by:
derrickoswald
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests In directory sc8-pr-cvs1:/tmp/cvs-serv21682/tagTests Modified Files: AllTests.java AppletTagTest.java BaseHrefTagTest.java BodyTagTest.java CompositeTagTest.java DoctypeTagTest.java EndTagTest.java FormTagTest.java FrameSetTagTest.java FrameTagTest.java ImageTagTest.java InputTagTest.java JspTagTest.java LinkTagTest.java MetaTagTest.java ObjectCollectionTest.java OptionTagTest.java ScriptTagTest.java SelectTagTest.java StyleTagTest.java TagTest.java TextareaTagTest.java TitleTagTest.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/tagTests/AllTests.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** AllTests.java 22 Sep 2003 02:40:12 -0000 1.44 --- AllTests.java 21 Oct 2003 02:24:01 -0000 1.45 *************** *** 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.tagTests.AllTests", "AllTests"); + } + public AllTests(String name) { super(name); *************** *** 62,128 **** suite.addTestSuite(CompositeTagTest.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.tagTests.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 () - + ")"); - } } } --- 69,72 ---- Index: AppletTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/AppletTagTest.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** AppletTagTest.java 18 Oct 2003 20:50:37 -0000 1.31 --- AppletTagTest.java 21 Oct 2003 02:24:01 -0000 1.32 *************** *** 37,40 **** --- 37,45 ---- public class AppletTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.AppletTagTest", "AppletTagTest"); + } + public AppletTagTest(String name) { super(name); Index: BaseHrefTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/BaseHrefTagTest.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** BaseHrefTagTest.java 20 Oct 2003 01:28:04 -0000 1.30 --- BaseHrefTagTest.java 21 Oct 2003 02:24:01 -0000 1.31 *************** *** 36,39 **** --- 36,44 ---- public class BaseHrefTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.BaseHrefTagTest", "BaseHrefTagTest"); + } + public BaseHrefTagTest(String name) { super(name); Index: BodyTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/BodyTagTest.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** BodyTagTest.java 22 Sep 2003 02:40:12 -0000 1.13 --- BodyTagTest.java 21 Oct 2003 02:24:01 -0000 1.14 *************** *** 40,43 **** --- 40,49 ---- public class BodyTagTest extends ParserTestCase { + + static + { + System.setProperty ("org.htmlparser.tests.tagTests.BodyTagTest", "BodyTagTest"); + } + private BodyTag bodyTag; *************** *** 105,113 **** { return new TestSuite(BodyTagTest.class); - } - - public static void main(String[] args) - { - new junit.awtui.TestRunner().start(new String[] {BodyTagTest.class.getName()}); } } --- 111,114 ---- Index: CompositeTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/CompositeTagTest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CompositeTagTest.java 22 Sep 2003 02:40:12 -0000 1.9 --- CompositeTagTest.java 21 Oct 2003 02:24:01 -0000 1.10 *************** *** 37,40 **** --- 37,45 ---- public class CompositeTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.CompositeTagTest", "CompositeTagTest"); + } + public CompositeTagTest(String name) { super(name); Index: DoctypeTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/DoctypeTagTest.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** DoctypeTagTest.java 5 Oct 2003 13:49:54 -0000 1.29 --- DoctypeTagTest.java 21 Oct 2003 02:24:01 -0000 1.30 *************** *** 35,38 **** --- 35,43 ---- public class DoctypeTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.DoctypeTagTest", "DoctypeTagTest"); + } + public DoctypeTagTest(String name) { super(name); Index: EndTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/EndTagTest.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** EndTagTest.java 6 Oct 2003 01:43:28 -0000 1.31 --- EndTagTest.java 21 Oct 2003 02:24:01 -0000 1.32 *************** *** 36,39 **** --- 36,44 ---- public class EndTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.EndTagTest", "EndTagTest"); + } + public EndTagTest(String name) { super(name); Index: FormTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/FormTagTest.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** FormTagTest.java 18 Oct 2003 20:50:37 -0000 1.35 --- FormTagTest.java 21 Oct 2003 02:24:01 -0000 1.36 *************** *** 42,45 **** --- 42,50 ---- public class FormTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.FormTagTest", "FormTagTest"); + } + public FormTagTest(String name) { super(name); Index: FrameSetTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/FrameSetTagTest.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** FrameSetTagTest.java 6 Oct 2003 01:43:28 -0000 1.30 --- FrameSetTagTest.java 21 Oct 2003 02:24:01 -0000 1.31 *************** *** 37,40 **** --- 37,45 ---- public class FrameSetTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.FrameSetTagTest", "FrameSetTagTest"); + } + public FrameSetTagTest(String name) { super(name); Index: FrameTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/FrameTagTest.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** FrameTagTest.java 6 Oct 2003 01:43:28 -0000 1.30 --- FrameTagTest.java 21 Oct 2003 02:24:01 -0000 1.31 *************** *** 36,39 **** --- 36,44 ---- public class FrameTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.FrameTagTest", "FrameTagTest"); + } + public FrameTagTest(String name) { super(name); Index: ImageTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/ImageTagTest.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ImageTagTest.java 6 Oct 2003 01:43:28 -0000 1.32 --- ImageTagTest.java 21 Oct 2003 02:24:01 -0000 1.33 *************** *** 41,44 **** --- 41,49 ---- public class ImageTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.ImageTagTest", "ImageTagTest"); + } + public ImageTagTest(String name) { super(name); Index: InputTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/InputTagTest.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** InputTagTest.java 13 Oct 2003 21:48:14 -0000 1.33 --- InputTagTest.java 21 Oct 2003 02:24:01 -0000 1.34 *************** *** 38,41 **** --- 38,47 ---- public class InputTagTest extends ParserTestCase { + + static + { + System.setProperty ("org.htmlparser.tests.tagTests.InputTagTest", "InputTagTest"); + } + private String testHTML = new String("<INPUT type=\"text\" name=\"Google\">"); Index: JspTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/JspTagTest.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** JspTagTest.java 18 Oct 2003 20:50:37 -0000 1.34 --- JspTagTest.java 21 Oct 2003 02:24:01 -0000 1.35 *************** *** 37,40 **** --- 37,45 ---- public class JspTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.JspTagTest", "JspTagTest"); + } + private static final boolean JSP_TESTS_ENABLED = false; Index: LinkTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/LinkTagTest.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** LinkTagTest.java 20 Oct 2003 01:28:04 -0000 1.38 --- LinkTagTest.java 21 Oct 2003 02:24:01 -0000 1.39 *************** *** 38,41 **** --- 38,46 ---- public class LinkTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.LinkTagTest", "LinkTagTest"); + } + public LinkTagTest(String name) { super(name); Index: MetaTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/MetaTagTest.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** MetaTagTest.java 13 Oct 2003 21:48:14 -0000 1.32 --- MetaTagTest.java 21 Oct 2003 02:24:01 -0000 1.33 *************** *** 35,38 **** --- 35,43 ---- public class MetaTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.MetaTagTest", "MetaTagTest"); + } + public MetaTagTest(String name) { super(name); Index: ObjectCollectionTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/ObjectCollectionTest.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ObjectCollectionTest.java 22 Sep 2003 02:40:12 -0000 1.13 --- ObjectCollectionTest.java 21 Oct 2003 02:24:01 -0000 1.14 *************** *** 42,45 **** --- 42,50 ---- public class ObjectCollectionTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.ObjectCollectionTest", "ObjectCollectionTest"); + } + public ObjectCollectionTest(String name) { super(name); Index: OptionTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/OptionTagTest.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** OptionTagTest.java 6 Oct 2003 01:43:28 -0000 1.31 --- OptionTagTest.java 21 Oct 2003 02:24:01 -0000 1.32 *************** *** 41,44 **** --- 41,49 ---- public class OptionTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.OptionTagTest", "OptionTagTest"); + } + private String testHTML = new String( "<OPTION value=\"Google Search\">Google</OPTION>" + *************** *** 140,148 **** assertEquals("HTML Raw String","OPTION VALUE: Time Warner TEXT: Time Warner AOL Inc.\n",OptionTag.toString()); */ } - - public static void main(String[] args) - { - new junit.awtui.TestRunner().start(new String[] {OptionTagTest.class.getName()}); - } - } --- 145,147 ---- Index: ScriptTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/ScriptTagTest.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ScriptTagTest.java 20 Oct 2003 01:28:04 -0000 1.34 --- ScriptTagTest.java 21 Oct 2003 02:24:01 -0000 1.35 *************** *** 38,41 **** --- 38,47 ---- public class ScriptTagTest extends ParserTestCase{ + + static + { + System.setProperty ("org.htmlparser.tests.tagTests.ScriptTagTest", "ScriptTagTest"); + } + private ScriptScanner scriptScanner; Index: SelectTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/SelectTagTest.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** SelectTagTest.java 6 Oct 2003 01:43:28 -0000 1.32 --- SelectTagTest.java 21 Oct 2003 02:24:01 -0000 1.33 *************** *** 43,46 **** --- 43,51 ---- public class SelectTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.SelectTagTest", "SelectTagTest"); + } + private String testHTML = new String( "<SELECT name=\"Nominees\">\n"+ *************** *** 99,107 **** assertEquals("option tag 7","Niece\r\n",optionTags[6].getOptionText()); } - - public static void main(String[] args) - { - new junit.awtui.TestRunner().start(new String[] {SelectTagTest.class.getName()}); - } - } --- 104,106 ---- Index: StyleTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/StyleTagTest.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** StyleTagTest.java 6 Oct 2003 01:43:28 -0000 1.29 --- StyleTagTest.java 21 Oct 2003 02:24:01 -0000 1.30 *************** *** 36,39 **** --- 36,44 ---- public class StyleTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.StyleTagTest", "StyleTagTest"); + } + public StyleTagTest(String name) { super(name); Index: TagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/TagTest.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** TagTest.java 18 Oct 2003 20:50:37 -0000 1.48 --- TagTest.java 21 Oct 2003 02:24:01 -0000 1.49 *************** *** 44,47 **** --- 44,52 ---- public class TagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.TagTest", "TagTest"); + } + private static final boolean JSP_TESTS_ENABLED = false; Index: TextareaTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/TextareaTagTest.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** TextareaTagTest.java 13 Oct 2003 21:48:14 -0000 1.31 --- TextareaTagTest.java 21 Oct 2003 02:24:01 -0000 1.32 *************** *** 38,41 **** --- 38,46 ---- public class TextareaTagTest extends ParserTestCase { + static + { + System.setProperty ("org.htmlparser.tests.tagTests.TextareaTagTest", "TextareaTagTest"); + } + private String area1 = "<TEXTAREA name=\"Remarks\" >The intervention by the UN proved beneficial</TEXTAREA>"; private String area2 = "<TEXTAREA>The capture of the Somali warloard was elusive</TEXTAREA>"; Index: TitleTagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/TitleTagTest.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** TitleTagTest.java 22 Sep 2003 02:40:13 -0000 1.28 --- TitleTagTest.java 21 Oct 2003 02:24:01 -0000 1.29 *************** *** 37,40 **** --- 37,46 ---- public class TitleTagTest extends ParserTestCase { + + static + { + System.setProperty ("org.htmlparser.tests.tagTests.TitleTagTest", "TitleTagTest"); + } + private TitleTag titleTag; |