Fixing jsf setup interceptor to not complain so loudly if jsf isn't present, fixed freemarker

test to properly extend StrutsTestCase


git-svn-id: https://svn.apache.org/repos/asf/struts/action2/trunk@408140 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Donald J. Brown
2006-05-21 06:24:37 +00:00
parent a7d7706ec1
commit 449a451912
2 changed files with 12 additions and 4 deletions
@@ -57,8 +57,17 @@ public class FacesSetupInterceptor extends FacesSupport implements Interceptor {
* Initializes the lifecycle and factories
*/
public void init() {
facesContextFactory = (FacesContextFactory) FactoryFinder
try {
facesContextFactory = (FacesContextFactory) FactoryFinder
.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
} catch (Exception ex) {
log.debug("Unable to initialize faces", ex);
}
if (facesContextFactory == null) {
log.info("Unable to initialize jsf interceptors probably due missing JSF framework initialization");
return;
}
// Javadoc says: Lifecycle instance is shared across multiple
// simultaneous requests, it must be implemented in a thread-safe
// manner.
@@ -18,16 +18,15 @@
package org.apache.struts.action2.views.freemarker;
import org.apache.struts.action2.StrutsConstants;
import org.apache.struts.action2.StrutsTestCase;
import org.apache.struts.action2.config.Configuration;
import org.apache.struts.action2.views.jsp.StrutsMockServletContext;
import junit.framework.TestCase;
/**
* Test case for FreemarkerManager
*
*/
public class FreemarkerManagerTest extends TestCase {
public class FreemarkerManagerTest extends StrutsTestCase {
public void testIfStrutsEncodingIsSetProperty() throws Exception {
Configuration.set(StrutsConstants.STRUTS_I18N_ENCODING, "UTF-8");