dion 2003/01/26 18:35:26
Modified: jelly/src/test/org/apache/commons/jelly/test/impl
DummyTag.java
jelly/src/test/org/apache/commons/jelly/tags/junit
AssertEqualsTag.java RunTag.java
AssertThrowsTag.java AssertTag.java SuiteTag.java
FailTag.java CaseTag.java
jelly/src/test/org/apache/commons/jelly/core TestArgTag.java
Log:
Fix test code to work with recent exception changes
Revision Changes Path
1.3 +2 -1
jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/test/impl/DummyTag.java
Index: DummyTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/test/impl/DummyTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DummyTag.java 30 Oct 2002 19:16:18 -0000 1.2
+++ DummyTag.java 27 Jan 2003 02:35:25 -0000 1.3
@@ -56,6 +56,7 @@
*/
package org.apache.commons.jelly.test.impl;
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.TagSupport;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.logging.Log;
@@ -77,7 +78,7 @@
* @see org.apache.commons.jelly.Tag#doTag(XMLOutput)
* @see org.apache.commons.jelly.tags.core.JellyTag
*/
- public void doTag(XMLOutput output) throws Exception {
+ public void doTag(XMLOutput output) throws JellyTagException {
if (log.isDebugEnabled())
log.debug("********Executing DummyTag Body*********");
if (m_classToBeLoaded != null) {
1.2 +7 -6
jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/tags/junit/AssertEqualsTag.java
Index: AssertEqualsTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/tags/junit/AssertEqualsTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AssertEqualsTag.java 19 Jan 2003 06:03:12 -0000 1.1
+++ AssertEqualsTag.java 27 Jan 2003 02:35:26 -0000 1.2
@@ -61,6 +61,7 @@
*/
package org.apache.commons.jelly.tags.junit;
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.jelly.expression.Expression;
@@ -79,7 +80,7 @@
// Tag interface
//-------------------------------------------------------------------------
- public void doTag(XMLOutput output) throws Exception {
+ public void doTag(XMLOutput output) throws JellyTagException {
String message = getBodyText();
Object expectedValue = expected.evaluate(context);
1.2 +7 -6
jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/tags/junit/RunTag.java
Index: RunTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/tags/junit/RunTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RunTag.java 19 Jan 2003 06:03:12 -0000 1.1
+++ RunTag.java 27 Jan 2003 02:35:26 -0000 1.2
@@ -69,6 +69,7 @@
import junit.framework.TestListener;
import junit.framework.TestResult;
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.MissingAttributeException;
import org.apache.commons.jelly.TagSupport;
import org.apache.commons.jelly.XMLOutput;
@@ -96,7 +97,7 @@
// Tag interface
//-------------------------------------------------------------------------
- public void doTag(XMLOutput output) throws Exception {
+ public void doTag(XMLOutput output) throws JellyTagException {
Test test = getTest();
if ( test == null ) {
test = (Test)
context.getVariable("org.apache.commons.jelly.junit.suite");
1.2 +4 -3
jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/tags/junit/AssertThrowsTag.java
Index: AssertThrowsTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/tags/junit/AssertThrowsTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AssertThrowsTag.java 19 Jan 2003 06:03:12 -0000 1.1
+++ AssertThrowsTag.java 27 Jan 2003 02:35:26 -0000 1.2
@@ -56,6 +56,7 @@
package org.apache.commons.jelly.tags.junit;
import org.apache.commons.jelly.JellyException;
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -91,10 +92,10 @@
// Tag interface
//-------------------------------------------------------------------------
- public void doTag(XMLOutput output) throws Exception {
- Class throwableClass = getThrowableClass();
-
+ public void doTag(XMLOutput output) throws JellyTagException {
+ Class throwableClass = null;
try {
+ throwableClass = getThrowableClass();
invokeBody(output);
}
catch (Throwable t) {
1.2 +16 -9
jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/tags/junit/AssertTag.java
Index: AssertTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/tags/junit/AssertTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AssertTag.java 19 Jan 2003 06:03:12 -0000 1.1
+++ AssertTag.java 27 Jan 2003 02:35:26 -0000 1.2
@@ -61,6 +61,7 @@
*/
package org.apache.commons.jelly.tags.junit;
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.jelly.MissingAttributeException;
import org.apache.commons.jelly.expression.Expression;
@@ -69,6 +70,7 @@
import org.apache.commons.logging.LogFactory;
+import org.jaxen.JaxenException;
import org.jaxen.XPath;
/**
@@ -94,7 +96,7 @@
// Tag interface
//-------------------------------------------------------------------------
- public void doTag(XMLOutput output) throws Exception {
+ public void doTag(XMLOutput output) throws JellyTagException {
if (test == null && xpath == null) {
throw new MissingAttributeException( "test" );
}
@@ -104,10 +106,15 @@
}
}
else {
- Object xpathContext = getXPathContext();
- if (! xpath.booleanValueOf(xpathContext)) {
- fail( getBodyText(), "evaluating xpath: "+ xpath );
+ try {
+ Object xpathContext = getXPathContext();
+ if (! xpath.booleanValueOf(xpathContext)) {
+ fail( getBodyText(), "evaluating xpath: "+ xpath );
+ }
+ } catch (JaxenException anException) {
+ throw new JellyTagException("Error evaluating xpath", anException);
}
+
}
}
1.2 +7 -6
jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/tags/junit/SuiteTag.java
Index: SuiteTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/tags/junit/SuiteTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SuiteTag.java 19 Jan 2003 06:03:12 -0000 1.1
+++ SuiteTag.java 27 Jan 2003 02:35:26 -0000 1.2
@@ -64,6 +64,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.TagSupport;
import org.apache.commons.jelly.XMLOutput;
@@ -97,7 +98,7 @@
// Tag interface
//-------------------------------------------------------------------------
- public void doTag(XMLOutput output) throws Exception {
+ public void doTag(XMLOutput output) throws JellyTagException {
suite = createSuite();
TestSuite parent = (TestSuite)
context.getVariable("org.apache.commons.jelly.junit.suite");
1.2 +7 -6
jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/tags/junit/FailTag.java
Index: FailTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/tags/junit/FailTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FailTag.java 19 Jan 2003 06:03:12 -0000 1.1
+++ FailTag.java 27 Jan 2003 02:35:26 -0000 1.2
@@ -61,6 +61,7 @@
*/
package org.apache.commons.jelly.tags.junit;
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.XMLOutput;
/**
@@ -79,7 +80,7 @@
// Tag interface
//-------------------------------------------------------------------------
- public void doTag(XMLOutput output) throws Exception {
+ public void doTag(XMLOutput output) throws JellyTagException {
String message = getMessage();
if ( message == null ) {
message = getBodyText();
1.2 +8 -7
jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/tags/junit/CaseTag.java
Index: CaseTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/tags/junit/CaseTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CaseTag.java 19 Jan 2003 06:03:12 -0000 1.1
+++ CaseTag.java 27 Jan 2003 02:35:26 -0000 1.2
@@ -66,6 +66,7 @@
import org.apache.commons.jelly.JellyContext;
import org.apache.commons.jelly.JellyException;
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.TagSupport;
import org.apache.commons.jelly.XMLOutput;
@@ -83,7 +84,7 @@
// Tag interface
//-------------------------------------------------------------------------
- public void doTag(final XMLOutput output) throws Exception {
+ public void doTag(final XMLOutput output) throws JellyTagException {
String name = getName();
if ( name == null ) {
name = toString();
@@ -109,7 +110,7 @@
// lets find the test suite
TestSuite suite = getSuite();
if ( suite == null ) {
- throw new JellyException( "Could not find a TestSuite to add this test
to. This tag should be inside a <test:suite> tag" );
+ throw new JellyTagException( "Could not find a TestSuite to add this
test to. This tag should be inside a <test:suite> tag" );
}
suite.addTest(testCase);
}
1.5 +6 -6
jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/core/TestArgTag.java
Index: TestArgTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/core/TestArgTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TestArgTag.java 24 Jan 2003 19:03:25 -0000 1.4
+++ TestArgTag.java 27 Jan 2003 02:35:26 -0000 1.5
@@ -250,7 +250,7 @@
valueList.add(value);
}
- public void doTag(XMLOutput output) throws Exception {
+ public void doTag(XMLOutput output) {
}
private Class getType(int i) {
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>