Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10363/test/unit/org/webmacro/template
Modified Files:
TestSetpropsDirective.java
Log Message:
Ensure tests do not interfere with each other
Index: TestSetpropsDirective.java
===================================================================
RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestSetpropsDirective.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TestSetpropsDirective.java 19 Feb 2010 00:21:30 -0000 1.6
--- TestSetpropsDirective.java 19 Feb 2010 00:49:39 -0000 1.7
***************
*** 27,30 ****
--- 27,35 ----
}
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ Broker.BROKERS.clear();
+ }
+
public void stuffContext(Context context) throws Exception
{
***************
*** 72,81 ****
public void testSetpropsAllowedPackage() throws Exception
{
! System.getProperties().setProperty("org.webmacro.AllowedPackages", "org.webmacro");
// overwrite the wm created in setup
! _wm = null;
! _context = null;
! System.err.println("IN");
!
_wm = new WM(Broker.getBroker(new Properties()));
_context = _wm.getContext();
--- 77,83 ----
public void testSetpropsAllowedPackage() throws Exception
{
! System.getProperties().setProperty("org.webmacro.AllowedPackages", "java.lang,java.util,org.webmacro");
// overwrite the wm created in setup
! Broker.BROKERS.clear();
_wm = new WM(Broker.getBroker(new Properties()));
_context = _wm.getContext();
***************
*** 85,88 ****
--- 87,91 ----
tmpl += "$WM";
assertStringTemplateEquals(tmpl, "WebMacro(WebMacro.properties)");
+ System.getProperties().setProperty("org.webmacro.AllowedPackages", "java.lang,java.util");
}
***************
*** 125,128 ****
--- 128,137 ----
public void testSetpropsImpliedPackage() throws Exception
{
+ System.getProperties().setProperty("org.webmacro.ImpliedPackages", "java.util");
+ // overwrite the wm created in setup
+ Broker.BROKERS.clear();
+
+ _wm = new WM(Broker.getBroker(new Properties()));
+ _context = _wm.getContext();
String tmpl = "#setprops $Prefs class=\"HashMap\"";
tmpl += "\n{\n";
|