Skip to content

Commit

Permalink
Removed use of SMARTS parser in the test code so that a new dependenc…
Browse files Browse the repository at this point in the history
…y is not required
  • Loading branch information
rajarshi committed May 20, 2010
1 parent 41561a2 commit e561364
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/test/org/openscience/cdk/smsd/SMSDTest.java
Expand Up @@ -23,32 +23,34 @@
*/
package org.openscience.cdk.smsd;

import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import junit.framework.Assert;
import org.junit.After;
import org.junit.AfterClass;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.Molecule;
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.exception.InvalidSmilesException;
import static org.junit.Assert.*;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.io.IChemObjectReader.Mode;
import org.openscience.cdk.io.MDLV2000Reader;
import org.openscience.cdk.isomorphism.matchers.IQueryAtomContainer;
import org.openscience.cdk.isomorphism.matchers.QueryAtomContainerCreator;
import org.openscience.cdk.smiles.SmilesParser;
import org.openscience.cdk.smiles.smarts.parser.SMARTSParser;
import org.openscience.cdk.smsd.algorithm.mcsplus.MCSPlusHandlerTest;
import org.openscience.cdk.smsd.helper.MolHandler;
import org.openscience.cdk.smsd.interfaces.Algorithm;

import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* @author Syed Asad Rahman <asad@ebi.ac.uk>
*
Expand Down Expand Up @@ -503,8 +505,8 @@ public void testQueryAtomContainerDefault() throws CDKException {
boolean foundMatches = smsd.isSubgraph();
Assert.assertTrue(foundMatches);

IQueryAtomContainer query2 = SMARTSParser.parse("CC");
smsd.init(query2, target, false);
IQueryAtomContainer queryContainer = QueryAtomContainerCreator.createSymbolAndBondOrderQueryContainer(query);
smsd.init(queryContainer, target, false);
foundMatches = smsd.isSubgraph();
Assert.assertTrue(foundMatches);
}
Expand All @@ -520,8 +522,8 @@ public void testQueryAtomContainerMCSPLUS() throws CDKException {
boolean foundMatches = smsd.isSubgraph();
Assert.assertTrue(foundMatches);

IQueryAtomContainer query2 = SMARTSParser.parse("CC");
smsd.init(query2, target, false);
IQueryAtomContainer queryContainer = QueryAtomContainerCreator.createSymbolAndBondOrderQueryContainer(query);
smsd.init(queryContainer, target, false);
foundMatches = smsd.isSubgraph();
Assert.assertTrue(foundMatches);
}
Expand All @@ -537,8 +539,8 @@ public void testQueryAtomContainerSubstructure() throws CDKException {
boolean foundMatches = smsd.isSubgraph();
Assert.assertTrue(foundMatches);

IQueryAtomContainer query2 = SMARTSParser.parse("CC");
smsd.init(query2, target, false);
IQueryAtomContainer queryContainer = QueryAtomContainerCreator.createSymbolAndBondOrderQueryContainer(query);
smsd.init(queryContainer, target, false);
foundMatches = smsd.isSubgraph();
Assert.assertTrue(foundMatches);
}
Expand All @@ -554,8 +556,8 @@ public void testQueryAtomContainerTurbo() throws CDKException {
boolean foundMatches = smsd.isSubgraph();
Assert.assertTrue(foundMatches);

IQueryAtomContainer query2 = SMARTSParser.parse("CC");
smsd.init(query2, target, false);
IQueryAtomContainer queryContainer = QueryAtomContainerCreator.createSymbolAndBondOrderQueryContainer(query);
smsd.init(queryContainer, target, false);
foundMatches = smsd.isSubgraph();
Assert.assertTrue(foundMatches);
}
Expand Down

0 comments on commit e561364

Please sign in to comment.