use of org.openscience.cdk.isomorphism.matchers.SymbolAndChargeQueryAtom in project cdk by cdk.
the class SMARTSTest method testMatchInherited.
@Test
public void testMatchInherited() {
try {
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
SymbolQueryAtom c1 = new SymbolQueryAtom(new org.openscience.cdk.Atom("C"));
SymbolAndChargeQueryAtom c2 = new SymbolAndChargeQueryAtom(new org.openscience.cdk.Atom("C"));
IAtomContainer c = TestMoleculeFactory.makeAlkane(2);
QueryAtomContainer query1 = new QueryAtomContainer(builder);
query1.addAtom(c1);
query1.addAtom(c2);
query1.addBond(new OrderQueryBond(c1, c2, Order.SINGLE, builder));
Assert.assertTrue(uiTester.isSubgraph(c, query1));
QueryAtomContainer query = new QueryAtomContainer(builder);
query.addAtom(c1);
query.addAtom(c2);
query.addBond(new AnyOrderQueryBond(c1, c2, Order.SINGLE, builder));
Assert.assertTrue(uiTester.isSubgraph(c, query));
} catch (CDKException exception) {
Assert.fail(exception.getMessage());
}
}
Aggregations