Author: craigmcc Date: Sat Dec 10 19:04:24 2005 New Revision: 355881 URL: http://svn.apache.org/viewcvs?rev=355881&view=rev Log: Revise all the other affected test cases to reflect revised MockServletContext behavior as well.
Modified: struts/shale/trunk/clay-plugin/build.xml struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/config/ConfigTestCase.java struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/utils/ClayAmalgamTestCase.java struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/impl/ImplClassesTestCase.java Modified: struts/shale/trunk/clay-plugin/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/build.xml?rev=355881&r1=355880&r2=355881&view=diff ============================================================================== --- struts/shale/trunk/clay-plugin/build.xml (original) +++ struts/shale/trunk/clay-plugin/build.xml Sat Dec 10 19:04:24 2005 @@ -286,6 +286,8 @@ <classpath refid="test.classpath"/> <formatter type="plain" usefile="false"/> + <sysproperty key="documentRoot" + value="${build.home}/test-classes"/> <batchtest fork="yes"> <fileset dir="${build.home}/test-classes" includes="org/apache/shale/clay/**/*TestCase.class"/> Modified: struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/config/ConfigTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/config/ConfigTestCase.java?rev=355881&r1=355880&r2=355881&view=diff ============================================================================== --- struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/config/ConfigTestCase.java (original) +++ struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/config/ConfigTestCase.java Sat Dec 10 19:04:24 2005 @@ -15,6 +15,7 @@ */ package org.apache.shale.clay.config; +import java.io.File; import java.util.Iterator; import junit.framework.Test; @@ -120,11 +121,15 @@ public void setUp() { super.setUp(); + // Configure document root for tests + servletContext.setDocumentRoot + (new File(System.getProperty("documentRoot"))); + //load the mock config data loadComponents(); loadConverters(); loadValidators(); - + // sets the default html template suffix ".html" servletContext.addInitParameter(Globals.CLAY_HTML_TEMPLATE_SUFFIX, ".html"); @@ -353,7 +358,7 @@ public void testCustomConfigFile() { //loads the default and the custom address config files - loadConfigFile("org/apache/shale/clay/config/address-config.xml"); + loadConfigFile("/org/apache/shale/clay/config/address-config.xml"); ComponentBean bean = standardConfigBean.getElement("agentAddressForm"); assertNotNull(bean); @@ -373,9 +378,9 @@ public void testLoadHTMLFile() { //loads the default and the custom address config file - loadConfigFile("org/apache/shale/clay/config/address-config.xml"); + loadConfigFile("/org/apache/shale/clay/config/address-config.xml"); - ComponentBean bean = htmlTemplateConfigBean.getElement("org/apache/shale/clay/config/address.html"); + ComponentBean bean = htmlTemplateConfigBean.getElement("/org/apache/shale/clay/config/address.html"); assertNotNull(bean); Iterator ci = bean.getChildrenIterator(); @@ -391,7 +396,7 @@ public void testLoadXMLFile() { //loads the default and the custom address config file - loadConfigFile("org/apache/shale/clay/config/address-config.xml"); + loadConfigFile("/org/apache/shale/clay/config/address-config.xml"); ComponentBean bean = xmlTemplateConfigBean.getElement("org/apache/shale/clay/config/address.xml"); assertNotNull(bean); @@ -764,7 +769,7 @@ public void testSymbolInheritance() { //loads the default and the custom address config files - loadConfigFile("org/apache/shale/clay/config/address-config.xml"); + loadConfigFile("/org/apache/shale/clay/config/address-config.xml"); // test vertical inheritance ComponentBean bean = standardConfigBean.getElement("baseSymbolLabel"); Modified: struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/utils/ClayAmalgamTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/utils/ClayAmalgamTestCase.java?rev=355881&r1=355880&r2=355881&view=diff ============================================================================== --- struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/utils/ClayAmalgamTestCase.java (original) +++ struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/utils/ClayAmalgamTestCase.java Sat Dec 10 19:04:24 2005 @@ -16,6 +16,7 @@ package org.apache.shale.clay.utils; +import java.io.File; import java.util.Map; import java.util.TreeMap; @@ -37,6 +38,10 @@ public void setUp() { super.setUp(); + // Configure document root for tests + servletContext.setDocumentRoot + (new File(System.getProperty("documentRoot"))); + clayAmalgam = new ClayAmalgam(); application.addComponent("org.apache.shale.clay.component.Clay", "org.apache.shale.clay.component.Clay"); servletContext.setAttribute(ShaleConstants.TAG_UTILITY_BEAN, new Tags()); Modified: struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/impl/ImplClassesTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/impl/ImplClassesTestCase.java?rev=355881&r1=355880&r2=355881&view=diff ============================================================================== --- struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/impl/ImplClassesTestCase.java (original) +++ struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/impl/ImplClassesTestCase.java Sat Dec 10 19:04:24 2005 @@ -16,6 +16,7 @@ package org.apache.shale.dialog.impl; +import java.io.File; import java.util.HashSet; import java.util.Iterator; import java.util.Map; @@ -65,6 +66,8 @@ super.setUp(); // Configure the test dialogs we will be using + servletContext.setDocumentRoot + (new File(System.getProperty("documentRoot"))); servletContext.addInitParameter (Globals.CONFIGURATION_PARAM, "/org/apache/shale/dialog/faces/dialog-config.xml"); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]