use of org.openscience.cdk.isomorphism.matchers.smarts.ImplicitHCountAtom in project cdk by cdk.
the class SMARTSTest method testImplicitHCountAtom.
@Test
public void testImplicitHCountAtom() throws Exception {
IAtomContainer container = createEthane();
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
// SMARTS [h3][h3]
QueryAtomContainer query1 = new QueryAtomContainer(builder);
SMARTSAtom atom1 = new ImplicitHCountAtom(3, builder);
SMARTSAtom atom2 = new ImplicitHCountAtom(3, builder);
query1.addAtom(atom1);
query1.addAtom(atom2);
query1.addBond(new OrderQueryBond(atom1, atom2, IBond.Order.SINGLE, builder));
Assert.assertTrue(uiTester.isSubgraph(container, query1));
}
use of org.openscience.cdk.isomorphism.matchers.smarts.ImplicitHCountAtom in project cdk by cdk.
the class SMARTSTest method testImplicitHCountAtom2.
@Test
public void testImplicitHCountAtom2() throws Exception {
IAtomContainer container = createEthane();
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
// SMARTS [h3][h2]
QueryAtomContainer query1 = new QueryAtomContainer(builder);
SMARTSAtom atom1 = new ImplicitHCountAtom(3, builder);
SMARTSAtom atom2 = new ImplicitHCountAtom(2, builder);
query1.addAtom(atom1);
query1.addAtom(atom2);
query1.addBond(new OrderQueryBond(atom1, atom2, IBond.Order.SINGLE, builder));
Assert.assertFalse(uiTester.isSubgraph(container, query1));
}
Aggregations