/** * Loads a molecule with two adamantanes and one cubane * substructure and tests whether all are found. */ public void getMappedSubstructures_IAtomContainer() throws Exception { // Set up molecule reader String filename = "data/mdl/diadamantane-cubane.mol"; InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename); ISimpleChemObjectReader molReader = new MDLReader(ins, Mode.STRICT); // Read molecule IAtomContainer molecule = (IAtomContainer) molReader.read(DefaultChemObjectBuilder.getInstance().newInstance( IAtomContainer.class)); // Map templates TemplateHandler th = new TemplateHandler(DefaultChemObjectBuilder.getInstance()); IAtomContainerSet mappedStructures = th.getMappedSubstructures(molecule); // Do the Assert.assertion Assert.assertEquals("3 mapped templates", 3, mappedStructures.getAtomContainerCount()); }