use of org.openscience.cdk.reaction.IReactionProcess in project cdk by cdk.
the class RadicalSiteRrBetaReactionTest method testInitiate_IAtomContainerSet_IAtomContainerSet.
/**
* A unit test suite for JUnit. Reaction:
* Manually put of the center active.
*/
@Test
@Override
public void testInitiate_IAtomContainerSet_IAtomContainerSet() throws Exception {
IReactionProcess type = new RadicalSiteRrBetaReaction();
IAtomContainerSet setOfReactants = getExampleReactants();
IAtomContainer molecule = setOfReactants.getAtomContainer(0);
/* initiate */
molecule.getAtom(0).setFlag(CDKConstants.REACTIVE_CENTER, true);
molecule.getAtom(1).setFlag(CDKConstants.REACTIVE_CENTER, true);
molecule.getAtom(4).setFlag(CDKConstants.REACTIVE_CENTER, true);
molecule.getBond(0).setFlag(CDKConstants.REACTIVE_CENTER, true);
List<IParameterReact> paramList = new ArrayList<>();
IParameterReact param = new SetReactionCenter();
param.setParameter(Boolean.TRUE);
paramList.add(param);
type.setParameterList(paramList);
IReactionSet setOfReactions = type.initiate(setOfReactants, null);
Assert.assertEquals(1, setOfReactions.getReactionCount());
Assert.assertEquals(1, setOfReactions.getReaction(0).getProductCount());
IAtomContainer product = setOfReactions.getReaction(0).getProducts().getAtomContainer(0);
IAtomContainer molecule2 = getExpectedProducts().getAtomContainer(0);
assertEquals(molecule2, product);
}
use of org.openscience.cdk.reaction.IReactionProcess in project cdk by cdk.
the class RadicalSiteRrDeltaReactionTest method testCDKConstants_REACTIVE_CENTER.
/**
* A unit test suite for JUnit.
*/
@Test
public void testCDKConstants_REACTIVE_CENTER() throws Exception {
IReactionProcess type = new RadicalSiteRrDeltaReaction();
IAtomContainerSet setOfReactants = getExampleReactants();
IAtomContainer molecule = setOfReactants.getAtomContainer(0);
/* manually put the reactive center */
molecule.getAtom(0).setFlag(CDKConstants.REACTIVE_CENTER, true);
molecule.getAtom(1).setFlag(CDKConstants.REACTIVE_CENTER, true);
molecule.getAtom(6).setFlag(CDKConstants.REACTIVE_CENTER, true);
molecule.getBond(0).setFlag(CDKConstants.REACTIVE_CENTER, true);
List<IParameterReact> paramList = new ArrayList<>();
IParameterReact param = new SetReactionCenter();
param.setParameter(Boolean.TRUE);
paramList.add(param);
type.setParameterList(paramList);
/* initiate */
IReactionSet setOfReactions = type.initiate(setOfReactants, null);
Assert.assertEquals(1, setOfReactions.getReactionCount());
IAtomContainer reactant = setOfReactions.getReaction(0).getReactants().getAtomContainer(0);
Assert.assertTrue(molecule.getAtom(0).getFlag(CDKConstants.REACTIVE_CENTER));
Assert.assertTrue(reactant.getAtom(0).getFlag(CDKConstants.REACTIVE_CENTER));
Assert.assertTrue(molecule.getAtom(1).getFlag(CDKConstants.REACTIVE_CENTER));
Assert.assertTrue(reactant.getAtom(1).getFlag(CDKConstants.REACTIVE_CENTER));
Assert.assertTrue(molecule.getAtom(6).getFlag(CDKConstants.REACTIVE_CENTER));
Assert.assertTrue(reactant.getAtom(6).getFlag(CDKConstants.REACTIVE_CENTER));
Assert.assertTrue(molecule.getBond(0).getFlag(CDKConstants.REACTIVE_CENTER));
Assert.assertTrue(reactant.getBond(0).getFlag(CDKConstants.REACTIVE_CENTER));
}
use of org.openscience.cdk.reaction.IReactionProcess in project cdk by cdk.
the class RadicalSiteRrDeltaReactionTest method testRadicalSiteRrDeltaReaction.
/**
* The JUnit setup method
*/
@Test
public void testRadicalSiteRrDeltaReaction() throws Exception {
IReactionProcess type = new RadicalSiteRrDeltaReaction();
Assert.assertNotNull(type);
}
use of org.openscience.cdk.reaction.IReactionProcess in project cdk by cdk.
the class RadicalSiteRrDeltaReactionTest method testInitiate_IAtomContainerSet_IAtomContainerSet.
/**
* A unit test suite for JUnit. Reaction:
* Manually put of the center active.
*/
@Test
@Override
public void testInitiate_IAtomContainerSet_IAtomContainerSet() throws Exception {
IReactionProcess type = new RadicalSiteRrDeltaReaction();
IAtomContainerSet setOfReactants = getExampleReactants();
IAtomContainer molecule = setOfReactants.getAtomContainer(0);
/* initiate */
molecule.getAtom(0).setFlag(CDKConstants.REACTIVE_CENTER, true);
molecule.getAtom(1).setFlag(CDKConstants.REACTIVE_CENTER, true);
molecule.getAtom(6).setFlag(CDKConstants.REACTIVE_CENTER, true);
molecule.getBond(0).setFlag(CDKConstants.REACTIVE_CENTER, true);
List<IParameterReact> paramList = new ArrayList<>();
IParameterReact param = new SetReactionCenter();
param.setParameter(Boolean.TRUE);
paramList.add(param);
type.setParameterList(paramList);
IReactionSet setOfReactions = type.initiate(setOfReactants, null);
Assert.assertEquals(1, setOfReactions.getReactionCount());
Assert.assertEquals(1, setOfReactions.getReaction(0).getProductCount());
IAtomContainer product = setOfReactions.getReaction(0).getProducts().getAtomContainer(0);
IAtomContainer molecule2 = getExpectedProducts().getAtomContainer(0);
assertEquals(molecule2, product);
}
use of org.openscience.cdk.reaction.IReactionProcess in project cdk by cdk.
the class RadicalSiteRrGammaReactionTest method testRadicalSiteRrGammaReaction.
/**
* The JUnit setup method
*/
@Test
public void testRadicalSiteRrGammaReaction() throws Exception {
IReactionProcess type = new RadicalSiteRrGammaReaction();
Assert.assertNotNull(type);
}
Aggregations