Browse files

Added a test to demonstrate the ClassPathException in bug #3305581

Signed-off-by: Rajarshi  Guha <rajarshi.guha@gmail.com>
  • Loading branch information...
1 parent 0f3f147 commit d8c4ca6a4aa0ba8fc3c85c0dcfa584bcab607f8e @egonw egonw committed May 22, 2011
View
18 src/test/org/openscience/cdk/qsar/descriptors/molecular/MolecularDescriptorTest.java
@@ -23,6 +23,7 @@
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
+import org.openscience.cdk.AtomContainer;
import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.dict.Dictionary;
import org.openscience.cdk.dict.DictionaryDatabase;
@@ -325,6 +326,23 @@ public void testImplementationIndependence() throws Exception {
assertEqualOutput(v1, v2, errorMessage);
}
+ @Test
+ public void testAtomContainerHandling() throws Exception {
+ IMolecule water1 = someoneBringMeSomeWater(
+ DefaultChemObjectBuilder.getInstance()
+ );
+ // creates an AtomContainer with the atoms / bonds from water1
+ IAtomContainer water2 = new AtomContainer(water1);
+
+ IDescriptorResult v1 = descriptor.calculate(water1).getValue();
+ IDescriptorResult v2 = descriptor.calculate(water2).getValue();
+
+ String errorMessage = "(" + descriptor.getClass().toString() +
+ ") The descriptor does not give the same results depending on " +
+ "it being passed an IMolecule or an IAtomContainer.";
+ assertEqualOutput(v1, v2, errorMessage);
+ }
+
@Ignore
@Test public void testTakeIntoAccountBondHybridization() {
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();

0 comments on commit d8c4ca6

Please sign in to comment.