Quoting Christoph Steinbeck <c.steinbeck@...>:
> I seem to have no problems with the existing CVS CDK version, when
> trying to run IsotopeFactoryTest. Please note that I ran it using the
> run target. I just commited the changes in the test file and the
> build.xml, so you be able to repeat this using the run target.
>
> run:
> [java] isoFac.getSize(): 285
> [java] Isotope: Iso{130, EM:129.906229, AB:100.0}
>
> I can instantiate an IsotopeFactory and retrieve the "Te" major isotope.
> This is Windows XP, latest patch level and
> java version "1.4.1"
> Java(TM) 2 Runtime Environment, Standard Edition (build
> Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
>
> Maybe you have an old version of JSX in your Classpath?!?
I've tried 1.0.6.0 and 1.0.7.2... both with the same errors...
I'll try to download a bleeding edge JVM from sun...
Egon

Hi all,
On both Debian 3.0 and Windows 2000 with Sun's JDK 1.4.x I get
this problem for both CDK in CVS now and on 2002-11-30:
junit.framework.AssertionFailedError: Problem instantiating IsotopeFactory:
java.lang.ClassCastException: org.openscience.cdk.Isotope
at org.openscience.cdk.test.tools.IsotopeFactoryTest.
testIsotopeFactory(IsotopeFactoryTest.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.
invoke(DelegatingMethodAccessorImpl.java:25)
I've done some code changes to the IsoptopeFactory to see what is happening:
Object o = isotopes.elementAt(f);
if (o instanceof org.openscience.cdk.Isotope) {
Isotope isotope = (Isotope)o;
// logger.debug("Setting up: " + isotope);
setup(isotope);
} else {
logger.warn("Expecting cdk.Isotope, but got " +
o.getClass().getName());
}
Instead of:
Isotope i = (Isotope)isotopes.elementAt(f);
which gives the ClassCastException...
And indeed, o seems not to be of class Isotope ???? :
2003-02-03 10:12:10,640 [TestRunner-Thread] WARN
org.openscience.cdk.tools.IsotopeFactory -
Expecting cdk.Isotope, but got org.openscience.cdk.Isotope
which shows up in the cdk.log...
Well... what it 'got' seems ok (as found with o.getClass().getName())...
but it is not a CDK Isotope....
Any ideas? Does anyone have a CDK system that can run the
org.openscience.cdk.test.tools.IsotopeFactoryTest test correctly?
(If so, please give JVM,OS,compiler options, etc....)
Egon