Hi,

I'm trying to create a simple testcase that needs to use the jdom 
SAXBuilder to create a Document object.

When I do 'ant maven:test' I get the following error in my junit output:
    org.jdom.JDOMException: Error in building: 
org.apache.crimson.parser.XMLReaderImpl

I can execute the same testcase from the commandline, though, and it 
works fine.

This commandline works:
java -cp 
/usr/local/javalib/servlet-1.0.x.jar:/usr/local/javalib/struts-1.1b1.jar:/usr/local/javalib/tiles-20020611.jar:/usr/local/javalib/jdbc_stdext-2.0.jar:/usr/local/javalib/commons-beanutils-dev.jar:/usr/local/javalib/commons-digester-1.2.jar:/usr/local/javalib/commons-collections-2.0.jar:/usr/local/javalib/commons-logging-1.0.jar:/usr/local/javalib/checkstyle-2.2.jar:/usr/local/javalib/xerces-1.4.4.jar:/usr/local/javalib/junit-3.7.jar:/usr/local/javalib/jdom-b8.jar:/usr/local/javalib/log4j-1.1.3.jar:/usr/local/javalib/crimson-1.1.3.jar:target/classes:target/test-classes
 
foo.lists.SelectionCriteriaTest

The massive classpath is taken from ant's output during 'ant maven:test'.

Any hints would be greatly appreciated!

Thanks,
J


My simple test class:

package foo.lists;

import junit.framework.Assert;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

import org.apache.log4j.Category;

import org.jdom.Document;

import java.io.File;
import org.jdom.input.SAXBuilder;

public class SelectionCriteriaTest extends TestCase
{
    public static void main( String [] args )
    {
        try
        {
            SelectionCriteriaTest test =
                new SelectionCriteriaTest("Basic Test");
           
            test.runTest();
        }
        catch( Exception e )
        {
            log.error(e);
        }
    }
   
    public static Test suite()
    {
        TestSuite suite = new TestSuite();
        suite.addTest( new SelectionCriteriaTest("Basic Test") );
        return suite;
    }

    public SelectionCriteriaTest(String name)
    {
        super(name);
    }

    public void runTest()
    {
        try
        {
            SAXBuilder builder = new SAXBuilder();

            File reader = new File( "/home/jcej/tmp/build.xml" );
       
            Document doc = builder.build( reader );
        }
        catch( Exception e )
        {
            log.error(e);
            Assert.fail( e.toString() );
        }
    }

    static Category log = Category.getInstance(SelectionCriteriaTest.class);
}



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to