Author: maksimkaszynski
Date: 2008-03-14 09:16:06 -0400 (Fri, 14 Mar 2008)
New Revision: 6809
Modified:
trunk/framework/test/src/main/java/org/ajax4jsf/tests/AbstractAjax4JsfTestCase.java
Log:
implemented expression factory for enum types
Modified:
trunk/framework/test/src/main/java/org/ajax4jsf/tests/AbstractAjax4JsfTestCase.java
===================================================================
---
trunk/framework/test/src/main/java/org/ajax4jsf/tests/AbstractAjax4JsfTestCase.java 2008-03-14
13:14:03 UTC (rev 6808)
+++
trunk/framework/test/src/main/java/org/ajax4jsf/tests/AbstractAjax4JsfTestCase.java 2008-03-14
13:16:06 UTC (rev 6809)
@@ -27,6 +27,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
+import java.lang.reflect.Field;
import java.net.URL;
import java.util.Collections;
import java.util.Enumeration;
@@ -55,7 +56,7 @@
import org.ajax4jsf.tests.org.apache.shale.test.config.ConfigParser;
import org.ajax4jsf.webapp.WebXml;
import org.apache.shale.test.base.AbstractJsfTestCase;
-import org.apache.shale.test.mock.MockApplication12;
+import org.apache.shale.test.mock.MockApplication;
import org.apache.shale.test.mock.MockPrintWriter;
import org.apache.shale.test.mock.MockResponseWriter;
import org.apache.shale.test.mock.MockServletOutputStream;
@@ -111,7 +112,20 @@
// This method MUST BE OVERRIDEN in any subclasses - since Junit see for it in class
for call
super.setUp();
-
+ //Try to override default expression factory with our wrapper that supports enums (like
Sun's)
+ try {
+ ExpressionFactory exprFact =
+ new EnumSupportExpressionFactoryWrapper(application.getExpressionFactory());
+
+ Class<? extends MockApplication> applicationClass = application.getClass();
+ Field field = applicationClass.getDeclaredField("expressionFactory");
+ field.setAccessible(true);
+ field.set(application, exprFact);
+ expressionFactory = application.getExpressionFactory();
+ } catch(Exception e) {
+ //e.printStackTrace();
+ //We cannot set private field
+ }
/*
* Don't know yet how to support enums
*
Show replies by date