1 23 24 package org.enhydra.xml.xmlc.html; 25 import java.io.File ; 26 import java.lang.reflect.Method ; 27 28 import junit.framework.Test; 29 30 import org.enhydra.xml.driver.TestDiff; 31 import org.enhydra.xml.xmlc.driver.ExecXmlc; 32 33 36 public class BasicTests extends HtmlTestCaseBase { 37 38 39 public static Test suite() { 40 return createSuite(BasicTests.class, null); 41 } 42 43 44 public BasicTests(Method method) { 45 super(method); 46 } 47 48 52 public void test1() { 53 HtmlBasicTest test = createLutrisIndexTest(); 54 test.addOptionFile(getInputFile("lutris-index1.xmlc")); 55 test.basicTest(); 56 } 57 58 61 public void test2() { 62 HtmlBasicTest test = createLutrisIndexTest(); 63 test.addBoth(ExecXmlc.OPT_JAVAC_G); 64 test.addFirst(ExecXmlc.OPT_URL_MAPPING); 65 test.addFirst("TheCompany1.html", "TheCompany1.po"); 66 test.addFirst(ExecXmlc.OPT_URL_MAPPING); 67 test.addFirst("ProfSrvcs1.html", "ProfSrvcs1.po"); 68 test.setUseToDocument(); 69 test.basicTest(); 70 } 71 72 75 public void test3() { 76 HtmlBasicTest test = createTest("simple-href.html"); 77 test.addFirst(ExecXmlc.OPT_URL_SETTING); 78 test.addFirst("testNode", "http://www.foo.com/"); 79 test.basicTest(); 80 } 81 82 85 public void test5() { 86 HtmlBasicTest test = createLutrisIndexTest(); 87 test.addOptionFile(getInputFile("LutrisIndex4.xmlc")); 88 test.setUseToDocument(); 89 test.basicTest(); 90 } 91 92 95 public void test6() { 96 HtmlBasicTest test = createTest("CheckVersion.html"); 97 test.basicTest(); 98 } 99 100 103 public void test7() { 104 HtmlBasicTest test = createLutrisIndexTest(); 105 test.addBoth(ExecXmlc.OPT_JAVAC_G); 106 test.addFirst(ExecXmlc.OPT_URL_REGEXP_MAPPING); 107 test.addFirst("^(Th.+)\\.html$$", "$$1.po"); 108 test.addFirst(ExecXmlc.OPT_URL_REGEXP_MAPPING); 109 test.addFirst("^(Pr.+)\\.html$$", "$$1.po"); 110 test.basicTest(); 111 } 112 113 117 public void test8() { 118 HtmlBasicTest test = createTest("special-char.html"); 119 test.basicTest(); 120 } 121 122 126 public void test9() { 127 HtmlBasicTest test = createTest("attributeValues.html"); 128 test.getOutputOptions().setOmitAttributeCharEntityRefs(true); 129 test.basicTest(); 130 File htmlFile = test.getGenerateFile(); 131 132 TestDiff differ = getDiffer(); 133 differ.fgrepMustFind("http://www.foo.bar/cgi-bin/pig3?a=b&c=d", 134 htmlFile); 135 differ.fgrepMustFind("http://www.foo.bar/cgi-bin/pig4?a="&c=d", 136 htmlFile); 137 differ.fgrepMustFind("http://www.foo.bar/cgi-bin/pig5?a="&c=d", 138 htmlFile); 139 } 140 141 145 public void test10() { 146 HtmlBasicTest test = createTest("attributeValues.html"); 147 test.getOutputOptions().setOmitAttributeCharEntityRefs(false); 148 test.basicTest(); 149 150 File htmlFile = test.getGenerateFile(); 151 TestDiff differ = getDiffer(); 152 differ.fgrepMustFind("http://www.foo.bar/cgi-bin/pig3?a=b&c=d", 153 htmlFile); 154 differ.fgrepMustFind("http://www.foo.bar/cgi-bin/pig4?a="&c=d", 155 htmlFile); 156 differ.fgrepMustFind("http://www.foo.bar/cgi-bin/pig5?a="&c=d", 157 htmlFile); 158 } 159 160 163 public void test11() { 164 HtmlBasicTest test = createTest("FrameSet.html"); 165 test.basicTest(); 166 } 167 } 168 | Popular Tags |