Debugging Tools and Techniques - JUnit test gives ClassCastException

I'm trying to migrate some JUnit 3.8 tests to 4.3. At the moment my tests run fine in Eclipse, but when I try to run them from the command line they fall over with a "ClassCastException" error. This happens even when all the actual tests are ignored, e.g.:

package ac.nott.chem.lattice;

import java.util.ArrayList;

import ac.nott.chem.lattice.Helper;

import org.junit.Test;

import org.junit.Ignore;

importstatic org.junit.Assert.*;

publicclass HelperTest{

@Ignore

@Testpublicvoid testFileIO(){

ArrayList<String> lines = Helper.readFromFile("search.inp");

assertEquals(76, lines.size());

assertEquals("A 3 -4 0", lines.get(0));

assertEquals("TEMP 1.5", lines.get(75));

Helper.printToScreen(lines);

Helper.printToFile("test.out", lines);

}

If anyone has any suggestions as to what might be causing the problem, I'd be very grateful! I'm running the JUnit tests from the command line like so (obviously without the lines breaks, just introduced here for ease of viewing):

java -classpath /opt/junit4.3/:/opt/junit4.3/junit-4.3.jar:

/home/haydnw/workspace/JavaLatticeSearch/build/:

/home/haydnw/workspace/JavaLatticeSearch/testbuild/

junit.textui.TestRunner ac.nott.chem.lattice.HelperTest

I've read through the Javadoc for "ClassCastException" and can't see what in the test code might be the issue? This happens with all my tests, which worked fine in JUnit 3.8, and all work fine in JUnit 4.3 through Eclipse. Thanks in advance.

[2305 byte] By [haydnwa] at [2007-11-26 23:03:46]
# 1
Anyone?
haydnwa at 2007-7-10 13:56:00 > top of Java-index,Archived Forums,Debugging Tools and Techniques...