diff --git a/src/test/org/openscience/cdk/qsar/descriptors/molecular/ChiChainDescriptorTest.java b/src/test/org/openscience/cdk/qsar/descriptors/molecular/ChiChainDescriptorTest.java index d7a9bc33165..60212c1aef7 100644 --- a/src/test/org/openscience/cdk/qsar/descriptors/molecular/ChiChainDescriptorTest.java +++ b/src/test/org/openscience/cdk/qsar/descriptors/molecular/ChiChainDescriptorTest.java @@ -3,11 +3,14 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.openscience.cdk.DefaultChemObjectBuilder; import org.openscience.cdk.Molecule; import org.openscience.cdk.interfaces.IAtom; +import org.openscience.cdk.interfaces.IAtomContainer; import org.openscience.cdk.interfaces.IBond; import org.openscience.cdk.interfaces.IMolecule; import org.openscience.cdk.qsar.result.DoubleArrayResult; +import org.openscience.cdk.smiles.SmilesParser; import javax.vecmath.Point2d; @@ -242,6 +245,27 @@ public void testDan64() throws Exception { Assert.assertEquals(0.02778, ret.get(8), 0.00001); } + /** + * @cdk.bug 3023326 + */ + @Test + public void testCovalentMetal() throws Exception { + SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); + IAtomContainer mol = sp.parseSmiles("CCCC[Sn](CCCC)(CCCC)c1cc(Cl)c(Nc2nc(C)nc(N(CCC)CC3CC3)c2Cl)c(Cl)c1"); + DoubleArrayResult ret = (DoubleArrayResult) descriptor.calculate(mol).getValue(); + Assert.assertNotNull(ret); + } + + + /** + * @cdk.bug 3023326 + */ + @Test(expected = NullPointerException.class) + public void testCovalentPlatinum() throws Exception { + SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); + IAtomContainer mol = sp.parseSmiles("CC1CN[Pt]2(N1)OC(=O)C(C)P(=O)(O)O2"); + descriptor.calculate(mol).getValue(); + } // @Test public void testDan277() throws CDKException { // // IMolecule mol = null; diff --git a/src/test/org/openscience/cdk/qsar/descriptors/molecular/ChiClusterDescriptorTest.java b/src/test/org/openscience/cdk/qsar/descriptors/molecular/ChiClusterDescriptorTest.java index d407413eacf..5befcdd8276 100644 --- a/src/test/org/openscience/cdk/qsar/descriptors/molecular/ChiClusterDescriptorTest.java +++ b/src/test/org/openscience/cdk/qsar/descriptors/molecular/ChiClusterDescriptorTest.java @@ -3,11 +3,14 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.openscience.cdk.DefaultChemObjectBuilder; import org.openscience.cdk.Molecule; import org.openscience.cdk.interfaces.IAtom; +import org.openscience.cdk.interfaces.IAtomContainer; import org.openscience.cdk.interfaces.IBond; import org.openscience.cdk.interfaces.IMolecule; import org.openscience.cdk.qsar.result.DoubleArrayResult; +import org.openscience.cdk.smiles.SmilesParser; import javax.vecmath.Point2d; @@ -185,6 +188,27 @@ public void testDan64() throws Exception { Assert.assertEquals(0.0000, ret.get(7), 0.0001); } + /** + * @cdk.bug 3023326 + */ + @Test public void testCovalentMetal() throws Exception { + SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); + IAtomContainer mol = sp.parseSmiles("CCCC[Sn](CCCC)(CCCC)c1cc(Cl)c(Nc2nc(C)nc(N(CCC)CC3CC3)c2Cl)c(Cl)c1"); + DoubleArrayResult ret = (DoubleArrayResult) descriptor.calculate(mol).getValue(); + Assert.assertNotNull(ret); + } + + + /** + * @cdk.bug 3023326 + */ + @Test(expected = NullPointerException.class) + public void testCovalentPlatinum() throws Exception { + SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); + IAtomContainer mol = sp.parseSmiles("CC1CN[Pt]2(N1)OC(=O)C(C)P(=O)(O)O2"); + descriptor.calculate(mol).getValue(); + } + // @Test public void testDan277() throws CDKException { // // IMolecule mol = null; diff --git a/src/test/org/openscience/cdk/qsar/descriptors/molecular/ChiPathClusterDescriptorTest.java b/src/test/org/openscience/cdk/qsar/descriptors/molecular/ChiPathClusterDescriptorTest.java index c4b70293bdf..f9f8b578758 100644 --- a/src/test/org/openscience/cdk/qsar/descriptors/molecular/ChiPathClusterDescriptorTest.java +++ b/src/test/org/openscience/cdk/qsar/descriptors/molecular/ChiPathClusterDescriptorTest.java @@ -3,11 +3,14 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.openscience.cdk.DefaultChemObjectBuilder; import org.openscience.cdk.Molecule; import org.openscience.cdk.interfaces.IAtom; +import org.openscience.cdk.interfaces.IAtomContainer; import org.openscience.cdk.interfaces.IBond; import org.openscience.cdk.interfaces.IMolecule; import org.openscience.cdk.qsar.result.DoubleArrayResult; +import org.openscience.cdk.smiles.SmilesParser; import javax.vecmath.Point2d; @@ -180,4 +183,26 @@ public void testDan64() throws Exception { Assert.assertEquals(1.6522, ret.get(5), 0.0001); // 1.7148 ? } + /** + * @cdk.bug 3023326 + */ + @Test + public void testCovalentMetal() throws Exception { + SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); + IAtomContainer mol = sp.parseSmiles("CCCC[Sn](CCCC)(CCCC)c1cc(Cl)c(Nc2nc(C)nc(N(CCC)CC3CC3)c2Cl)c(Cl)c1"); + DoubleArrayResult ret = (DoubleArrayResult) descriptor.calculate(mol).getValue(); + Assert.assertNotNull(ret); + } + + /** + * @cdk.bug 3023326 + */ + @Test(expected = NullPointerException.class) + public void testCovalentPlatinum() throws Exception { + SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); + IAtomContainer mol = sp.parseSmiles("CC1CN[Pt]2(N1)OC(=O)C(C)P(=O)(O)O2"); + descriptor.calculate(mol).getValue(); + } + + } diff --git a/src/test/org/openscience/cdk/qsar/descriptors/molecular/ChiPathDescriptorTest.java b/src/test/org/openscience/cdk/qsar/descriptors/molecular/ChiPathDescriptorTest.java index 8db872bf816..1dcef0cb28b 100644 --- a/src/test/org/openscience/cdk/qsar/descriptors/molecular/ChiPathDescriptorTest.java +++ b/src/test/org/openscience/cdk/qsar/descriptors/molecular/ChiPathDescriptorTest.java @@ -3,11 +3,14 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.openscience.cdk.DefaultChemObjectBuilder; import org.openscience.cdk.Molecule; import org.openscience.cdk.interfaces.IAtom; +import org.openscience.cdk.interfaces.IAtomContainer; import org.openscience.cdk.interfaces.IBond; import org.openscience.cdk.interfaces.IMolecule; import org.openscience.cdk.qsar.result.DoubleArrayResult; +import org.openscience.cdk.smiles.SmilesParser; import javax.vecmath.Point2d; @@ -249,6 +252,28 @@ public void testDan64() throws Exception { Assert.assertEquals(5.5772, ret.get(8), 0.0001); } + /** + * @cdk.bug 3023326 + */ + @Test + public void testCovalentMetal() throws Exception { + SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); + IAtomContainer mol = sp.parseSmiles("CCCC[Sn](CCCC)(CCCC)c1cc(Cl)c(Nc2nc(C)nc(N(CCC)CC3CC3)c2Cl)c(Cl)c1"); + DoubleArrayResult ret = (DoubleArrayResult) descriptor.calculate(mol).getValue(); + Assert.assertNotNull(ret); + } + + /** + * @cdk.bug 3023326 + */ + @Test(expected=NullPointerException.class) + public void testCovalentPlatinum() throws Exception { + SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); + IAtomContainer mol = sp.parseSmiles("CC1CN[Pt]2(N1)OC(=O)C(C)P(=O)(O)O2"); + descriptor.calculate(mol).getValue(); + } + + // @Test public void testDan277() throws CDKException { // // IMolecule molecule = null;