@@ -0,0 +1,2062 @@
+/*%0D%0A * Copyright 2011 %3Ca href=%22mailto:fabmars@gmail.com%22%3EFabien Marsaud%3C/a%3E%0D%0A *%0D%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0D%0A * you may not use this file except in compliance with the License.%0D%0A * You may obtain a copy of the License at%0D%0A *%0D%0A *     http://www.apache.org/licenses/LICENSE-2.0%0D%0A *%0D%0A * Unless required by applicable law or agreed to in writing, software%0D%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0D%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0D%0A * See the License for the specific language governing permissions and%0D%0A * limitations under the License.%0D%0A */%0D%0Apackage org.ocpsoft.rewrite.servlet.config;%0D%0A%0D%0Aimport javax.servlet.http.HttpServletRequest;%0D%0A%0D%0Aimport org.junit.Assert;%0D%0Aimport org.junit.Before;%0D%0Aimport org.junit.Test;%0D%0Aimport org.mockito.Mockito;%0D%0Aimport org.ocpsoft.rewrite.event.Rewrite;%0D%0Aimport org.ocpsoft.rewrite.mock.MockEvaluationContext;%0D%0Aimport org.ocpsoft.rewrite.servlet.impl.HttpOutboundRewriteImpl;%0D%0Aimport org.ocpsoft.urlbuilder.AddressBuilder;%0D%0A%0D%0A/**%0D%0A * @author %3Ca href=%22mailto:fabmars@gmail.com%22%3EFabien Marsaud%3C/a%3E%0D%0A * %0D%0A */%0D%0Apublic class NoPathTest%0D%0A%7B%0D%0A   private Rewrite outboundDryDomain;%0D%0A   private Rewrite outboundLoneAnchor;%0D%0A   private HttpServletRequest request;%0D%0A%0D%0A   @Before%0D%0A   public void before()%0D%0A   %7B%0D%0A      request = Mockito.mock(HttpServletRequest.class);%0D%0A%0D%0A      outboundDryDomain = new HttpOutboundRewriteImpl(request, null, null,%0D%0A               AddressBuilder.create(%22http://ocpsoft.org%22)); // No trailing slash on purpose%0D%0A      outboundLoneAnchor = new HttpOutboundRewriteImpl(request, null, null,%0D%0A          AddressBuilder.create(%22#subsection%22));%0D%0A   %7D%0D%0A%0D%0A   @Test%0D%0A   public void testDomainNoPath() throws Exception%0D%0A   %7B%0D%0A      Assert.assertFalse(Path.matches(%22%22).evaluate(outboundDryDomain, new MockEvaluationContext()));%0D%0A   %7D%0D%0A%0D%0A   @Test%0D%0A   public void testLoneAnchor() throws Exception%0D%0A   %7B%0D%0A      Assert.assertFalse(Path.matches(%22%22).evaluate(outboundLoneAnchor, new MockEvaluationContext()));%0D%0A   %7D%0D%0A%0D%0A%7D%0D%0A

Test case for https://github.com/ocpsoft/rewrite/issues/117