01: /*
02: * soapUI, copyright (C) 2004-2007 eviware.com
03: *
04: * soapUI is free software; you can redistribute it and/or modify it under the
05: * terms of version 2.1 of the GNU Lesser General Public License as published by
06: * the Free Software Foundation.
07: *
08: * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
09: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: * See the GNU Lesser General Public License for more details at gnu.org.
11: */
12:
13: package com.eviware.soapui.impl.wsdl.support;
14:
15: import junit.framework.TestCase;
16:
17: import com.eviware.soapui.support.Tools;
18:
19: public class JoinRelativeUrlTestCase extends TestCase {
20: public void testJoin() throws Exception {
21: assertEquals("http://test:8080/my/root/test.xsd", Tools
22: .joinRelativeUrl("http://test:8080/my/root/test.wsdl",
23: "test.xsd"));
24: assertEquals("http://test:8080/my/root/bu/test.xsd", Tools
25: .joinRelativeUrl("http://test:8080/my/root/test.wsdl",
26: "bu/test.xsd"));
27: assertEquals("http://test:8080/my/test.xsd", Tools
28: .joinRelativeUrl("http://test:8080/my/root/test.wsdl",
29: "../test.xsd"));
30: assertEquals("http://test:8080/my/root/test.xsd", Tools
31: .joinRelativeUrl("http://test:8080/my/root/test.wsdl",
32: "./test.xsd"));
33: assertEquals("http://test:8080/bil/test.xsd", Tools
34: .joinRelativeUrl("http://test:8080/my/root/test.wsdl",
35: "../../bil/test.xsd"));
36: assertEquals("http://test:8080/bil/test.xsd", Tools
37: .joinRelativeUrl("http://test:8080/my/root/test.wsdl",
38: "././../../bil/test/.././test.xsd"));
39: assertEquals("file:c:\\bil\\xsd\\test.xsd", Tools
40: .joinRelativeUrl("file:c:\\bil\\test.wsdl",
41: "./xsd/test.xsd"));
42: assertEquals("file:c:\\bil\\xsd\\test.xsd", Tools
43: .joinRelativeUrl("file:c:\\bil\\test\\test\\test.wsdl",
44: "..\\..\\xsd\\test.xsd"));
45: }
46: }
|