Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/engine
In directory usw-pr-cvs1:/tmp/cvs-serv22960/test/unit/org/webmacro/engine
Added Files:
TestStaticClasses.java
Log Message:
A Test to try and duplicate bugs 63 and 67 (which appear to be similiar), based on the limited information provided by the users.
I cannot duplicate it. Marked bugs as "WORKSFORME" and have moved on with the rest of my life.
--- NEW FILE: TestStaticClasses.java ---
/*
* Created by IntelliJ IDEA.
* User: e_ridge
* Date: Nov 10, 2002
* Time: 4:28:49 PM
* To change template for new class use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.webmacro.engine;
import junit.framework.TestCase;
import org.webmacro.template.TemplateTestCase;
import org.webmacro.Context;
public class TestStaticClasses extends TemplateTestCase {
public static class Simple {
public static String foo (String arg, String arg2) {
if (arg == null)
return "arg is null";
else
return arg;
}
}
public TestStaticClasses(String s) {
super(s);
}
protected void stuffContext(Context context) throws Exception {
_context.put ("SimpleInstance", new Simple());
_context.put ("SimpleClass", Simple.class);
}
public void testStaticClassWithNullAsFirstArg_1 () throws Exception {
assertEvalutionEquals("$SimpleClass.foo(null, null)", "arg is null");
assertEvalutionEquals("$SimpleInstance.foo(null, null)", "arg is null");
}
public void testStaticClassWithNullAsFirstArg_2 () throws Exception {
executeStringTemplate("$SimpleClass.foo(null, null)");
executeStringTemplate("$SimpleInstance.foo(null, null)");
}
}
|