From: <eg...@us...> - 2006-11-30 22:08:59
|
Revision: 7396 http://svn.sourceforge.net/cdk/?rev=7396&view=rev Author: egonw Date: 2006-11-30 14:08:57 -0800 (Thu, 30 Nov 2006) Log Message: ----------- Added test for #1572062. Modified Paths: -------------- trunk/cdk/src/org/openscience/cdk/test/layout/StructureDiagramGeneratorTest.java Added Paths: ----------- trunk/cdk/src/data/mdl/sdg_test.mol Added: trunk/cdk/src/data/mdl/sdg_test.mol =================================================================== --- trunk/cdk/src/data/mdl/sdg_test.mol (rev 0) +++ trunk/cdk/src/data/mdl/sdg_test.mol 2006-11-30 22:08:57 UTC (rev 7396) @@ -0,0 +1,67 @@ +sdg_test.mol + -ISIS- 10040511462D + + 29 31 0 0 0 0 0 0 0 0999 V2000 + 0.9792 0.4625 0.0000 N 0 0 3 0 0 0 0 0 0 0 0 0 + 1.4500 1.1458 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.4875 -0.2167 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2792 0.0625 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2542 0.9125 0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0 + 2.9167 -0.5000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.1042 0.4500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0958 -0.9792 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.1458 1.1958 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1667 1.9333 0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0 + -0.2958 1.1958 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.6625 -0.2667 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.5625 0.4708 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2500 -1.0542 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -2.8208 -0.2667 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7375 -0.2042 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.4125 0.4708 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.7000 -1.7167 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.5458 1.9333 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3875 -0.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.9208 -0.9875 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1792 -0.4792 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.8292 -1.0042 0.0000 Br 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0833 0.4625 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.6625 1.1833 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.6792 0.9000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8792 0.6208 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.8333 1.1958 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.3167 0.3500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2 1 1 0 0 0 0 + 3 1 1 0 0 0 0 + 4 3 1 0 0 0 0 + 5 2 1 0 0 0 0 + 6 4 2 0 0 0 0 + 7 1 1 0 0 0 0 + 8 12 1 0 0 0 0 + 9 11 1 0 0 0 0 + 10 2 2 0 0 0 0 + 11 7 1 0 0 0 0 + 12 15 2 0 0 0 0 + 13 9 1 0 0 0 0 + 14 3 2 0 0 0 0 + 15 17 1 0 0 0 0 + 16 6 1 0 0 0 0 + 17 13 1 0 0 0 0 + 18 8 2 0 0 0 0 + 19 9 2 0 0 0 0 + 20 16 2 0 0 0 0 + 21 8 1 0 0 0 0 + 22 20 1 0 0 0 0 + 23 22 1 0 0 0 0 + 24 25 2 0 0 0 0 + 25 28 1 0 0 0 0 + 26 27 2 0 0 0 0 + 27 16 1 0 0 0 0 + 28 17 2 0 0 0 0 + 29 26 1 0 0 0 0 + 4 5 1 0 0 0 0 + 29 22 2 0 0 0 0 + 24 12 1 0 0 0 0 +M END + + Modified: trunk/cdk/src/org/openscience/cdk/test/layout/StructureDiagramGeneratorTest.java =================================================================== --- trunk/cdk/src/org/openscience/cdk/test/layout/StructureDiagramGeneratorTest.java 2006-11-30 22:02:57 UTC (rev 7395) +++ trunk/cdk/src/org/openscience/cdk/test/layout/StructureDiagramGeneratorTest.java 2006-11-30 22:08:57 UTC (rev 7396) @@ -45,6 +45,7 @@ import org.openscience.cdk.interfaces.IChemSequence; import org.openscience.cdk.interfaces.IMolecule; import org.openscience.cdk.io.CMLReader; +import org.openscience.cdk.io.IChemObjectReader; import org.openscience.cdk.io.MDLReader; import org.openscience.cdk.layout.StructureDiagramGenerator; import org.openscience.cdk.nonotify.NoNotificationChemObjectBuilder; @@ -468,6 +469,27 @@ new StructureDiagramGenerator(cdkMol).generateCoordinates(); } + public void testBug1572062() throws Exception { + String filename = "data/mdl/sdg_test.mol"; + +// set up molecule reader + InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename); + IChemObjectReader molReader = new MDLReader(ins); + +// read molecule + IMolecule molecule = (IMolecule) molReader.read(new + Molecule()); + +// rebuild 2D coordinates + StructureDiagramGenerator structureDiagramGenerator = + new StructureDiagramGenerator(); + for (int i = 0; i < 10; i++) { + structureDiagramGenerator.setMolecule(molecule); + structureDiagramGenerator.generateCoordinates(); + } + + } + /** * A unit test for JUnit * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |