Navigation Menu

Skip to content

Commit

Permalink
Initiating only one time the function LonePairElectronChecker
Browse files Browse the repository at this point in the history
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
Miguel Rojas Cherto authored and egonw committed Feb 1, 2010
1 parent 4f5e8a1 commit e71b52e
Show file tree
Hide file tree
Showing 27 changed files with 55 additions and 45 deletions.
Expand Up @@ -57,7 +57,8 @@
* @cdk.module test-reaction
*/
public class AdductionProtonLPReactionTest extends ReactionProcessTest {


private final LonePairElectronChecker lpcheck = new LonePairElectronChecker();
private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down Expand Up @@ -244,7 +245,7 @@ private IMoleculeSet getExampleReactants() {
try {
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);

LonePairElectronChecker lpcheck = new LonePairElectronChecker();

lpcheck.saturate(molecule);
} catch (CDKException e) {
e.printStackTrace();
Expand Down Expand Up @@ -281,7 +282,7 @@ private IMoleculeSet getExpectedProducts() {
try {
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);

LonePairElectronChecker lpcheck = new LonePairElectronChecker();

lpcheck.saturate(molecule);
} catch (CDKException e) {
e.printStackTrace();
Expand Down
Expand Up @@ -57,7 +57,8 @@
* @cdk.module test-reaction
*/
public class AdductionProtonPBReactionTest extends ReactionProcessTest {


private final LonePairElectronChecker lpcheck = new LonePairElectronChecker();
private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down Expand Up @@ -244,7 +245,7 @@ private IMoleculeSet getExampleReactants() {
try {
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);

LonePairElectronChecker lpcheck = new LonePairElectronChecker();

lpcheck.saturate(molecule);
} catch (CDKException e) {
e.printStackTrace();
Expand Down Expand Up @@ -278,7 +279,7 @@ private IMoleculeSet getExpectedProducts() {
try {
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);

LonePairElectronChecker lpcheck = new LonePairElectronChecker();

lpcheck.saturate(molecule);
} catch (CDKException e) {
e.printStackTrace();
Expand Down
Expand Up @@ -57,7 +57,8 @@
* @cdk.module test-reaction
*/
public class AdductionSodiumLPReactionTest extends ReactionProcessTest {


private final LonePairElectronChecker lpcheck = new LonePairElectronChecker();
private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down Expand Up @@ -252,7 +253,7 @@ private IMoleculeSet getExampleReactants() {
try {
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);

LonePairElectronChecker lpcheck = new LonePairElectronChecker();

lpcheck.saturate(molecule);
} catch (CDKException e) {
e.printStackTrace();
Expand Down Expand Up @@ -288,7 +289,7 @@ private IMoleculeSet getExpectedProducts() {
try {
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);

LonePairElectronChecker lpcheck = new LonePairElectronChecker();

lpcheck.saturate(molecule);
} catch (CDKException e) {
e.printStackTrace();
Expand Down
Expand Up @@ -58,7 +58,8 @@
* @cdk.module test-reaction
*/
public class CarbonylEliminationReactionTest extends ReactionProcessTest {


private final LonePairElectronChecker lpcheck = new LonePairElectronChecker();
private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down Expand Up @@ -220,7 +221,7 @@ private IMoleculeSet getExampleReactants() {
try {
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);

LonePairElectronChecker lpcheck = new LonePairElectronChecker();

lpcheck.saturate(molecule);
makeSureAtomTypesAreRecognized(molecule);
} catch (CDKException e) {
Expand Down
Expand Up @@ -53,7 +53,7 @@
*/

public class ElectronImpactSDBReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -48,6 +48,7 @@
import org.openscience.cdk.reaction.ReactionProcessTest;
import org.openscience.cdk.reaction.type.parameters.IParameterReact;
import org.openscience.cdk.reaction.type.parameters.SetReactionCenter;
import org.openscience.cdk.tools.LonePairElectronChecker;
import org.openscience.cdk.tools.manipulator.ReactionManipulator;

/**
Expand All @@ -57,7 +58,7 @@
* @cdk.module test-reaction
*/
public class HyperconjugationReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -59,7 +59,7 @@
* @cdk.module test-reaction
*/
public class PiBondingMovementReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -58,7 +58,7 @@
* @cdk.module test-reaction
*/
public class RadicalChargeSiteInitiationHReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -55,7 +55,7 @@
* @cdk.module test-reaction
*/
public class RadicalChargeSiteInitiationReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -58,7 +58,7 @@
* @cdk.module test-reaction
*/
public class RadicalSiteHrAlphaReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -58,7 +58,7 @@
* @cdk.module test-reaction
*/
public class RadicalSiteHrBetaReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -59,7 +59,7 @@
* @cdk.module test-reaction
*/
public class RadicalSiteHrDeltaReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -59,7 +59,7 @@
* @cdk.module test-reaction
*/
public class RadicalSiteHrGammaReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -59,7 +59,7 @@
* @cdk.module test-reaction
*/
public class RadicalSiteInitiationHReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -59,7 +59,7 @@
* @cdk.module test-reaction
*/
public class RadicalSiteInitiationReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -58,7 +58,7 @@
* @cdk.module test-reaction
*/
public class RadicalSiteRrAlphaReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -58,7 +58,7 @@
* @cdk.module test-reaction
*/
public class RadicalSiteRrBetaReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -58,7 +58,7 @@
* @cdk.module test-reaction
*/
public class RadicalSiteRrDeltaReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -58,7 +58,7 @@
* @cdk.module test-reaction
*/
public class RadicalSiteRrGammaReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -90,7 +90,8 @@
*/

public class RearrangementAnionReactionTest extends ReactionProcessTest {


private final LonePairElectronChecker lpcheck = new LonePairElectronChecker();
private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down Expand Up @@ -290,7 +291,7 @@ public RearrangementAnionReactionTest() throws Exception {
molecule.addBond(6, 1, IBond.Order.SINGLE);

addExplicitHydrogens(molecule);
LonePairElectronChecker lpcheck = new LonePairElectronChecker();

AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
lpcheck.saturate(molecule);

Expand Down
Expand Up @@ -59,7 +59,7 @@
* @cdk.module test-reaction
*/
public class RearrangementCationReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -91,7 +91,8 @@
*/

public class RearrangementLonePairReactionTest extends ReactionProcessTest {


private final LonePairElectronChecker lpcheck = new LonePairElectronChecker();
private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down Expand Up @@ -304,7 +305,7 @@ private IMoleculeSet getExampleReactants() {
addExplicitHydrogens(molecule);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);

LonePairElectronChecker lpcheck = new LonePairElectronChecker();

lpcheck.saturate(molecule);
} catch (Exception e) {
e.printStackTrace();
Expand Down Expand Up @@ -338,7 +339,7 @@ private IMoleculeSet getExpectedProducts() {
addExplicitHydrogens(molecule);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);

LonePairElectronChecker lpcheck = new LonePairElectronChecker();

lpcheck.saturate(molecule);

} catch (Exception e) {
Expand Down Expand Up @@ -392,7 +393,7 @@ private void makeSureAtomTypesAreRecognized(IMolecule molecule) throws Exception

addExplicitHydrogens(molecule);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
LonePairElectronChecker lpcheck = new LonePairElectronChecker();

lpcheck.saturate(molecule);

IReactionProcess type = new RearrangementLonePairReaction();
Expand Down
Expand Up @@ -59,7 +59,7 @@
* @cdk.module test-reaction
*/
public class RearrangementRadicalReactionTest extends ReactionProcessTest {

private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down
Expand Up @@ -60,7 +60,8 @@
*/

public class SharingAnionReactionTest extends ReactionProcessTest {


private final LonePairElectronChecker lpcheck = new LonePairElectronChecker();
private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down Expand Up @@ -171,7 +172,7 @@ public SharingAnionReactionTest() throws Exception {

addExplicitHydrogens(molecule);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
LonePairElectronChecker lpcheck = new LonePairElectronChecker();

lpcheck.saturate(molecule);

IMoleculeSet setOfReactants = DefaultChemObjectBuilder.getInstance().newMoleculeSet();
Expand Down Expand Up @@ -308,7 +309,7 @@ private IMoleculeSet getExampleReactants() {
try {
addExplicitHydrogens(molecule);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
LonePairElectronChecker lpcheck = new LonePairElectronChecker();

lpcheck.saturate(molecule);
} catch (Exception e) {
e.printStackTrace();
Expand All @@ -333,7 +334,7 @@ private IMoleculeSet getExpectedProducts() {
try {
addExplicitHydrogens(molecule);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
LonePairElectronChecker lpcheck = new LonePairElectronChecker();

lpcheck.saturate(molecule);
} catch (Exception e) {
e.printStackTrace();
Expand Down
Expand Up @@ -59,7 +59,8 @@
* @cdk.module test-reaction
*/
public class SharingChargeDBReactionTest extends ReactionProcessTest {


private final LonePairElectronChecker lpcheck = new LonePairElectronChecker();
private IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
/**
* The JUnit setup method
Expand Down Expand Up @@ -254,7 +255,7 @@ private IMoleculeSet getExampleReactants() {
try {
addExplicitHydrogens(molecule);

LonePairElectronChecker lpcheck = new LonePairElectronChecker();

AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
lpcheck.saturate(molecule);
} catch (Exception e) {
Expand All @@ -281,7 +282,7 @@ private IMoleculeSet getExpectedProducts() {

try {
addExplicitHydrogens(molecule);
LonePairElectronChecker lpcheck = new LonePairElectronChecker();

AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
lpcheck.saturate(molecule);
} catch (Exception e) {
Expand Down

0 comments on commit e71b52e

Please sign in to comment.