From: <eg...@us...> - 2008-11-16 17:00:30
|
Revision: 13126 http://cdk.svn.sourceforge.net/cdk/?rev=13126&view=rev Author: egonw Date: 2008-11-16 17:00:12 +0000 (Sun, 16 Nov 2008) Log Message: ----------- Added unit tests for the Sybyl atom types; currently fail, because the AbstractAtomTypeTest also tests neighbor counts, etc, which is information that is not yet available from the Sybyl OWL Modified Paths: -------------- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/atomtype/SybylAtomTypeMatcherTest.java Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/atomtype/SybylAtomTypeMatcherTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/atomtype/SybylAtomTypeMatcherTest.java 2008-11-16 16:59:11 UTC (rev 13125) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/atomtype/SybylAtomTypeMatcherTest.java 2008-11-16 17:00:12 UTC (rev 13126) @@ -27,8 +27,11 @@ import org.junit.Assert; import org.junit.Test; +import org.openscience.cdk.Atom; +import org.openscience.cdk.CDKConstants; import org.openscience.cdk.DefaultChemObjectBuilder; import org.openscience.cdk.Molecule; +import org.openscience.cdk.PseudoAtom; import org.openscience.cdk.exception.CDKException; import org.openscience.cdk.interfaces.IAtom; import org.openscience.cdk.interfaces.IAtomContainer; @@ -203,5 +206,52 @@ @Test public void testForDuplicateDefinitions() { super.testForDuplicateDefinitions(); } - + + @Test public void testDummy() throws Exception { + IMolecule mol = new Molecule(); + IAtom atom = new PseudoAtom("R"); + mol.addAtom(atom); + + String[] expectedTypes = {"X"}; + assertAtomTypes(testedAtomTypes, expectedTypes, mol); + } + + @Test public void testEthene() throws Exception { + IMolecule mol = new Molecule(); + IAtom atom = new Atom("C"); + IAtom atom2 = new Atom("C"); + mol.addAtom(atom); + mol.addAtom(atom2); + mol.addBond(0,1,CDKConstants.BONDORDER_DOUBLE); + + String[] expectedTypes = {"C.2", "C.2"}; + assertAtomTypes(testedAtomTypes, expectedTypes, mol); + } + + @Test public void testImine() throws Exception { + IMolecule mol = new Molecule(); + IAtom atom = new Atom("C"); + IAtom atom2 = new Atom("N"); + mol.addAtom(atom); + mol.addAtom(atom2); + mol.addBond(0,1,CDKConstants.BONDORDER_DOUBLE); + + String[] expectedTypes = {"C.2", "N.2"}; + assertAtomTypes(testedAtomTypes, expectedTypes, mol); + } + + @Test public void testPropyne() throws Exception { + IMolecule mol = new Molecule(); + IAtom atom = new Atom("C"); + IAtom atom2 = new Atom("C"); + IAtom atom3 = new Atom("C"); + mol.addAtom(atom); + mol.addAtom(atom2); + mol.addAtom(atom3); + mol.addBond(0,1,CDKConstants.BONDORDER_TRIPLE); + mol.addBond(2,1,CDKConstants.BONDORDER_SINGLE); + + String[] expectedTypes = {"C.1", "C.1", "C.3"}; + assertAtomTypes(testedAtomTypes, expectedTypes, mol); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |