You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2005/08/29 19:19:45 UTC
DO NOT REPLY [Bug 36409] -
Testcases test protected method of some struts classes, may fail in some setup due to classloading
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36409>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=36409
------- Additional Comments From coltzhao@yahoo.com 2005-08-29 19:19 -------
Index: src/test/org/apache/struts/taglib/logic/TestGreaterThanTag.java
===================================================================
--- src/test/org/apache/struts/taglib/logic/TestGreaterThanTag.java
(revision 31303)
+++ src/test/org/apache/struts/taglib/logic/TestGreaterThanTag.java
(revision 31304)
@@ -113,13 +113,19 @@
*/
public void testHeaderGreaterThan() throws ServletException, JspException {
GreaterThanTag gt = new GreaterThanTag();
+
+ boolean testCondition = false;
+
gt.setPageContext(pageContext);
gt.setHeader(HEADER_KEY);
gt.setValue(LESSER_VAL);
+ if (gt.doStartTag()==gt.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Header Value (" + GREATER_VAL + ") is greater than value (" +
LESSER_VAL + ")",
- gt.condition());
+ testCondition);
}
/**
@@ -127,13 +133,19 @@
*/
public void testParameterGreaterThan() throws ServletException, JspException {
GreaterThanTag gt = new GreaterThanTag();
+
+ boolean testCondition = false;
+
gt.setPageContext(pageContext);
gt.setParameter(PARAMETER_KEY);
gt.setValue(LESSER_VAL);
+ if (gt.doStartTag()==gt.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Parameter Value (" + GREATER_VAL + ") is greater than value ("
+ LESSER_VAL + ")",
- gt.condition());
+ testCondition);
}
@@ -144,6 +156,8 @@
public void testApplicationScopeNameGreaterThan()
throws ServletException, JspException {
+ boolean testCondition = false;
+
GreaterThanTag gt = new GreaterThanTag();
String testKey = "testApplicationScopeNameGreaterThan";
@@ -155,9 +169,12 @@
gt.setScope("application");
gt.setValue(LESSER_VAL);
+ if (gt.doStartTag()==gt.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Application scope value from name (" + GREATER_VAL + ") is
greater than value (" + LESSER_VAL + ")",
- gt.condition());
+ testCondition);
}
/**
@@ -167,6 +184,8 @@
public void testSessionScopeNameGreaterThan()
throws ServletException, JspException {
+ boolean testCondition = false;
+
GreaterThanTag gt = new GreaterThanTag();
String testKey = "testSessionScopeNameGreaterThan";
@@ -178,9 +197,12 @@
gt.setScope("session");
gt.setValue(LESSER_VAL);
+ if (gt.doStartTag()==gt.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Session scope value from name (" + GREATER_VAL + ") is greater
than value (" + LESSER_VAL + ")",
- gt.condition());
+ testCondition);
}
/**
@@ -190,6 +212,8 @@
public void testRequestScopeNameGreaterThan()
throws ServletException, JspException {
+ boolean testCondition = false;
+
GreaterThanTag gt = new GreaterThanTag();
String testKey = "testRequestScopeNameGreaterThan";
@@ -201,9 +225,12 @@
gt.setScope("request");
gt.setValue(LESSER_VAL);
+ if (gt.doStartTag()==gt.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Request scope value from name (" + GREATER_VAL + ") is greater
than value (" + LESSER_VAL + ")",
- gt.condition());
+ testCondition);
}
@@ -216,6 +243,8 @@
public void testApplicationScopePropertyGreaterThan()
throws ServletException, JspException {
+ boolean testCondition = false;
+
GreaterThanTag gt = new GreaterThanTag();
String testKey = "testApplicationScopePropertyGreaterThan";
@@ -228,9 +257,12 @@
gt.setProperty("value");
gt.setValue(LESSER_VAL);
+ if (gt.doStartTag()==gt.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Value (" + LESSER_VAL + ") is greater than value (" +
GREATER_VAL + ")",
- gt.condition());
+ testCondition);
}
/**
@@ -240,6 +272,8 @@
public void testSessionScopePropertyGreaterThan()
throws ServletException, JspException {
+ boolean testCondition = false;
+
GreaterThanTag gt = new GreaterThanTag();
String testKey = "testSessionScopePropertyGreaterThan";
@@ -252,9 +286,12 @@
gt.setProperty("value");
gt.setValue(LESSER_VAL);
+ if (gt.doStartTag()==gt.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Value (" + LESSER_VAL + ") is greater than value (" +
GREATER_VAL + ")",
- gt.condition());
+ testCondition);
}
/**
@@ -264,6 +301,8 @@
public void testRequestScopePropertyGreaterThan()
throws ServletException, JspException {
+ boolean testCondition = false;
+
GreaterThanTag gt = new GreaterThanTag();
String testKey = "testRequestScopePropertyGreaterThan";
@@ -276,9 +315,12 @@
gt.setProperty("value");
gt.setValue(LESSER_VAL);
+ if (gt.doStartTag()==gt.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Value (" + LESSER_VAL + ") is greater than value (" +
GREATER_VAL + ")",
- gt.condition());
+ testCondition);
}
Index: src/test/org/apache/struts/taglib/logic/TestEqualTag.java
===================================================================
--- src/test/org/apache/struts/taglib/logic/TestEqualTag.java (revision 31303)
+++ src/test/org/apache/struts/taglib/logic/TestEqualTag.java (revision 31304)
@@ -126,11 +126,16 @@
public void testCookieStringNotEquals()
throws ServletException, JspException {
+ boolean testCondition =false;
+
et.setCookie(COOKIE_KEY);
et.setValue(testStringValue1);
+
+ if (et.doStartTag()==et.EVAL_BODY_INCLUDE)
+ testCondition = true;
assertEquals("Cookie string not equals comparison", false,
- et.condition(0, 0));
+ testCondition);
}
@@ -147,12 +152,17 @@
public void testHeaderStringEquals()
throws ServletException, JspException {
+
+ boolean testCondition =false;
et.setHeader(HEADER_KEY);
et.setValue(testStringValue);
+ if (et.doStartTag()==et.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertEquals("Header string equals comparison", true,
- et.condition(0, 0));
+ testCondition);
}
@@ -170,11 +180,16 @@
public void testHeaderStringNotEquals()
throws ServletException, JspException {
+ boolean testCondition =false;
+
et.setHeader(HEADER_KEY);
et.setValue(testStringValue1);
+ if (et.doStartTag()==et.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertEquals("Header string not equals comparison", false,
- et.condition(0, 0));
+ testCondition);
}
@@ -185,12 +200,17 @@
public void testIntegerEquals()
throws ServletException, JspException {
+ boolean testCondition =false;
+
request.setAttribute(testIntegerKey, testIntegerValue);
et.setName(testIntegerKey);
et.setValue(testIntegerValue.toString());
+
+ if (et.doStartTag()==et.EVAL_BODY_INCLUDE)
+ testCondition = true;
assertEquals("Integer equals comparison", true,
- et.condition(0, 0));
+ testCondition);
}
@@ -201,12 +221,17 @@
public void testIntegerNotEquals()
throws ServletException, JspException {
+ boolean testCondition =false;
+
request.setAttribute(testIntegerKey, testIntegerValue);
et.setName(testIntegerKey);
et.setValue(testIntegerValue1.toString());
+
+ if (et.doStartTag()==et.EVAL_BODY_INCLUDE)
+ testCondition = true;
assertEquals("Integer not equals comparison", false,
- et.condition(0, 0));
+ testCondition);
}
@@ -224,11 +249,16 @@
public void testParameterStringEquals()
throws ServletException, JspException {
+ boolean testCondition =false;
+
et.setParameter(PARAMETER_KEY);
et.setValue(testStringValue);
+ if (et.doStartTag()==et.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertEquals("Parameter string equals comparison", true,
- et.condition(0, 0));
+ testCondition);
}
@@ -246,11 +276,16 @@
public void testParameterStringNotEquals()
throws ServletException, JspException {
+ boolean testCondition =false;
+
et.setParameter(PARAMETER_KEY);
et.setValue(testStringValue1);
+ if (et.doStartTag()==et.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertEquals("Parameter string not equals comparison", false,
- et.condition(0, 0));
+ testCondition);
}
@@ -261,12 +296,17 @@
public void testStringEquals()
throws ServletException, JspException {
+ boolean testCondition =false;
+
request.setAttribute(testStringKey, testStringValue);
et.setName(testStringKey);
et.setValue(testStringValue);
+ if (et.doStartTag()==et.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertEquals("String equals comparison", true,
- et.condition(0, 0));
+ testCondition);
}
@@ -277,12 +317,17 @@
public void testStringNotEquals()
throws ServletException, JspException {
+ boolean testCondition =false;
+
request.setAttribute(testStringKey, testStringValue);
et.setName(testStringKey);
et.setValue(testStringValue1);
+
+ if (et.doStartTag()==et.EVAL_BODY_INCLUDE)
+ testCondition = true;
assertEquals("String not equals comparison", false,
- et.condition(0, 0));
+ testCondition);
}
Index: src/test/org/apache/struts/taglib/logic/TestNotEqualTag.java
===================================================================
--- src/test/org/apache/struts/taglib/logic/TestNotEqualTag.java
(revision 31303)
+++ src/test/org/apache/struts/taglib/logic/TestNotEqualTag.java
(revision 31304)
@@ -110,10 +110,15 @@
}
public void testCookieStringNotEquals() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
net.setCookie(COOKIE_KEY);
net.setValue(testStringValue1);
- assertEquals("Cookie string not equals comparison", false,
net.condition(0, 0));
+ if (net.doStartTag()==net.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("Cookie string not equals comparison", true, testCondition);
}
/**
@@ -124,10 +129,16 @@
}
public void testHeaderStringEquals() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
net.setHeader(COOKIE_KEY);
net.setValue(testStringValue);
+
+ if (net.doStartTag()==net.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Header string equals comparison", true, net.condition(0, 0));
+
+ assertEquals("Header string equals comparison", false, testCondition);
}
/**
@@ -138,10 +149,15 @@
}
public void testHeaderStringNotEquals() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
net.setHeader(COOKIE_KEY);
net.setValue(testStringValue1);
- assertEquals("Header string not equals comparison", false,
net.condition(0, 0));
+ if (net.doStartTag()==net.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("Header string not equals comparison", true, testCondition);
}
/**
@@ -152,10 +168,15 @@
}
public void testParameterStringEquals() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
net.setParameter(PARAMETER_KEY);
net.setValue(testStringValue);
- assertEquals("Parameter string equals comparison", true,
net.condition(0, 0));
+ if (net.doStartTag()==net.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("Parameter string equals comparison", false, testCondition);
}
/**
@@ -166,32 +187,47 @@
}
public void testParameterStringNotEquals() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
net.setParameter(PARAMETER_KEY);
net.setValue(testStringValue1);
- assertEquals("Parameter string not equals comparison", false,
net.condition(0, 0));
+ if (net.doStartTag()==net.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("Parameter string not equals comparison", true,
testCondition);
}
/**
* Verify that two <code>String</code>s match using the
<code>NotEqualTag</code>.
*/
public void testStringEquals() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
request.setAttribute(testStringKey, testStringValue);
net.setName(testStringKey);
net.setValue(testStringValue);
System.out.println("testing");
- assertEquals("String equals comparison", true, net.condition(0, 0));
+ if (net.doStartTag()==net.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("String equals comparison", false, testCondition);
}
/**
* Verify that two <code>String</code>s do not match using the
<code>NotEqualTag</code>.
*/
public void testStringNotEquals() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
request.setAttribute(testStringKey, testStringValue);
net.setName(testStringKey);
net.setValue(testStringValue1);
- assertEquals("String not equals comparison", false, net.condition(0, 0));
+ if (net.doStartTag()==net.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("String not equals comparison", true, testCondition);
}
/**
@@ -199,28 +235,40 @@
* match using the <code>NotEqualTag</code>.
*/
public void testIntegerEquals() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
request.setAttribute(testIntegerKey, testIntegerValue);
net.setName(testIntegerKey);
net.setValue(testIntegerValue.toString());
- assertEquals("Integer equals comparison", true, net.condition(0, 0));
+ if (net.doStartTag()==net.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("Integer equals comparison", false, testCondition);
}
/**
* Verify that two <code>String</code>s do not match using the
<code>NotEqualTag</code>.
*/
public void testIntegerNotEquals() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
request.setAttribute(testIntegerKey, testIntegerValue);
net.setName(testIntegerKey);
net.setValue(testIntegerValue1.toString());
- assertEquals("Integer equals comparison", false, net.condition(0, 0));
+ if (net.doStartTag()==net.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("Integer equals comparison", true, testCondition);
}
/**
* Verify that there is an application scope String in scope using the
<code>EqualTag</code>.
*/
public void testApplicationScopeStringEquals() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
String testKey = "testApplicationScopeStringEquals";
pageContext.setAttribute(testKey, testStringValue,
PageContext.APPLICATION_SCOPE);
@@ -229,13 +277,18 @@
net.setScope("application");
net.setValue(testStringValue);
- assertEquals("String in application scope equals", true,
net.condition(0, 0));
+ if (net.doStartTag()==net.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("String in application scope equals", false, testCondition);
}
/**
* Verify that there is an application scope String that is not equal using
the <code>EqualTag</code>.
*/
public void testApplicationScopeStringNotEquals() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
String testKey = "testApplicationScopeStringNotEquals";
pageContext.setAttribute(testKey, testStringValue,
PageContext.APPLICATION_SCOPE);
@@ -244,7 +297,10 @@
net.setScope("application");
net.setValue(testStringValue1);
- assertEquals("String in application scope not equals", false,
net.condition(0, 0));
+ if (net.doStartTag()==net.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("String in application scope not equals", true,
testCondition);
}
}
Index: src/test/org/apache/struts/taglib/logic/TestEmptyTag.java
===================================================================
--- src/test/org/apache/struts/taglib/logic/TestEmptyTag.java (revision 31303)
+++ src/test/org/apache/struts/taglib/logic/TestEmptyTag.java (revision 31304)
@@ -67,6 +67,7 @@
private void runNameTest(String testKey, EmptyTag et,
Object o, int scope, String whichScope, boolean condition,
boolean useProperty, String property)
throws ServletException, JspException {
+ boolean testCondition = false;
pageContext.setAttribute(testKey, o, scope);
et.setPageContext(pageContext);
@@ -75,11 +76,14 @@
et.setProperty(property);
}
et.setScope(whichScope);
-
+
+ if (et.doStartTag()==et.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertEquals(
"Testing " + testKey + " with EmtpyTag in " + whichScope + " scope",
condition,
- et.condition());
+ testCondition);
}
/**
Index: src/test/org/apache/struts/taglib/logic/TestLessEqualTag.java
===================================================================
--- src/test/org/apache/struts/taglib/logic/TestLessEqualTag.java
(revision 31303)
+++ src/test/org/apache/struts/taglib/logic/TestLessEqualTag.java
(revision 31304)
@@ -94,42 +94,60 @@
* Verify the value stored in a cookie using <code>LessEqualTag</code>.
*/
public void testCookieLessEqual() throws ServletException, JspException {
+
+ boolean testCondition = false;
+
LessEqualTag ge = new LessEqualTag();
ge.setPageContext(pageContext);
ge.setCookie(COOKIE_KEY);
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Cookie Value (" + GREATER_VAL + ") is less than or equal to
value (" + LESSER_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
* Verify the value stored in header using <code>LessEqualTag</code>.
*/
public void testHeaderLessEqual() throws ServletException, JspException {
+
+ boolean testCondition = false;
+
LessEqualTag ge = new LessEqualTag();
ge.setPageContext(pageContext);
ge.setHeader(HEADER_KEY);
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Header Value (" + GREATER_VAL + ") is less than or equal to
value (" + LESSER_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
* Verify the value stored in parameter using <code>LessEqualTag</code>.
*/
public void testParameterLessEqual() throws ServletException, JspException {
+
+ boolean testCondition = false;
+
LessEqualTag ge = new LessEqualTag();
ge.setPageContext(pageContext);
ge.setParameter(PARAMETER_KEY);
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Parameter Value (" + GREATER_VAL + ") is less than or equal to
value (" + LESSER_VAL + ")",
- ge.condition());
+ testCondition);
}
@@ -140,6 +158,8 @@
public void testApplicationScopeNameLessEqual()
throws ServletException, JspException {
+ boolean testCondition = false;
+
LessEqualTag ge = new LessEqualTag();
String testKey = "testApplicationScopeNameLessEqual";
@@ -151,9 +171,12 @@
ge.setScope("application");
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Application scope value from name (" + GREATER_VAL + ") is less
than or equal to value (" + LESSER_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
@@ -163,6 +186,8 @@
public void testSessionScopeNameLessEqual()
throws ServletException, JspException {
+ boolean testCondition = false;
+
LessEqualTag ge = new LessEqualTag();
String testKey = "testSessionScopeNameLessEqual";
@@ -174,9 +199,12 @@
ge.setScope("session");
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Session scope value from name (" + GREATER_VAL + ") is less
than or equal to value (" + LESSER_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
@@ -186,6 +214,8 @@
public void testRequestScopeNameLessEqual()
throws ServletException, JspException {
+ boolean testCondition = false;
+
LessEqualTag ge = new LessEqualTag();
String testKey = "testRequestScopeNameLessEqual";
@@ -197,9 +227,12 @@
ge.setScope("request");
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Request scope value from name (" + GREATER_VAL + ") is less
than or equal to value (" + LESSER_VAL + ")",
- ge.condition());
+ testCondition);
}
@@ -212,6 +245,8 @@
public void testApplicationScopePropertyLessEqual()
throws ServletException, JspException {
+ boolean testCondition = false;
+
LessEqualTag ge = new LessEqualTag();
String testKey = "testApplicationScopePropertyLessEqual";
@@ -224,9 +259,12 @@
ge.setProperty("value");
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Value (" + LESSER_VAL + ") is less than or equal to value (" +
GREATER_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
@@ -236,6 +274,8 @@
public void testSessionScopePropertyLessEqual()
throws ServletException, JspException {
+ boolean testCondition = false;
+
LessEqualTag ge = new LessEqualTag();
String testKey = "testSessionScopePropertyLessEqual";
@@ -248,9 +288,12 @@
ge.setProperty("value");
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Value (" + LESSER_VAL + ") is less than or equal to value (" +
GREATER_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
@@ -260,6 +303,8 @@
public void testRequestScopePropertyLessEqual()
throws ServletException, JspException {
+ boolean testCondition = false;
+
LessEqualTag ge = new LessEqualTag();
String testKey = "testRequestScopePropertyLessEqual";
@@ -272,9 +317,12 @@
ge.setProperty("value");
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Value (" + LESSER_VAL + ") is less than or equal to value (" +
GREATER_VAL + ")",
- ge.condition());
+ testCondition);
}
Index: src/test/org/apache/struts/taglib/logic/TestPresentTag.java
===================================================================
--- src/test/org/apache/struts/taglib/logic/TestPresentTag.java (revision 31303)
+++ src/test/org/apache/struts/taglib/logic/TestPresentTag.java (revision 31304)
@@ -69,6 +69,8 @@
* Verify that there is an application scope object in scope using the
<code>PresentTag</code>.
*/
public void testApplicationScopeObjectPresent() throws ServletException,
JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
String testKey = "testApplicationScopePresent";
String testStringValue = "abc";
@@ -77,28 +79,38 @@
pt.setPageContext(pageContext);
pt.setName(testKey);
pt.setScope("application");
+
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Value present (not null)", true, pt.condition(true));
+ assertEquals("Value present (not null)", true, testCondition);
}
/**
* Verify that there is an application scope object is not in scope using
the <code>PresentTag</code>.
*/
public void testApplicationScopeObjectNotPresent() throws ServletException,
JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
String testKey = "testApplicationScopeNotPresent";
pt.setPageContext(pageContext);
pt.setName(testKey);
pt.setScope("application");
+
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Value not present (null)", false, pt.condition(true));
+ assertEquals("Value not present (null)", false, testCondition);
}
/**
* Verify that there is an session scope object in scope using the
<code>PresentTag</code>.
*/
public void testSessionScopeObjectPresent() throws ServletException,
JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
String testKey = "testSessionScopePresent";
String testStringValue = "abc";
@@ -107,28 +119,38 @@
pt.setPageContext(pageContext);
pt.setName(testKey);
pt.setScope("session");
+
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Value present (not null)", true, pt.condition(true));
+ assertEquals("Value present (not null)", true, testCondition);
}
/**
* Verify that there is an session scope object is not in scope using the
<code>PresentTag</code>.
*/
public void testSessionScopeObjectNotPresent() throws ServletException,
JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
String testKey = "testSessionScopeNotPresent";
pt.setPageContext(pageContext);
pt.setName(testKey);
pt.setScope("session");
+
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Value present (not null)", false, pt.condition(true));
+ assertEquals("Value present (not null)", false, testCondition);
}
/**
* Verify that there is an request scope object in scope using the
<code>PresentTag</code>.
*/
public void testRequestScopeObjectPresent() throws ServletException,
JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
String testKey = "testRequestScopePresent";
String testStringValue = "abc";
@@ -137,28 +159,38 @@
pageContext.setAttribute(testKey, testStringValue,
PageContext.REQUEST_SCOPE);
pt.setPageContext(pageContext);
pt.setName(testKey);
+
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Value present (not null)", true, pt.condition(true));
+ assertEquals("Value present (not null)", true, testCondition);
}
/**
* Verify that there is an request scope object is not in scope using the
<code>PresentTag</code>.
*/
public void testRequestScopeObjectNotPresent() throws ServletException,
JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
String testKey = "testRequestScopeNotPresent";
pt.setPageContext(pageContext);
pt.setName(testKey);
pt.setScope("request");
+
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Value not present (null)", false, pt.condition(true));
+ assertEquals("Value not present (null)", false, testCondition);
}
/**
* Verify that there is an page scope object in scope using the
<code>PresentTag</code>.
*/
public void testPageScopeObjectPresent() throws ServletException,
JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
String testKey = "testPageScopePresent";
String testStringValue = "abc";
@@ -167,22 +199,30 @@
pageContext.setAttribute(testKey, testStringValue, PageContext.PAGE_SCOPE);
pt.setPageContext(pageContext);
pt.setName(testKey);
+
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Value present (not null)", true, pt.condition(true));
+ assertEquals("Value present (not null)", true, testCondition);
}
/**
* Verify that there is an page scope object is not in scope using the
<code>PresentTag</code>.
*/
public void testPageScopeObjectNotPresent() throws ServletException,
JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
String testKey = "testPageScopeNotPresent";
pt.setPageContext(pageContext);
pt.setName(testKey);
pt.setScope("page");
+
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Value not present (null)", false, pt.condition(true));
+ assertEquals("Value not present (null)", false, testCondition);
}
/**
@@ -191,6 +231,8 @@
*/
public void testApplicationScopePropertyPresent()
throws ServletException, JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
String testKey = "testApplicationScopePropertyPresent";
@@ -206,7 +248,11 @@
pt.setScope("application");
pt.setProperty("value");
- assertEquals("Property present (not null)", true,
pt.condition(true));
+
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("Property present (not null)", true, testCondition);
}
/**
@@ -216,6 +262,8 @@
*/
public void testApplicationScopePropertyNotPresent()
throws ServletException, JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
String testKey = "testApplicationScopePropertyPresent";
@@ -231,7 +279,10 @@
pt.setScope("application");
pt.setProperty("value");
- assertEquals("Property present (not null)", false,
pt.condition(true));
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("Property present (not null)", false, testCondition);
}
/**
@@ -240,6 +291,8 @@
*/
public void testRequestScopePropertyPresent()
throws ServletException, JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
String testKey = "testRequestScopePropertyPresent";
@@ -255,7 +308,10 @@
pt.setScope("request");
pt.setProperty("value");
- assertEquals("Property present (not null)", true,
pt.condition(true));
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("Property present (not null)", true, testCondition);
}
/**
@@ -265,6 +321,8 @@
*/
public void testRequestScopePropertyNotPresent()
throws ServletException, JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
String testKey = "testRequestScopePropertyNotPresent";
@@ -280,7 +338,10 @@
pt.setScope("request");
pt.setProperty("value");
- assertEquals("Property present (not null)", false,
pt.condition(true));
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("Property present (not null)", false, testCondition);
}
/**
@@ -310,12 +371,17 @@
* Verify that there isn't an cookie using the <code>PresentTag</code>.
*/
public void testCookieNotPresent() throws ServletException, JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
pt.setPageContext(pageContext);
pt.setCookie(COOKIE_KEY);
+
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Cookie not present", false, pt.condition(true));
+ assertEquals("Cookie not present", false, testCondition);
}
/**
@@ -329,24 +395,34 @@
* Verify that there is an header using the <code>PresentTag</code>.
*/
public void testHeaderPresent() throws ServletException, JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
pt.setPageContext(pageContext);
pt.setHeader(HEADER_KEY);
+
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Header present", true, pt.condition(true));
+ assertEquals("Header present", true, testCondition);
}
/**
* Verify that there isn't an header using the <code>PresentTag</code>.
*/
public void testHeaderNotPresent() throws ServletException, JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
pt.setPageContext(pageContext);
pt.setHeader(HEADER_KEY);
+
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Header not present", false, pt.condition(true));
+ assertEquals("Header not present", false, testCondition);
}
/**
@@ -360,24 +436,34 @@
* Verify that there is an parameter using the <code>PresentTag</code>.
*/
public void testParameterPresent() throws ServletException, JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
pt.setPageContext(pageContext);
pt.setParameter(PARAMETER_KEY);
- assertEquals("Parameter present", true, pt.condition(true));
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("Parameter present", true, testCondition);
}
/**
* Verify that there isn't an parameter using the <code>PresentTag</code>.
*/
public void testParameterNotPresent() throws ServletException, JspException {
+ boolean testCondition = false;
+
PresentTag pt = new PresentTag();
pt.setPageContext(pageContext);
pt.setParameter(PARAMETER_KEY);
+
+ if (pt.doStartTag()==pt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Parameter not present", false, pt.condition(true));
+ assertEquals("Parameter not present", false, testCondition);
}
}
Index: src/test/org/apache/struts/taglib/logic/TestGreaterEqualTag.java
===================================================================
--- src/test/org/apache/struts/taglib/logic/TestGreaterEqualTag.java
(revision 31303)
+++ src/test/org/apache/struts/taglib/logic/TestGreaterEqualTag.java
(revision 31304)
@@ -113,13 +113,19 @@
*/
public void testHeaderGreaterEqual() throws ServletException, JspException {
GreaterEqualTag ge = new GreaterEqualTag();
+
+ boolean testCondition = false;
+
ge.setPageContext(pageContext);
ge.setHeader(HEADER_KEY);
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Header Value (" + GREATER_VAL + ") is greater than or equal to
value (" + LESSER_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
@@ -127,13 +133,19 @@
*/
public void testParameterGreaterEqual() throws ServletException,
JspException {
GreaterEqualTag ge = new GreaterEqualTag();
+
+ boolean testCondition = false;
+
ge.setPageContext(pageContext);
ge.setParameter(PARAMETER_KEY);
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Parameter Value (" + GREATER_VAL + ") is greater than or equal
to value (" + LESSER_VAL + ")",
- ge.condition());
+ testCondition);
}
@@ -144,6 +156,8 @@
public void testApplicationScopeNameGreaterEqual()
throws ServletException, JspException {
+ boolean testCondition = false;
+
GreaterEqualTag ge = new GreaterEqualTag();
String testKey = "testApplicationScopeNameGreaterEqual";
@@ -155,9 +169,12 @@
ge.setScope("application");
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Application scope value from name (" + GREATER_VAL + ") is
greater than or equal to value (" + LESSER_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
@@ -167,6 +184,8 @@
public void testSessionScopeNameGreaterEqual()
throws ServletException, JspException {
+ boolean testCondition = false;
+
GreaterEqualTag ge = new GreaterEqualTag();
String testKey = "testSessionScopeNameGreaterEqual";
@@ -178,9 +197,12 @@
ge.setScope("session");
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Session scope value from name (" + GREATER_VAL + ") is greater
than or equal to value (" + LESSER_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
@@ -190,6 +212,8 @@
public void testRequestScopeNameGreaterEqual()
throws ServletException, JspException {
+ boolean testCondition = false;
+
GreaterEqualTag ge = new GreaterEqualTag();
String testKey = "testRequestScopeNameGreaterEqual";
@@ -201,9 +225,12 @@
ge.setScope("request");
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Request scope value from name (" + GREATER_VAL + ") is greater
than or equal to value (" + LESSER_VAL + ")",
- ge.condition());
+ testCondition);
}
@@ -216,6 +243,8 @@
public void testApplicationScopePropertyGreaterEqual()
throws ServletException, JspException {
+ boolean testCondition = false;
+
GreaterEqualTag ge = new GreaterEqualTag();
String testKey = "testApplicationScopePropertyGreaterEqual";
@@ -228,9 +257,12 @@
ge.setProperty("value");
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Value (" + LESSER_VAL + ") is greater than or equal to value ("
+ GREATER_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
@@ -240,6 +272,8 @@
public void testSessionScopePropertyGreaterEqual()
throws ServletException, JspException {
+ boolean testCondition = false;
+
GreaterEqualTag ge = new GreaterEqualTag();
String testKey = "testSessionScopePropertyGreaterEqual";
@@ -252,9 +286,12 @@
ge.setProperty("value");
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Value (" + LESSER_VAL + ") is greater than or equal to value ("
+ GREATER_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
@@ -264,6 +301,8 @@
public void testRequestScopePropertyGreaterEqual()
throws ServletException, JspException {
+ boolean testCondition = false;
+
GreaterEqualTag ge = new GreaterEqualTag();
String testKey = "testRequestScopePropertyGreaterEqual";
@@ -276,9 +315,12 @@
ge.setProperty("value");
ge.setValue(LESSER_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Value (" + LESSER_VAL + ") is greater than or equal to value ("
+ GREATER_VAL + ")",
- ge.condition());
+ testCondition);
}
Index: src/test/org/apache/struts/taglib/logic/TestLessThanTag.java
===================================================================
--- src/test/org/apache/struts/taglib/logic/TestLessThanTag.java
(revision 31303)
+++ src/test/org/apache/struts/taglib/logic/TestLessThanTag.java
(revision 31304)
@@ -94,42 +94,60 @@
* Verify the value stored in a cookie using <code>LessThanTag</code>.
*/
public void testCookieLessThan() throws ServletException, JspException {
+
+ boolean testCondition = false;
+
LessThanTag ge = new LessThanTag();
ge.setPageContext(pageContext);
ge.setCookie(COOKIE_KEY);
ge.setValue(COMPARE_TO_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Cookie Value (" + COMPARE_VAL + ") is less than value (" +
COMPARE_TO_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
* Verify the value stored in header using <code>LessThanTag</code>.
*/
public void testHeaderLessThan() throws ServletException, JspException {
+
+ boolean testCondition = false;
+
LessThanTag ge = new LessThanTag();
ge.setPageContext(pageContext);
ge.setHeader(HEADER_KEY);
ge.setValue(COMPARE_TO_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Header Value (" + COMPARE_VAL + ") is less than value (" +
COMPARE_TO_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
* Verify the value stored in parameter using <code>LessThanTag</code>.
*/
public void testParameterLessThan() throws ServletException, JspException {
+
+ boolean testCondition = false;
+
LessThanTag ge = new LessThanTag();
ge.setPageContext(pageContext);
ge.setParameter(PARAMETER_KEY);
ge.setValue(COMPARE_TO_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Parameter Value (" + COMPARE_VAL + ") is less than value (" +
COMPARE_TO_VAL + ")",
- ge.condition());
+ testCondition);
}
@@ -140,6 +158,8 @@
public void testApplicationScopeNameLessThan()
throws ServletException, JspException {
+ boolean testCondition = false;
+
LessThanTag ge = new LessThanTag();
String testKey = "testApplicationScopeNameLessThan";
@@ -151,9 +171,12 @@
ge.setScope("application");
ge.setValue(COMPARE_TO_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Application scope value from name (" + COMPARE_VAL + ") is less
than value (" + COMPARE_TO_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
@@ -163,6 +186,8 @@
public void testSessionScopeNameLessThan()
throws ServletException, JspException {
+ boolean testCondition = false;
+
LessThanTag ge = new LessThanTag();
String testKey = "testSessionScopeNameLessThan";
@@ -174,9 +199,12 @@
ge.setScope("session");
ge.setValue(COMPARE_TO_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Session scope value from name (" + COMPARE_VAL + ") is less
than value (" + COMPARE_TO_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
@@ -186,6 +214,8 @@
public void testRequestScopeNameLessThan()
throws ServletException, JspException {
+ boolean testCondition = false;
+
LessThanTag ge = new LessThanTag();
String testKey = "testRequestScopeNameLessThan";
@@ -197,9 +227,12 @@
ge.setScope("request");
ge.setValue(COMPARE_TO_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Request scope value from name (" + COMPARE_VAL + ") is less
than value (" + COMPARE_TO_VAL + ")",
- ge.condition());
+ testCondition);
}
@@ -212,6 +245,8 @@
public void testApplicationScopePropertyLessThan()
throws ServletException, JspException {
+ boolean testCondition = false;
+
LessThanTag ge = new LessThanTag();
String testKey = "testApplicationScopePropertyLessThan";
@@ -224,9 +259,12 @@
ge.setProperty("value");
ge.setValue(COMPARE_TO_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Value (" + COMPARE_TO_VAL + ") is less than value (" +
COMPARE_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
@@ -236,6 +274,8 @@
public void testSessionScopePropertyLessThan()
throws ServletException, JspException {
+ boolean testCondition = false;
+
LessThanTag ge = new LessThanTag();
String testKey = "testSessionScopePropertyLessThan";
@@ -248,9 +288,12 @@
ge.setProperty("value");
ge.setValue(COMPARE_TO_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Value (" + COMPARE_TO_VAL + ") is less than value (" +
COMPARE_VAL + ")",
- ge.condition());
+ testCondition);
}
/**
@@ -260,6 +303,8 @@
public void testRequestScopePropertyLessThan()
throws ServletException, JspException {
+ boolean testCondition = false;
+
LessThanTag ge = new LessThanTag();
String testKey = "testRequestScopePropertyLessThan";
@@ -272,9 +317,12 @@
ge.setProperty("value");
ge.setValue(COMPARE_TO_VAL);
+ if (ge.doStartTag()==ge.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
assertTrue(
"Value (" + COMPARE_TO_VAL + ") is less than value (" +
COMPARE_VAL + ")",
- ge.condition());
+ testCondition);
}
Index: src/test/org/apache/struts/taglib/logic/TestNotPresentTag.java
===================================================================
--- src/test/org/apache/struts/taglib/logic/TestNotPresentTag.java
(revision 31303)
+++ src/test/org/apache/struts/taglib/logic/TestNotPresentTag.java
(revision 31304)
@@ -68,6 +68,8 @@
* Verify that there is an application scope object in scope using the
<code>NotPresentTag</code>.
*/
public void testApplicationScopeObjectPresent() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
NotPresentTag npt = new NotPresentTag();
String testKey = "testApplicationScopePresent";
String testStringValue = "abc";
@@ -76,29 +78,38 @@
npt.setPageContext(pageContext);
npt.setName(testKey);
npt.setScope("application");
+
+ if (npt.doStartTag()==npt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Value present (not null)", false, npt.condition(false));
+ assertEquals("Value present (not null)", false, testCondition);
}
/**
* Verify that there is an application scope object is not in scope using
the <code>NotPresentTag</code>.
*/
public void testApplicationScopeObjectNotPresent() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
NotPresentTag npt = new NotPresentTag();
String testKey = "testApplicationScopeNotPresent";
npt.setPageContext(pageContext);
npt.setName(testKey);
npt.setScope("application");
-
-
- assertEquals("Value not present (null)", true, npt.condition(false));
+
+ if (npt.doStartTag()==npt.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("Value not present (null)", true, testCondition);
}
/**
* Verify that there is an session scope object in scope using the
<code>NotPresentTag</code>.
*/
public void testSessionScopeObjectPresent() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
NotPresentTag npt = new NotPresentTag();
String testKey = "testSessionScopePresent";
String testStringValue = "abc";
@@ -107,28 +118,38 @@
npt.setPageContext(pageContext);
npt.setName(testKey);
npt.setScope("session");
+
+ if (npt.doStartTag()==npt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Value present (not null)", false, npt.condition(false));
+ assertEquals("Value present (not null)", false, testCondition);
}
/**
* Verify that there is an session scope object is not in scope using the
<code>NotPresentTag</code>.
*/
public void testSessionScopeObjectNotPresent() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
NotPresentTag npt = new NotPresentTag();
String testKey = "testSessionScopeNotPresent";
npt.setPageContext(pageContext);
npt.setName(testKey);
npt.setScope("session");
+
+ if (npt.doStartTag()==npt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Value present (not null)", true, npt.condition(false));
+ assertEquals("Value present (not null)", true, testCondition);
}
/**
* Verify that there is an request scope object in scope using the
<code>NotPresentTag</code>.
*/
public void testRequestScopeObjectPresent() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
NotPresentTag npt = new NotPresentTag();
String testKey = "testRequestScopePresent";
String testStringValue = "abc";
@@ -137,28 +158,38 @@
pageContext.setAttribute(testKey, testStringValue,
PageContext.REQUEST_SCOPE);
npt.setPageContext(pageContext);
npt.setName(testKey);
+
+ if (npt.doStartTag()==npt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Value present (not null)", false, npt.condition(false));
+ assertEquals("Value present (not null)", false, testCondition);
}
/**
* Verify that there is an request scope object is not in scope using the
<code>NotPresentTag</code>.
*/
public void testRequestScopeObjectNotPresent() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
NotPresentTag npt = new NotPresentTag();
String testKey = "testRequestScopeNotPresent";
npt.setPageContext(pageContext);
npt.setName(testKey);
npt.setScope("request");
+
+ if (npt.doStartTag()==npt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Value not present (null)", true, npt.condition(false));
+ assertEquals("Value not present (null)", true, testCondition);
}
/**
* Verify that there is an page scope object in scope using the
<code>NotPresentTag</code>.
*/
public void testPageScopeObjectPresent() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
NotPresentTag npt = new NotPresentTag();
String testKey = "testPageScopePresent";
String testStringValue = "abc";
@@ -168,21 +199,29 @@
npt.setPageContext(pageContext);
npt.setName(testKey);
- assertEquals("Value present (not null)", false, npt.condition(false));
+ if (npt.doStartTag()==npt.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("Value present (not null)", false, testCondition);
}
/**
* Verify that there is an page scope object is not in scope using the
<code>NotPresentTag</code>.
*/
public void testPageScopeObjectNotPresent() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
NotPresentTag npt = new NotPresentTag();
String testKey = "testPageScopeNotPresent";
npt.setPageContext(pageContext);
npt.setName(testKey);
npt.setScope("page");
+
+ if (npt.doStartTag()==npt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Value not present (null)", true, npt.condition(false));
+ assertEquals("Value not present (null)", true, testCondition);
}
/**
@@ -212,12 +251,17 @@
* Verify that there isn't an cookie using the <code>PresentTag</code>.
*/
public void testCookieNotPresent() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
NotPresentTag npt = new NotPresentTag();
npt.setPageContext(pageContext);
npt.setCookie(COOKIE_KEY);
+
+ if (npt.doStartTag()==npt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Cookie not present", true, npt.condition(false));
+ assertEquals("Cookie not present", true, testCondition);
}
/**
@@ -231,24 +275,34 @@
* Verify that there is an header using the <code>PresentTag</code>.
*/
public void testHeaderPresent() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
NotPresentTag npt = new NotPresentTag();
npt.setPageContext(pageContext);
npt.setHeader(HEADER_KEY);
+
+ if (npt.doStartTag()==npt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Header present", false, npt.condition(false));
+ assertEquals("Header present", false, testCondition);
}
/**
* Verify that there isn't an header using the <code>PresentTag</code>.
*/
public void testHeaderNotPresent() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
NotPresentTag npt = new NotPresentTag();
npt.setPageContext(pageContext);
npt.setHeader(HEADER_KEY);
+
+ if (npt.doStartTag()==npt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Header not present", true, npt.condition(false));
+ assertEquals("Header not present", true, testCondition);
}
/**
@@ -262,24 +316,34 @@
* Verify that there is an parameter using the <code>PresentTag</code>.
*/
public void testParameterPresent() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
NotPresentTag npt = new NotPresentTag();
npt.setPageContext(pageContext);
npt.setParameter(PARAMETER_KEY);
- assertEquals("Parameter present", false, npt.condition(false));
+ if (npt.doStartTag()==npt.EVAL_BODY_INCLUDE)
+ testCondition = true;
+
+ assertEquals("Parameter present", false, testCondition);
}
/**
* Verify that there isn't an parameter using the <code>PresentTag</code>.
*/
public void testParameterNotPresent() throws ServletException,
javax.servlet.jsp.JspException {
+ boolean testCondition = false;
+
NotPresentTag npt = new NotPresentTag();
npt.setPageContext(pageContext);
npt.setParameter(PARAMETER_KEY);
+
+ if (npt.doStartTag()==npt.EVAL_BODY_INCLUDE)
+ testCondition = true;
- assertEquals("Parameter not present", true, npt.condition(false));
+ assertEquals("Parameter not present", true, testCondition);
}
}
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org