From c3e017b4ac5ff8477cbc5d9831882bdd099accfb Mon Sep 17 00:00:00 2001 From: axelcl Date: Fri, 18 Feb 2005 21:22:44 +0000 Subject: [PATCH 1/1] DefinitionListTest (not working JUnit Test) --- .../wiki/test/filter/DefinitionListFilterTest.java | 36 ++++++++++++++++++++ .../plog4u/wiki/test/filter/FilterTestSupport.java | 3 ++ 2 files changed, 39 insertions(+), 0 deletions(-) create mode 100644 archive/org.plog4u.wiki.test/src/org/plog4u/wiki/test/filter/DefinitionListFilterTest.java 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("
term 
definition"+NEWLINE + "
term 2 
definition 2"+NEWLINE + + "
definition without term"+NEWLINE + "
", filter.filter("; term : definition"+NEWLINE + + "; term 2 : definition 2"+NEWLINE + ": definition without term", context)); + } + + public void testDefinitionList2() { + assertEquals("
term 2:definition 2"+NEWLINE + "
"+NEWLINE + "
definition 2"+NEWLINE + "
", 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; -- 1.7.1