myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r380194 - in /myfaces/tomahawk/trunk/core/src: main/java/org/apache/myfaces/component/html/util/ExtensionsFilter.java test/java/org/apache/myfaces/renderkit/html/util/AddResourceTest.java
Date Thu, 23 Feb 2006 18:41:39 GMT
Author: imario
Date: Thu Feb 23 10:41:36 2006
New Revision: 380194

URL: http://svn.apache.org/viewcvs?rev=380194&view=rev
Log:
TOMAHAWK-108: made AddResource request scope so it is
request safe now

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/util/ExtensionsFilter.java
    myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/renderkit/html/util/AddResourceTest.java

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/util/ExtensionsFilter.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/util/ExtensionsFilter.java?rev=380194&r1=380193&r2=380194&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/util/ExtensionsFilter.java
(original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/util/ExtensionsFilter.java
Thu Feb 23 10:41:36 2006
@@ -137,7 +137,7 @@
             addResource.writeMyFacesJavascriptBeforeBodyEnd(extendedRequest,
                     servletResponse);
 
-            if( ! addResource.hasHeaderBeginInfos(extendedRequest) ){
+            if( ! addResource.hasHeaderBeginInfos() ){
                 // writes the response if no header info is needed
                 addResource.writeResponse(extendedRequest, servletResponse);
                 return;

Modified: myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/renderkit/html/util/AddResourceTest.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/renderkit/html/util/AddResourceTest.java?rev=380194&r1=380193&r2=380194&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/renderkit/html/util/AddResourceTest.java
(original)
+++ myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/renderkit/html/util/AddResourceTest.java
Thu Feb 23 10:41:36 2006
@@ -19,6 +19,8 @@
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.io.Writer;
+import java.util.LinkedHashMap;
+import java.util.Map;
 
 import javax.faces.FactoryFinder;
 import javax.faces.context.FacesContext;
@@ -42,13 +44,17 @@
 {
     public void testGetInstance()
     {
-        AddResource instance1 = AddResourceFactory.getInstance("/test1", null);
+    	Map cacheMap = new LinkedHashMap();
+    	
+        AddResource instance1 = AddResourceFactory.getInstance(cacheMap, "/test1", null);
         assertNotNull(instance1);
 
-        AddResource instance2 = AddResourceFactory.getInstance("/test2", null);
+        /* no longer true
+        AddResource instance2 = AddResourceFactory.getInstance(null, "/test2", null);
         assertNotSame(instance1, instance2);
+        */
 
-        AddResource instance1a = AddResourceFactory.getInstance("/test1", null);
+        AddResource instance1a = AddResourceFactory.getInstance(cacheMap, "/test1", null);
         assertSame(instance1, instance1a);
     }
 
@@ -172,7 +178,7 @@
         mockState.setup();
 
         // now start the test
-        AddResource instance1 = AddResourceFactory.getInstance("/test", null);
+        AddResource instance1 = AddResourceFactory.getInstance(null, "/test", null);
         instance1.addJavaScriptHere(mockState._facesContext, "/scripts/script1");
 
         // verify that our mock objects got the expected callbacks
@@ -203,7 +209,7 @@
         String originalResponse =
             "<html><head></head><body></body></html>";
 
-        AddResource ar = AddResourceFactory.getInstance("/test", null);
+        AddResource ar = AddResourceFactory.getInstance(null, "/test", null);
         ar.parseResponse(mockState._servletRequest,originalResponse,mockState._servletResponse);
         ar.writeWithFullHeader(mockState._servletRequest,mockState._servletResponse);
         ar.writeResponse(mockState._servletRequest,mockState._servletResponse);



Mime
View raw message