Methods Summary |
---|
private java.lang.String | doTokenTest(java.lang.String tokenName, TokenTag tag)
tag.setPageContext(pageContext);
String token = null;
try {
tag.doStartTag();
tag.doEndTag();
token = (String) context.get(tokenName);
assertNotNull(token);
assertEquals(token, pageContext.getSession().getAttribute(tokenName));
} catch (JspException e) {
e.printStackTrace();
fail();
}
return token;
|
public void | testDefaultName()
String tokenName = TokenHelper.DEFAULT_TOKEN_NAME;
TokenTag tag = new TokenTag();
doTokenTest(tokenName, tag);
|
public void | testMultipleTagsWithSameName()
String tokenName = "sameName";
TokenTag tag = new TokenTag();
tag.setName(tokenName);
String token = doTokenTest(tokenName, tag);
TokenTag anotherTag = new TokenTag();
anotherTag.setName(tokenName);
String anotherToken = doTokenTest(tokenName, anotherTag);
assertEquals(token, anotherToken);
|
public void | testNotFindableName()WW-480
String tokenName = "foo";
TokenTag tag = new TokenTag();
tag.setName(tokenName);
doTokenTest(tokenName, tag);
String s = writer.toString();
assertTrue(s.indexOf("name=\"" + TokenHelper.DEFAULT_TOKEN_NAME) > -1);
assertTrue(s.indexOf("value=\"" + tokenName + "\"") > -1);
assertTrue(s.indexOf("name=\"" + tokenName + "\"") > -1);
//System.out.println(s);
|
public void | testSuppliedName()
String tokenName = "my.very.long.token.name";
TokenTag tag = new TokenTag();
tag.setName(tokenName);
doTokenTest(tokenName, tag);
|