Author: hlship Date: Wed Mar 2 01:59:49 2011 New Revision: 1076085 URL: http://svn.apache.org/viewvc?rev=1076085&view=rev Log: TAP5-1453: Remove URLRewriter and related classes and tests
Removed: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/URLRewriterImpl.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/URLRewriterLinkEncoderInterceptor.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/URLRewriterRequestFilter.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/URLRewriter.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/RewriteRuleApplicability.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/SimpleRequestWrapper.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/URLRewriteContext.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/URLRewriterRule.java tapestry/tapestry5/trunk/tapestry-core/src/test/app5/Dummy.tml tapestry/tapestry5/trunk/tapestry-core/src/test/app5/Index.tml tapestry/tapestry5/trunk/tapestry-core/src/test/app5/RewriteSuccess2.tml tapestry/tapestry5/trunk/tapestry-core/src/test/app5/RewriteWithContext.tml tapestry/tapestry5/trunk/tapestry-core/src/test/app5/URLRewriteSuccess.tml tapestry/tapestry5/trunk/tapestry-core/src/test/app5/WEB-INF/web.xml tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app5/pages/Dummy.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app5/pages/Index.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app5/pages/RewriteSuccess2.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app5/pages/RewriteWithContext.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app5/pages/URLRewriteSuccess.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app5/services/AppModule.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/URLRewriterRequestFilterTest.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/urlrewriter/IntegrationTests.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/urlrewriter/SimpleRequestWrapperTest.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng.xml tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PageRenderLinkSourceImplTest.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java?rev=1076085&r1=1076084&r2=1076085&view=diff ============================================================================== --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java Wed Mar 2 01:59:49 2011 @@ -200,7 +200,6 @@ import org.apache.tapestry5.ioc.internal import org.apache.tapestry5.ioc.services.Builtin; import org.apache.tapestry5.ioc.services.ChainBuilder; import org.apache.tapestry5.ioc.services.ClassFactory; -import org.apache.tapestry5.ioc.services.ClasspathURLConverter; import org.apache.tapestry5.ioc.services.Coercion; import org.apache.tapestry5.ioc.services.CoercionTuple; import org.apache.tapestry5.ioc.services.LazyAdvisor; @@ -489,7 +488,6 @@ public final class TapestryModule binder.bind(ComponentEventLinkEncoder.class, ComponentEventLinkEncoderImpl.class); binder.bind(PageRenderLinkSource.class, PageRenderLinkSourceImpl.class); binder.bind(ClientInfrastructure.class, ClientInfrastructureImpl.class); - binder.bind(URLRewriter.class, URLRewriterImpl.class); binder.bind(ValidatorMacro.class, ValidatorMacroImpl.class); binder.bind(PropertiesFileParser.class, PropertiesFileParserImpl.class); binder.bind(PageActivator.class, PageActivatorImpl.class); @@ -1008,6 +1006,8 @@ public final class TapestryModule * <dt>StoreIntoGlobals</dt> * <dd>Stores the request and response into the {@link org.apache.tapestry5.services.RequestGlobals} service (this * is repeated at the end of the pipeline, in case any filter substitutes the request or response). + * <dt>EndOfRequest</dt> + * <dd>Notifies internal services that the request has ended</dd> * </dl> */ public void contributeRequestHandler(OrderedConfiguration<RequestFilter> configuration, Context context, @@ -1020,9 +1020,7 @@ public final class TapestryModule @IntermediateType(TimeInterval.class) long updateTimeout, - UpdateListenerHub updateListenerHub, - - URLRewriter urlRewriter) + UpdateListenerHub updateListenerHub) { RequestFilter staticFilesFilter = new StaticFilesFilter(context); @@ -1054,16 +1052,6 @@ public final class TapestryModule configuration.add("CheckForUpdates", new CheckForUpdatesFilter(updateListenerHub, checkInterval, updateTimeout), "before:*"); - // we just need the URLRewriterRequestFilter if we have URL rewriter - // rules, of course. - if (urlRewriter.hasRequestRules()) - { - - URLRewriterRequestFilter urlRewriterRequestFilter = new URLRewriterRequestFilter(urlRewriter); - configuration.add("URLRewriter", urlRewriterRequestFilter, "before:StaticFiles"); - - } - configuration.add("StaticFiles", staticFilesFilter); configuration.addInstance("ErrorFilter", RequestErrorFilter.class); @@ -2802,20 +2790,6 @@ public final class TapestryModule } /** - * @throws Exception - * @since 5.1.0.2 - */ - public static ComponentEventLinkEncoder decorateComponentEventLinkEncoder(ComponentEventLinkEncoder encoder, - URLRewriter urlRewriter, Request request, Response response) - { - // no rules, no link rewriting. - if (!urlRewriter.hasLinkRules()) - return null; - - return new URLRewriterLinkEncoderInterceptor(urlRewriter, request, encoder); - } - - /** * Decorate FieldValidatorDefaultSource to setup the EnvironmentMessages * object and place it in the environment. * Although this could have been implemented directly in the default Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng.xml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng.xml?rev=1076085&r1=1076084&r2=1076085&view=diff ============================================================================== --- tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng.xml (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng.xml Wed Mar 2 01:59:49 2011 @@ -1,14 +1,12 @@ <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> -<!-- Copyright 2008, 2009 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. --> - -<!-- The suite may no longer be run in parallel, because of some tricky issues related to locking of - class loaders. Running in parallel causes thread deadlocks, when unmanaged tests run at the same time - as Selenium-based integration tests. See TAPESTRY-2561. --> +<!-- Copyright 2008, 2009 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. --> + +<!-- The suite may no longer be run in parallel, because of some tricky issues related to locking of class loaders. Running + in parallel causes thread deadlocks, when unmanaged tests run at the same time as Selenium-based integration tests. See TAPESTRY-2561. --> <suite name="Tapestry Core" annotations="1.5" verbose="2"> <test name="Component Unit Tests" enabled="true"> <packages> @@ -72,14 +70,6 @@ </packages> </test> - <test name="URL Rewriter Tests" enabled="true"> - <parameter name="tapestry.web-app-folder" value="src/test/app5"/> - - <packages> - <package name="org.apache.tapestry5.urlrewriter"/> - </packages> - </test> - <test name="Live Reload Tests" enabled="true"> <packages> <package name="org.apache.tapestry5.integration.reload"/> Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PageRenderLinkSourceImplTest.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PageRenderLinkSourceImplTest.java?rev=1076085&r1=1076084&r2=1076085&view=diff ============================================================================== --- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PageRenderLinkSourceImplTest.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PageRenderLinkSourceImplTest.java Wed Mar 2 01:59:49 2011 @@ -1,4 +1,4 @@ -// Copyright 2009 The Apache Software Foundation +// Copyright 2009, 2011 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. @@ -14,13 +14,12 @@ package org.apache.tapestry5.internal.services; -import org.apache.tapestry5.integration.app5.pages.Index; +import org.apache.tapestry5.EventContext; +import org.apache.tapestry5.Link; +import org.apache.tapestry5.integration.app3.pages.Index; import org.apache.tapestry5.internal.test.InternalBaseTestCase; import org.apache.tapestry5.services.ComponentClassResolver; import org.apache.tapestry5.services.PageRenderLinkSource; -import org.apache.tapestry5.Link; -import org.apache.tapestry5.EventContext; -import org.apache.tapestry5.ioc.services.TypeCoercer; import org.testng.annotations.Test; public class PageRenderLinkSourceImplTest extends InternalBaseTestCase