From: axelcl <axelcl> Date: Fri, 18 Feb 2005 21:22:44 +0000 (+0000) Subject: DefinitionListTest (not working JUnit Test) X-Git-Url: http://secure.phpeclipse.com DefinitionListTest (not working JUnit Test) --- diff --git a/archive/org.plog4u.wiki.test/src/org/plog4u/wiki/test/filter/DefinitionListFilterTest.java b/archive/org.plog4u.wiki.test/src/org/plog4u/wiki/test/filter/DefinitionListFilterTest.java new file mode 100644 index 0000000..8853c7e --- /dev/null +++ b/archive/org.plog4u.wiki.test/src/org/plog4u/wiki/test/filter/DefinitionListFilterTest.java @@ -0,0 +1,36 @@ +package org.plog4u.wiki.test.filter; + +import java.io.File; + +import junit.framework.Test; +import junit.framework.TestSuite; + +import org.plog4u.wiki.filter.WikipediaFilter; + + +public class DefinitionListFilterTest extends FilterTestSupport { + public DefinitionListFilterTest(String name) { + super(name); + } + + protected void setUp() throws Exception { + filter = new WikipediaFilter(); + super.setUp(); + } + + public static Test suite() { + return new TestSuite(DefinitionListFilterTest.class); + } + + public void testDefinitionList1() { + assertEquals("<dl><dt> term </dt><dd> definition"+NEWLINE + "</dd><dt> term 2 </dt><dd> definition 2"+NEWLINE + + "</dd><dd> definition without term"+NEWLINE + "</dd></dl>", filter.filter("; term : definition"+NEWLINE + + "; term 2 : definition 2"+NEWLINE + ": definition without term", context)); + } + + public void testDefinitionList2() { + assertEquals("<dl><dt>term 2:definition 2"+NEWLINE + "</dt></dl>"+NEWLINE + "<dl><dd> definition 2"+NEWLINE + "</dd></dl>", filter.filter( + ";term 2:definition 2"+NEWLINE +NEWLINE + ": definition 2", context)); + } + +} \ No newline at end of file diff --git a/archive/org.plog4u.wiki.test/src/org/plog4u/wiki/test/filter/FilterTestSupport.java b/archive/org.plog4u.wiki.test/src/org/plog4u/wiki/test/filter/FilterTestSupport.java index abb21a0..fd87dd8 100644 --- a/archive/org.plog4u.wiki.test/src/org/plog4u/wiki/test/filter/FilterTestSupport.java +++ b/archive/org.plog4u.wiki.test/src/org/plog4u/wiki/test/filter/FilterTestSupport.java @@ -13,6 +13,9 @@ import org.radeox.filter.context.FilterContext; */ public class FilterTestSupport extends TestCase { + public static final String WINDOWS_NEWLINE = "\r\n"; + public static final String UNIX_NEWLINE = "\n"; + public static final String NEWLINE = WINDOWS_NEWLINE; protected Filter filter; protected FilterContext context;