You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2006/03/03 02:39:37 UTC

svn commit: r382609 - in /myfaces/tomahawk/trunk/core/src: main/java/org/apache/myfaces/component/html/util/ExtensionsFilter.java test/java/org/apache/myfaces/shared_tomahawk/renderkit/html/util/AddResourceTest.java

Author: mmarinschek
Date: Thu Mar  2 17:39:36 2006
New Revision: 382609

URL: http://svn.apache.org/viewcvs?rev=382609&view=rev
Log:
reapplied Mario's changes to resource handling (lost due to merging)

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/shared_tomahawk/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=382609&r1=382608&r2=382609&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 Mar  2 17:39:36 2006
@@ -141,7 +141,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/shared_tomahawk/renderkit/html/util/AddResourceTest.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/shared_tomahawk/renderkit/html/util/AddResourceTest.java?rev=382609&r1=382608&r2=382609&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/shared_tomahawk/renderkit/html/util/AddResourceTest.java (original)
+++ myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/shared_tomahawk/renderkit/html/util/AddResourceTest.java Thu Mar  2 17:39:36 2006
@@ -31,6 +31,8 @@
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.io.Writer;
+import java.util.Map;
+import java.util.LinkedHashMap;
 
 /**
  * Unit test for the AddResource class which can output script, style and inline
@@ -40,14 +42,18 @@
 {
     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);
-        assertSame(instance1, instance1a);
+        AddResource instance1a = AddResourceFactory.getInstance(cacheMap, "/test1", null);
     }
 
     public void setUp()
@@ -170,7 +176,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
@@ -201,7 +207,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);