From 74f866127615cf3027402cb61449c44c8d6a35fb Mon Sep 17 00:00:00 2001 From: Rajarshi Guha Date: Mon, 18 Oct 2010 22:51:55 -0400 Subject: [PATCH] Added unit test for bug 2853035, which appears to be resolved now --- .../CDKHueckelAromaticityDetectorTest.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/test/org/openscience/cdk/aromaticity/CDKHueckelAromaticityDetectorTest.java b/src/test/org/openscience/cdk/aromaticity/CDKHueckelAromaticityDetectorTest.java index e9e37a84a3e..0ee70b4c2af 100644 --- a/src/test/org/openscience/cdk/aromaticity/CDKHueckelAromaticityDetectorTest.java +++ b/src/test/org/openscience/cdk/aromaticity/CDKHueckelAromaticityDetectorTest.java @@ -907,5 +907,33 @@ public void test3001616() throws Exception { } } + /** + * @cdk.bug 2853035 + */ + @Test + public void testBug2853035() throws Exception { + SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); + IMolecule mol = sp.parseSmiles("C(=O)c1cnn2ccccc12"); + AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); + Assert.assertTrue(CDKHueckelAromaticityDetector.detectAromaticity(mol)); + for (IAtom atom : mol.atoms()) { + if (atom.getSymbol().equals("N")) { + Assert.assertTrue(atom.getFlag(CDKConstants.ISAROMATIC)); + List conbonds = mol.getConnectedBondsList(atom); + for (IBond bond : conbonds) { + if (bond.getOrder().equals(IBond.Order.SINGLE)) continue; + Assert.assertTrue(bond.getFlag(CDKConstants.ISAROMATIC)); + } + } + } + SpanningTree st = new SpanningTree(mol); + IRingSet ringSet = st.getAllRings(); + for (IAtomContainer ring : ringSet.atomContainers()) { + for (IBond bond : ring.bonds()) { + Assert.assertTrue(bond.getFlag(CDKConstants.ISAROMATIC)); + } + } + } + }