Author: freemant
Date: Fri Feb 23 07:19:20 2007
New Revision: 510977

URL: http://svn.apache.org/viewvc?view=rev&rev=510977
Log:
Fixed TAPESTRY-1279

Added:
    
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForHead.java
   (with props)
    
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/pagelevel/HeadTest.java
   (with props)
    
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForHead.html
   (with props)
Modified:
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ClasspathAssetAliasManagerImpl.java
    
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/TapestryModule.java

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ClasspathAssetAliasManagerImpl.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ClasspathAssetAliasManagerImpl.java?view=diff&rev=510977&r1=510976&r2=510977
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ClasspathAssetAliasManagerImpl.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ClasspathAssetAliasManagerImpl.java
 Fri Feb 23 07:19:20 2007
@@ -24,11 +24,10 @@
 
 import org.apache.tapestry.TapestryConstants;
 import org.apache.tapestry.services.ClasspathAssetAliasManager;
-import org.apache.tapestry.services.Request;
 
 public class ClasspathAssetAliasManagerImpl implements 
ClasspathAssetAliasManager
 {
-    private final Request _request;
+    private final ContextPathSource _contextPathSource;
 
     /** Map from alias to path. */
     private final Map<String, String> _aliasToPathPrefix;
@@ -46,10 +45,10 @@
      * 
      * @param configuration
      */
-    public ClasspathAssetAliasManagerImpl(Request request,
+    public ClasspathAssetAliasManagerImpl(ContextPathSource contextPathSource,
             final Map<String, String> configuration)
     {
-        _request = request;
+        _contextPathSource = contextPathSource;
 
         _aliasToPathPrefix = configuration;
 
@@ -75,7 +74,7 @@
 
     public String toClientURL(String resourcePath)
     {
-        StringBuilder builder = new StringBuilder(_request.getContextPath());
+        StringBuilder builder = new 
StringBuilder(_contextPathSource.getContextPath());
         builder.append(TapestryConstants.ASSET_PATH_PREFIX);
 
         for (String pathPrefix : _sortedPathPrefixes)

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/TapestryModule.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/TapestryModule.java?view=diff&rev=510977&r1=510976&r2=510977
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/TapestryModule.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/TapestryModule.java
 Fri Feb 23 07:19:20 2007
@@ -1084,10 +1084,11 @@
         return new ResourceDigestGeneratorImpl();
     }
 
-    public ClasspathAssetAliasManager buildClasspathAssetAliasManager(
-            Map<String, String> configuration)
+    public static ClasspathAssetAliasManager buildClasspathAssetAliasManager(
+            @InjectService("tapestry.internal.ContextPathSource")
+            ContextPathSource contextPathSource, Map<String, String> 
configuration)
     {
-        return new ClasspathAssetAliasManagerImpl(_request, configuration);
+        return new ClasspathAssetAliasManagerImpl(contextPathSource, 
configuration);
     }
 
     public static void contributeClasspathAssetAliasManager(

Added: 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForHead.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForHead.java?view=auto&rev=510977
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForHead.java
 (added)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForHead.java
 Fri Feb 23 07:19:20 2007
@@ -0,0 +1,21 @@
+// Copyright 2006, 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.integration.app2.pages;
+
+
+public class TestPageForHead
+{
+
+}

Propchange: 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/TestPageForHead.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/pagelevel/HeadTest.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/pagelevel/HeadTest.java?view=auto&rev=510977
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/pagelevel/HeadTest.java
 (added)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/pagelevel/HeadTest.java
 Fri Feb 23 07:19:20 2007
@@ -0,0 +1,45 @@
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.integration.pagelevel;
+
+import org.apache.tapestry.dom.Document;
+import org.apache.tapestry.test.pagelevel.PageTester;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
+
+public class HeadTest extends Assert
+{
+    private PageTester _tester;
+
+    @Test
+    public void display()
+    {
+        String appPackage = "org.apache.tapestry.integration.app2";
+        String appName = "";
+        _tester = new PageTester(appPackage, appName);
+        Document doc = _tester.renderPage("TestPageForHead");
+        assertTrue(doc.toString().contains("OK"));
+    }
+
+    @AfterMethod
+    public void after()
+    {
+        if (_tester != null)
+        {
+            _tester.shutdown();
+        }
+    }
+}

Propchange: 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/pagelevel/HeadTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForHead.html
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForHead.html?view=auto&rev=510977
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForHead.html
 (added)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForHead.html
 Fri Feb 23 07:19:20 2007
@@ -0,0 +1,8 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
+<head>
+       <title>testing</title>
+</head>
+<body>
+<p>OK!</p>
+</body>
+</html>

Propchange: 
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForHead.html
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to