Author: dmorozov
Date: 2008-11-18 11:51:25 -0500 (Tue, 18 Nov 2008)
New Revision: 11223
Modified:
trunk/sandbox/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java
Log:
additional test cases added
Modified:
trunk/sandbox/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java
===================================================================
---
trunk/sandbox/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java 2008-11-18
16:50:19 UTC (rev 11222)
+++
trunk/sandbox/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java 2008-11-18
16:51:25 UTC (rev 11223)
@@ -54,27 +54,79 @@
private final static String SEAM_TEXT_EXPRESSION_4 = "The other guy said: "+
"\"Nyeah nyeah-nee\"";
- private final static String SEAM_TEXT_EXPRESSION_5 = "You can write down equations
like 2\\*3\\=6 and HTML tagslike \\<body\\> using the escape character:
\\\\.";
+ private final static String SEAM_TEXT_EXPRESSION_5 = "You can write down equations
like 2\\*3\\+4-7\\=3 and HTML tagslike \\<body\\> using the escape character: \\\\.
foo(a)tut.by, 100$ cash 100%";
private final static String SEAM_TEXT_EXPRESSION_6 = "My code doesn't
work:"
+ "`for (int i=0; i<100; i--)\n"
+ "{\n"
- + "doSomething(); doSomething();\n"
+ + "doSomething(){ String str = \"& >"
\"; }; doSomething();\n"
+ "doSomething() " +
"}`" + " Any ideas?";
private final static String SEAM_TEXT_EXPRESSION_7 = "+test
value<h1>test1<h2>test2</h2>test4</h1>\ntest";
- private final static String SEAM_TEXT_EXPRESSION_8 = "+test
value<div>test5</div><h1>test1<div>test2</div>test4</h1>\ntest";
+ private final static String SEAM_TEXT_EXPRESSION_8 = "++test
value<h1>test1<h2>test2</h2>test4</h1>\ntest";
+
+ private final static String SEAM_TEXT_EXPRESSION_9 = "+++test
value<h1>test1<h2>test2</h2>test4</h1>\ntest";
+
+ private final static String SEAM_TEXT_EXPRESSION_10 = "++++test
value<h1>test1<h2>test2</h2>test4</h1>\ntest";
+
+ private final static String SEAM_TEXT_EXPRESSION_11 = "+test
value<div>test5</div><h1>test1<div>test2</div>test4</h1>\ntest";
- private final static String SEAM_TEXT_EXPRESSION_9 = "[test
link=>http://test.com]";
+ private final static String SEAM_TEXT_EXPRESSION_12 = "[test
link=>http://test.com]";
- private final static String SEAM_TEXT_EXPRESSION_10 = "This is a |<tag
attribute=\"value\"/>| example.";
+ private final static String SEAM_TEXT_EXPRESSION_13 =
"[=>http://test.com]";
- private final static String SEAM_TEXT_EXPRESSION_11 = "= <div></div>
<h1> test value </h1>";
+ private final static String SEAM_TEXT_EXPRESSION_14 = "This is a |<tag
attribute=\"value\"/>| example.";
+ private final static String SEAM_TEXT_EXPRESSION_15 = "= <div
class=\"testClass1 testClass2\"></div> <h1> test value
</h1>";
+ private final static String SEAM_TEXT_EXPRESSION_16 = "# <div
class=\"testClass1 testClass2\"></div> <h1> test value
</h1>";
+
+ private final static String SEAM_TEXT_EXPRESSION_17 = "paragraph\n\n+header\ntext
after header\n\nanother paragraph";
+
+ private final static String SEAM_TEXT_EXPRESSION_18 = "paragraph\n\n++header\ntext
after header\n\nanother paragraph";
+ private final static String SEAM_TEXT_EXPRESSION_19 = "paragraph\n\n+++header\ntext
after header\n\nanother paragraph";
+
+ private final static String SEAM_TEXT_EXPRESSION_20 =
"paragraph\n\n++++header\ntext after header\n\nanother paragraph";
+
+ private final static String SEAM_TEXT_EXPRESSION_21 =
"paragraph\n\n=item1\n=item2\n=item3\n\nanother paragraph";
+
+ private final static String SEAM_TEXT_EXPRESSION_22 =
"paragraph\n\n#item1\n#item2\n#item3\n\nanother paragraph";
+
+ private final static String SEAM_TEXT_EXPRESSION_23 = "+header text *emphasis*,
|monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_\n text after header *emphasis*,
|monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_";
+
+ private final static String SEAM_TEXT_EXPRESSION_24 = "++header text *emphasis*,
|monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_\n text after header *emphasis*,
|monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_";
+
+ private final static String SEAM_TEXT_EXPRESSION_25 = "+++header text *emphasis*,
|monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_\n text after header *emphasis*,
|monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_";
+
+ private final static String SEAM_TEXT_EXPRESSION_26 = "++++header text *emphasis*,
|monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_\n text after header *emphasis*,
|monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_";
+
+
+ private final static String SEAM_TEXT_EXPRESSION_27 = "=item1 *emphasis*,
|monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_\n=item2 *emphasis*, |monospace|,
"
+ + "~deleted text~, super^scripts^ or_underlines_";
+
+ private final static String SEAM_TEXT_EXPRESSION_28 = "#item1 *emphasis*,
|monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_\n#item2 *emphasis*, |monospace|,
"
+ + "~deleted text~, super^scripts^ or_underlines_";
+
+ private final static String SEAM_TEXT_EXPRESSION_29 = "A, B, C, D, E, F, G, H, I,
J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9";
+
+ private final static String SEAM_TEXT_EXPRESSION_30 = "<div/>";
+
+
+
+
public HtmlSeamParserTest(String name) {
super(name);
}
@@ -82,49 +134,130 @@
assertSeamConverting(SEAM_TEXT_EXPRESSION_1);
}
- public void testSeamTextConverting2() throws Exception {
+ public void testStandartSeamTextConverting2() throws Exception {
assertSeamConverting(SEAM_TEXT_EXPRESSION_2);
}
- public void testSeamTextConverting3() throws Exception {
+ public void testStandartSeamTextConverting3() throws Exception {
assertSeamConverting(SEAM_TEXT_EXPRESSION_3);
}
- public void testSeamTextConverting4() throws Exception {
+ public void testStandartSeamTextConverting4() throws Exception {
assertSeamConverting(SEAM_TEXT_EXPRESSION_4);
}
- public void testSeamTextConverting5() throws Exception {
+ public void testStandartSeamTextConverting5() throws Exception {
assertSeamConverting(SEAM_TEXT_EXPRESSION_5);
}
- public void testSeamTextConverting6() throws Exception {
+ public void testStandartSeamTextConverting6() throws Exception {
assertSeamConverting(SEAM_TEXT_EXPRESSION_6);
}
- public void testSeamTextConverting7() throws Exception {
+ public void testStandartSeamTextConverting7() throws Exception {
assertSeamConverting(SEAM_TEXT_EXPRESSION_7);
}
- public void testSeamTextConverting8() throws Exception {
+ public void testStandartSeamTextConverting8() throws Exception {
assertSeamConverting(SEAM_TEXT_EXPRESSION_8);
}
- public void testSeamTextConverting9() throws Exception {
+ public void testStandartSeamTextConverting9() throws Exception {
assertSeamConverting(SEAM_TEXT_EXPRESSION_9);
}
- public void testSeamTextConverting10() throws Exception {
+ public void testStandartSeamTextConverting10() throws Exception {
assertSeamConverting(SEAM_TEXT_EXPRESSION_10);
}
- public void testSeamTextConverting11() throws Exception {
+ public void testStandartSeamTextConverting11() throws Exception {
assertSeamConverting(SEAM_TEXT_EXPRESSION_11);
}
+ public void testStandartSeamTextConverting12() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_12);
+ }
+
+ public void testStandartSeamTextConverting13() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_13);
+ }
+ public void testStandartSeamTextConverting14() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_14);
+ }
+
+ public void testStandartSeamTextConverting15() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_15);
+ }
+
+ public void testStandartSeamTextConverting16() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_16);
+ }
+ public void testStandartSeamTextConverting17() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_17);
+ }
+
+ public void testStandartSeamTextConverting18() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_18);
+ }
+
+ public void testStandartSeamTextConverting19() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_19);
+ }
+
+ public void testStandartSeamTextConverting20() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_20);
+ }
+
+ public void testStandartSeamTextConverting21() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_21);
+ }
+
+ public void testStandartSeamTextConverting22() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_22);
+ }
+
+ public void testStandartSeamTextConverting23() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_23);
+ }
+
+ public void testStandartSeamTextConverting24() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_24);
+ }
+
+ public void testStandartSeamTextConverting25() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_25);
+ }
+
+ public void testStandartSeamTextConverting26() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_26);
+ }
+
+ public void testStandartSeamTextConverting27() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_27);
+ }
+
+ public void testStandartSeamTextConverting28() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_28);
+ }
+
+ public void testStandartSeamTextConverting29() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_29);
+ }
+
+ public void testStandartSeamTextConverting30() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_30);
+ }
+
+
+
+
+
+
+
+
/**
* Method to assert converting from Seam Text to html and back
* @param seamTextExpression