1   /*
2    * Copyright 2001-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.portletbridge.portlet;
17  
18  import java.net.URI;
19  
20  import junit.framework.TestCase;
21  
22  public class ResolveTest extends TestCase {
23  
24      public ResolveTest(String arg0) {
25          super(arg0);
26      }
27      
28      public void testResolve() throws Throwable {
29          URI uri = new URI("http://www.nscorp.com/");
30          URI resolvedUri = uri.resolve("/nscorp/application?pageid=Employees&category=Employees&title=Employee+Resource+Center");
31          assertNotNull(resolvedUri);
32      }
33      
34      public void testYourResolve() throws Throwable {
35          URI uri = new URI("http://emu.atldc.nscorp.com:8011/EOLStoreWeb/init.do");
36          URI resolvedUri = uri.resolve("getItemList.do?searchResults=A");
37          assertNotNull(resolvedUri);
38          assertEquals("http://emu.atldc.nscorp.com:8011/EOLStoreWeb/getItemList.do?searchResults=A", resolvedUri.toString());
39      }
40  
41      protected void setUp() throws Exception {
42          super.setUp();
43      }
44  
45      protected void tearDown() throws Exception {
46          super.tearDown();
47      }
48  
49  }