本文整理汇总了Java中javax.servlet.jsp.tagext.Tag.setParent方法的典型用法代码示例。如果您正苦于以下问题:Java Tag.setParent方法的具体用法?Java Tag.setParent怎么用?Java Tag.setParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.servlet.jsp.tagext.Tag
的用法示例。
在下文中一共展示了Tag.setParent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hasAncestorOfTypeTrueScenario
import javax.servlet.jsp.tagext.Tag; //导入方法依赖的package包/类
@Test
public void hasAncestorOfTypeTrueScenario() throws Exception {
Tag a = new TagA();
Tag b = new TagB();
Tag c = new TagC();
a.setParent(b);
b.setParent(c);
assertTrue(TagUtils.hasAncestorOfType(a, TagC.class));
}
示例2: hasAncestorOfTypeFalseScenario
import javax.servlet.jsp.tagext.Tag; //导入方法依赖的package包/类
@Test
public void hasAncestorOfTypeFalseScenario() throws Exception {
Tag a = new TagA();
Tag b = new TagB();
Tag anotherB = new TagB();
a.setParent(b);
b.setParent(anotherB);
assertFalse(TagUtils.hasAncestorOfType(a, TagC.class));
}
示例3: assertHasAncestorOfTypeThrowsExceptionOnFail
import javax.servlet.jsp.tagext.Tag; //导入方法依赖的package包/类
@Test(expected = IllegalStateException.class)
public void assertHasAncestorOfTypeThrowsExceptionOnFail() throws Exception {
Tag a = new TagA();
Tag b = new TagB();
Tag anotherB = new TagB();
a.setParent(b);
b.setParent(anotherB);
TagUtils.assertHasAncestorOfType(a, TagC.class, "a", "c");
}
示例4: testAssertHasAncestorOfTypeDoesNotThrowExceptionOnPass
import javax.servlet.jsp.tagext.Tag; //导入方法依赖的package包/类
@Test
public void testAssertHasAncestorOfTypeDoesNotThrowExceptionOnPass() throws Exception {
Tag a = new TagA();
Tag b = new TagB();
Tag c = new TagC();
a.setParent(b);
b.setParent(c);
TagUtils.assertHasAncestorOfType(a, TagC.class, "a", "c");
}