Search in sources :

Example 1 with MultipleGroup

use of ambit2.core.groups.MultipleGroup in project ambit-mirror by ideaconsult.

the class MDLV2000ReaderExtendedTest method testMUL_MON2.

@Test
public void testMUL_MON2() throws Exception {
    IChemObject mol = readSGroup("12401-47-7.mol");
    Assert.assertNotNull(mol);
    Assert.assertTrue(mol instanceof SuppleAtomContainer);
    SuppleAtomContainer sca = (SuppleAtomContainer) mol;
    sca.setFiltered(false);
    Assert.assertEquals(3, sca.getBondCount());
    Assert.assertEquals(7 + 3, sca.getAtomCount());
    List<ISGroup> superatom = getGroup(sca);
    Assert.assertNotNull(superatom);
    Assert.assertEquals(3, superatom.size());
    int mon = 0;
    int mul = 0;
    for (int i = 0; i < superatom.size(); i++) {
        ISGroup g = superatom.get(i);
        if (g instanceof MonomerGroup) {
            Assert.assertEquals("mon", g.getSubscript());
            mon++;
        }
        if (g instanceof MultipleGroup) {
            mul++;
            Assert.assertEquals(SGROUP_CONNECTIVITY.HT, g.getProperty(ISGroup.SGROUP_CONNECTIVITY));
            Assert.assertEquals("2", g.getSubscript());
        }
    }
    Assert.assertEquals(1, mul);
    Assert.assertEquals(2, mon);
    sca.setFiltered(true);
    verify((IAtomContainer) mol, superatom, false, 6, 3, false);
    verify((IAtomContainer) mol, superatom, true, 7, 3, false);
}
Also used : ISGroup(ambit2.core.groups.ISGroup) IChemObject(org.openscience.cdk.interfaces.IChemObject) SuppleAtomContainer(ambit2.core.groups.SuppleAtomContainer) MonomerGroup(ambit2.core.groups.MonomerGroup) MultipleGroup(ambit2.core.groups.MultipleGroup) Test(org.junit.Test)

Aggregations

ISGroup (ambit2.core.groups.ISGroup)1 MonomerGroup (ambit2.core.groups.MonomerGroup)1 MultipleGroup (ambit2.core.groups.MultipleGroup)1 SuppleAtomContainer (ambit2.core.groups.SuppleAtomContainer)1 Test (org.junit.Test)1 IChemObject (org.openscience.cdk.interfaces.IChemObject)1