Methods Summary |
---|
protected void | setUp()
super.setUp();
request.setScheme("http");
request.setServerName("localhost");
request.setServerPort(80);
tag = new AnchorTag();
tag.setPageContext(pageContext);
JspWriter jspWriter = new StrutsMockJspWriter(writer);
pageContext.setJspWriter(jspWriter);
|
public void | testAccessKey()
tag.setHref("TestAction.action");
tag.setAccesskey("T");
tag.doStartTag();
tag.doEndTag();
assertTrue(writer.toString().indexOf("accesskey=\"T\"") > -1);
assertFalse(writer.toString().endsWith("\n"));
|
public void | testActionURL()
tag.setHref("TestAction.action");
tag.doStartTag();
tag.doEndTag();
assertTrue(writer.toString().indexOf("href=\"TestAction.action\"") > -1);
assertEquals("<a href=\"TestAction.action\"></a>", writer.toString());
|
public void | testAddParameters()
tag.setHref("/TestAction.action");
String bodyText = "<img src=\"#\"/>";
StrutsBodyContent bodyContent = new StrutsBodyContent(null);
bodyContent.print(bodyText);
tag.setBodyContent(bodyContent);
tag.doStartTag();
tag.doEndTag();
|
public void | testId()
tag.setId("home&improvements");
tag.doStartTag();
tag.doEndTag();
assertEquals("<a id=\"home&improvements\"></a>", writer.toString());
assertFalse(writer.toString().endsWith("\n"));
|
public void | testNoNewLineAtEnd()
tag.setHref("TestAction.action");
tag.doStartTag();
tag.doEndTag();
assertFalse(writer.toString().endsWith("\n"));
|
public void | testOnMouseOver()
tag.setHref("TestAction.action");
tag.setOnmouseover("over");
tag.doStartTag();
tag.doEndTag();
assertTrue(writer.toString().indexOf("onmouseover=\"over\"") > -1);
assertFalse(writer.toString().endsWith("\n"));
|
public void | testOnMouseOverAndFocus()
tag.setHref("TestAction.action");
tag.setOnmouseover("overme");
tag.setOnfocus("focusme");
tag.doStartTag();
tag.doEndTag();
assertTrue(writer.toString().indexOf("onmouseover=\"overme\"") > -1);
assertTrue(writer.toString().indexOf("onfocus=\"focusme\"") > -1);
assertFalse(writer.toString().endsWith("\n"));
|
public void | testTitle()
tag.setHref("home.ftl");
tag.setTitle("home & improvements");
tag.doStartTag();
tag.doEndTag();
assertEquals("<a href=\"home.ftl\" title=\"home & improvements\"></a>", writer.toString());
assertFalse(writer.toString().endsWith("\n"));
|
public void | testWithContent()
tag.setHref("TestAction.action");
tag.doStartTag();
writer.write("Home");
tag.doEndTag();
assertEquals("<a href=\"TestAction.action\">Home</a>", writer.toString());
assertFalse(writer.toString().endsWith("\n"));
|