1 15 package org.apache.tapestry.junit; 16 17 import org.apache.tapestry.engine.ILink; 18 import org.apache.tapestry.link.StaticLink; 19 20 26 27 public class TestStaticLink extends TapestryTestCase 28 { 29 private static final String URL = "http://host/path"; 30 31 ILink l = new StaticLink(URL); 32 33 public void testURL() 34 { 35 assertEquals(URL, l.getURL()); 36 } 37 38 public void testAbsoluteURL() 39 { 40 assertEquals(URL, l.getAbsoluteURL()); 41 } 42 43 public void testURLWithAnchor() 44 { 45 assertEquals(URL, l.getURL(null, false)); 46 assertEquals(URL + "#anchor", l.getURL("anchor", false)); 47 assertEquals(URL + "#feeble", l.getURL("feeble", true)); 48 } 49 50 public void testAbsoluteURLWithParameters() 51 { 52 assertEquals(URL + "#anchor", l.getAbsoluteURL("scheme", "server", 8080, "anchor", false)); 53 } 54 55 public void testGetParameterNames() 56 { 57 assertEquals(null, l.getParameterNames()); 58 } 59 60 public void testGetParameterValues() 61 { 62 try 63 { 64 l.getParameterValues("any"); 65 66 unreachable(); 67 } 68 catch (IllegalArgumentException ex) 69 { 70 } 71 } 72 } 73 | Popular Tags |