[Biojava-dev] how to run unittest in eclipse

Andy Yates ayates at ebi.ac.uk
Fri Jan 19 16:18:05 UTC 2007


Hi,

This sounds like a problem more with bad project setup where Eclipse has 
not been told where the resources directory is located.

In eclipse right click on the project and go to:

Build Path -> Configure Build Path...

Click on the source tab and then click on the button Add Folder. Select 
the resources directory from the root of the BioJava project and then 
click ok.

If everything has gone okay when you now run the test the Eclipse JUnit 
runner should pick up on the resources classpath and you should have a 
bit more luck with them.

Andy Yates

Huang Zhibin wrote:
> Dear all,
>  First all,thanks for the contribution of BioJava.
>  I downloaded the BioJava and compile apps, demos, tests and runtests 
> using ant. It is ok. But when importing this project into eclipse, I do 
> not know hot to runtests. For example, when clicking file of 
> /tests/org.biojava.bio.alignment/FlexibleAlignmentTest.java, choose Run 
> As | JUnit Test, it fails. Info in Console will be listed below.
>  I know maybe it failed in the step of initialization, but I do now know 
> how to solve it.
>  Can someone who run junittest in JAVA IDE share the experience or give 
> me some suggestions? I will appreciate it.
> Best regards,
> Zhibin
> 
> ------------------------------
> Info printed in Console:
> 
> org.biojava.bio.BioError: Unable to initialize DNATools
>     at org.biojava.bio.seq.DNATools.<clinit>(DNATools.java:117)
>     at 
> org.biojava.bio.alignment.FlexibleAlignmentTest.parse(FlexibleAlignmentTest.java:74) 
> 
> 
>     at 
> org.biojava.bio.alignment.FlexibleAlignmentTest.<clinit>(FlexibleAlignmentTest.java:46) 
> 
> 
>     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
> Method)
>     at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown 
> Source)
>     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown 
> Source)
>     at java.lang.reflect.Constructor.newInstance(Unknown Source)
>     at junit.framework.TestSuite.createTest(TestSuite.java:135)
>     at junit.framework.TestSuite.addTestMethod(TestSuite.java:114)
>     at junit.framework.TestSuite.<init>(TestSuite.java:75)
>     at 
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102) 
> 
> 
>     at 
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59) 
> 
> 
>     at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445) 
> 
> 
>     at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) 
> 
> 
>     at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) 
> 
> 
>     at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) 
> 
> 
> Caused by: org.biojava.bio.BioError: Couldn't locate 
> AlphabetManager.xml.  This probably means that your biojava.jar file is 
> corrupt or incorrectly built.
>     at 
> org.biojava.bio.symbol.AlphabetManager.<clinit>(AlphabetManager.java:148)
>     at org.biojava.bio.seq.DNATools.<clinit>(DNATools.java:80)
>     ... 15 more
> java.lang.NoClassDefFoundError
>     at org.biojava.bio.seq.ProteinTools.<clinit>(ProteinTools.java:76)
>     at 
> org.biojava.bio.alignment.FlexibleAlignmentTest.parse(FlexibleAlignmentTest.java:76) 
> 
> 
> 
> _________________________________________________________________
> ??????????,??? MSN Messenger:  http://messenger.msn.com/cn 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> biojava-dev mailing list
> biojava-dev at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-dev



More information about the biojava-dev mailing list