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);
}
Aggregations