@@ -0,0 +1,2667 @@
+/* Copyright 2007 Alin Dreghiciu.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or%0A * implied.%0A *%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.ops4j.pax.web.service.internal.util;%0A%0Aimport static org.junit.Assert.*;%0Aimport org.junit.Test;%0Aimport org.ops4j.pax.web.service.internal.util.Path;%0A%0Apublic class PathTest%0A%7B%0A%0A    /**%0A     * Tests that a request with null with not crash with NPE and it returns null.%0A     */%0A    @Test%0A    public void replaceSlashesWithNull()%0A    %7B%0A        assertEquals( %22Replaced%22, null, Path.replaceSlashes( null ) );%0A    %7D%0A    %0A    /**%0A     * Tests that a request with nothing to be replaced will return the same string.%0A     */%0A    @Test%0A    public void replaceSlashes01()%0A    %7B%0A        assertEquals( %22Replaced%22, %22/foo/bar/%22, Path.replaceSlashes( %22/foo/bar/%22 ) );%0A    %7D%0A%0A    /**%0A     * Tests that a request that contains only a slash is replaced correctly.%0A     */%0A    @Test%0A    public void replaceSlashes02()%0A    %7B%0A        assertEquals( %22Replaced%22, %22/%22, Path.replaceSlashes( %22/%22 ) );%0A    %7D%0A%0A    /**%0A     * Tests that a request that contains only slashes is replaced correctly.%0A     */%0A    @Test%0A    public void replaceSlashes03()%0A    %7B%0A        assertEquals( %22Replaced%22, %22/%22, Path.replaceSlashes( %22/////%22 ) );%0A    %7D%0A%0A    /**%0A     * Tests that a request that starts slashes is replaced correctly.%0A     */%0A    @Test%0A    public void replaceSlashes04()%0A    %7B%0A        assertEquals( %22Replaced%22, %22/foo/bar%22, Path.replaceSlashes( %22///foo/bar%22 ) );%0A    %7D%0A%0A    /**%0A     * Tests that a request that ends with slashes is replaced correctly.%0A     */%0A    @Test%0A    public void replaceSlashes05()%0A    %7B%0A        assertEquals( %22Replaced%22, %22foo/bar/%22, Path.replaceSlashes( %22foo/bar///%22 ) );%0A    %7D%0A%0A    /**%0A     * Tests that a request that contains slashes is replaced correctly.%0A     */%0A    @Test%0A    public void replaceSlashes06()%0A    %7B%0A        assertEquals( %22Replaced%22, %22foo/bar%22, Path.replaceSlashes( %22foo////bar%22 ) );%0A    %7D%0A%0A    /**%0A     * Tests that a request that various cobinations of slashes is replaced correctly.%0A     */%0A    @Test%0A    public void replaceSlashes07()%0A    %7B%0A        assertEquals( %22Replaced%22, %22/foo/bar/car/%22, Path.replaceSlashes( %22/foo////bar//car//%22 ) );%0A    %7D%0A%0A%7D%0A

move utility classes to their own package