@@ -0,0 +1,2469 @@
+/*%0A * Copyright 2015 %22Masahiko Sakamoto%22 %3Csakamoto.gsyc.3s@gmail.com%3E%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 implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage javasnack.langspecs;%0A%0Aimport static org.testng.Assert.assertEquals;%0A%0Aimport java.net.MalformedURLException;%0Aimport java.net.URL;%0A%0Aimport org.testng.annotations.DataProvider;%0Aimport org.testng.annotations.Test;%0A%0A/**%0A * Convert relative URL to absolute URL by URL constructor.%0A * %0A * @see https://www.ietf.org/rfc/rfc2396.txt%0A * @see https://www.ietf.org/rfc/rfc7230.txt%0A */%0Apublic class TestURLNormalize1 %7B%0A%0A    @DataProvider(name = %22nomalizeSampleUrls%22)%0A    public Object%5B%5D%5B%5D getNomalizeSampleUrls() %7B%0A        return new Object%5B%5D%5B%5D %7B%0A                %7B %22http://www.example.com/%22, %22%22, %22http://www.example.com/%22 %7D,%0A                %7B %22http://www.example.com/%22, %22../../../../../../%22, %22http://www.example.com/../../%22 %7D,%0A                %7B %22http://www.example.com/a/b/c/%22, %22/d/e/f.html?p=%2520%250D%250A%22,%0A                        %22http://www.example.com/d/e/f.html?p=%2520%250D%250A%22 %7D,%0A                %7B %22http://www.example.com/a/b/c/%22, %22../../g/h/./../i/hello world.html?p=%2520%250D%250A%22,%0A                        %22http://www.example.com/a/g/i/hello world.html?p=%2520%250D%250A%22 %7D,%0A                %7B %22http://www.example.com/a/b/c/test.html%22, %22../../g/h/./../i/hello world.html?p=%2520%250D%250A%22,%0A                        %22http://www.example.com/a/g/i/hello world.html?p=%2520%250D%250A%22 %7D,%0A                %7B %22http://www.example.com/hello.html%22, %22/thanks.html;abc=def?p=%2520%250D%250A#def%22,%0A                        %22http://www.example.com/thanks.html;abc=def?p=%2520%250D%250A#def%22 %7D,%0A                %7B %22http://www.example.com/%22, %22/%22, %22http://www.example.com/%22 %7D %7D;%0A    %7D%0A%0A    @Test(dataProvider = %22nomalizeSampleUrls%22)%0A    public void testNormalizeSampleUrls(String ctx, String relative, String expected) throws MalformedURLException %7B%0A        URL ctxUrl = new URL(ctx);%0A        URL rUrl = new URL(ctxUrl, relative);%0A        assertEquals(rUrl.toExternalForm(), expected);%0A    %7D%0A%7D%0A

add URL conversion test code from relative to absolute path.