org.displaytag.test
abstract public class: DisplaytagCase [javadoc |
source]
java.lang.Object
junit.framework.TestCase
org.displaytag.test.DisplaytagCase
Direct Known Subclasses:
TitleKeyAutoColumnJstlTest, TitleKeyAutoColumnSpringTest, ColumnDecoratorTest, Displ220Test, Displ085Test, ExportPdfFilterTest, Displ213Test, BasicTableTagTest, Displ182Test, Displ208Test, PaginationTest, Displ161Test, EncodedParametersTest, NestedTest, Displ249Test, Displ209Test, Displ280Test, OneRowOnlyTest, Displ252Test, CssPropertyTest, AutocolumnStringTest, ExcludedParamsStarTest, DisabledMediaTest, Displ117Test, Displ192Test, HtmlIdTest, ExternalSortTest, ColumnPoolingTest, Displ224Test, MaxLengthTest, Displ145Test, TitleKeyJstlFmtBundlePrefixTest, Displ237Test, TitleKeySpringTest, Displ028Test, Displ049Test, ExportFilterErrorTest, Displ212Test, I18nPropertiesTest, NoContextTest, Displ174Test, ExportUTF8Test, CaptionTagTest, DataSourceMapAutoColumnTest, EmptyExportTest, Displ109Test, Displ279Test, Displ107Test, Displ105Test, Displ068Test, GroupTest, Displ110Test, ExcludedParamsTest, Displ243Test, AbstractTitleKeyAutoColumnTest, Displ147Test, ExportLinksTest, Displ199Test, MediaSupportXmlTest, Displ232Test, SetPropertyTagTest, Displ001Test, ListIndexTableDecoratorTest, ExportFullTest, OffsetTest, FilterTest, PartialListMissingSizeTest, PartialListTest, Displ004Test, Displ200Test, Displ058Test, TitleKeyAutoColumnWebworkTest, ColumnLinksTest, Displ017Test, Displ142Test, Displ010Test, Displ264Test, Displ112Test, ExportHeadersFilterTest, TitleKeyWebWorkTest, Displ009Test, ExportFileNameTest, ExportDecoratedTest, Displ002Test, ColumnBodyTest, ExportUTF8FilterTest, Displ139Test, OptimizedIterationTest, PaginationLinksTest, ExportHeadersTest, AbstractTitleKeyTest, TotalsTest, RequestUriTest, ExportPdfTest, EmptyTableTest, FooterTagTest, Displ018Test, Displ074Test, Displ080Test, Displ136Test, TitleKeyStrutsTest, EncodedUriTest, Displ081Test, TitleKeyAutoColumnStrutsTest, MediaSupportHtmlTest, Displ234Test, TitleKeyJstlFmtBundleTest, OptimizedIteration2Test, Displ181Test, OptimizedIteration3Test, PartialListSortFullTest, PaginationAllItemsTest, DataSourceMapTest, HtmlAttributesTest, Displ129Test, TitleKeyJstlTest, Displ056Test, Displ118Test, Displ026Test
Base TestCase class for tests.
- author:
Fabrizio - Giustina
- version:
$ - Revision: 1023 $ ($Author: fgiust $)
| Field Summary |
|---|
| public static final String | CONTEXT | Context mapped to the test application. |
| protected final Log | log | logger. |
| protected ServletRunner | runner | HttpUnit ServletRunner. |
| Method from org.displaytag.test.DisplaytagCase Detail: |
public void assertEqualsIgnoreOrder(String message,
String[] expected,
String[] actual) {
if (expected.length != actual.length)
{
fail(message
+ " Wrong number of values, expected "
+ expected.length
+ " ("
+ ArrayUtils.toString(expected)
+ "), actual "
+ actual.length
+ " ("
+ ArrayUtils.toString(actual)
+ ")");
}
outer : for (int j = 0; j < expected.length; j++)
{
String exp = expected[j];
for (int q = 0; q < actual.length; q++)
{
if (StringUtils.equals(exp, actual[q]))
{
continue outer;
}
}
fail(message + " Expected value \"" + exp + "\" not found in actual array: " + ArrayUtils.toString(actual));
}
}
Compare 2 arrays of string ignoring order. |
abstract public void doTest(String jspName) throws Exception
|
abstract public String getJspName()
Returns the tested jsp name. |
public String getName() {
return getClass().getName() + "." + super.getName() + " (" + getJspName() + ")";
}
|
protected void setUp() throws Exception {
// need to pass a web.xml file to setup servletunit working directory
ClassLoader classLoader = getClass().getClassLoader();
URL webXmlUrl = classLoader.getResource("WEB-INF/web.xml");
String path = URLDecoder.decode(webXmlUrl.getFile(), "UTF-8");
// start servletRunner
runner = new ServletRunner(new File(path), CONTEXT);
log.debug("ServletRunner setup OK");
super.setUp();
}
|
protected void tearDown() throws Exception {
// shutdown servlet engine
runner.shutDown();
super.tearDown();
}
|
public void test11() throws Exception {
doTest("http://localhost" + CONTEXT + "/standard/" + getJspName());
}
run the test with the non-el tld. |
public void testEL() throws Exception {
doTest("http://localhost" + CONTEXT + "/el/" + getJspName());
}
run the test with the el tld. |