Skip to content

Commit 015956c

Browse files
johnmayegonw
authored andcommitted
Eliminate testdata dependency from cdk-test-standard.
1 parent 7c8e4b7 commit 015956c

28 files changed

+269
-57
lines changed

base/test-standard/src/test/java/org/openscience/cdk/geometry/BondToolsTest.java

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public BondToolsTest() {
4545

4646
@Test
4747
public void testIsValidDoubleBondConfiguration_IAtomContainer_IBond() throws Exception {
48-
String filename = "data/mdl/testdoublebondconfig.mol";
49-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
48+
String filename = "testdoublebondconfig.mol";
49+
InputStream ins = this.getClass().getResourceAsStream(filename);
5050
MDLV2000Reader reader = new MDLV2000Reader(ins);
5151
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
5252
IAtomContainer mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);
@@ -62,8 +62,8 @@ public void testIsValidDoubleBondConfiguration_IAtomContainer_IBond() throws Exc
6262

6363
@Test
6464
public void testIsCisTrans_IAtom_IAtom_IAtom_IAtom_IAtomContainer() throws Exception {
65-
String filename = "data/mdl/testdoublebondconfig.mol";
66-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
65+
String filename = "testdoublebondconfig.mol";
66+
InputStream ins = this.getClass().getResourceAsStream(filename);
6767
MDLV2000Reader reader = new MDLV2000Reader(ins);
6868
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
6969
IAtomContainer mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);
@@ -72,8 +72,8 @@ public void testIsCisTrans_IAtom_IAtom_IAtom_IAtom_IAtomContainer() throws Excep
7272

7373
@Test
7474
public void testIsLeft_IAtom_IAtom_IAtom() throws Exception {
75-
String filename = "data/mdl/testdoublebondconfig.mol";
76-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
75+
String filename = "testdoublebondconfig.mol";
76+
InputStream ins = this.getClass().getResourceAsStream(filename);
7777
MDLV2000Reader reader = new MDLV2000Reader(ins);
7878
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
7979
IAtomContainer mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);
@@ -82,8 +82,8 @@ public void testIsLeft_IAtom_IAtom_IAtom() throws Exception {
8282

8383
@Test
8484
public void testGiveAngleBothMethods_IAtom_IAtom_IAtom_boolean() throws Exception {
85-
String filename = "data/mdl/testdoublebondconfig.mol";
86-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
85+
String filename = "testdoublebondconfig.mol";
86+
InputStream ins = this.getClass().getResourceAsStream(filename);
8787
MDLV2000Reader reader = new MDLV2000Reader(ins);
8888
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
8989
IAtomContainer mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);
@@ -115,8 +115,8 @@ public void testCloseEnoughToBond_IAtom_IAtom_double() throws Exception {
115115

116116
@Test
117117
public void testGiveAngleBothMethods_Point2d_Point2d_Point2d_boolean() throws Exception {
118-
String filename = "data/mdl/testdoublebondconfig.mol";
119-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
118+
String filename = "testdoublebondconfig.mol";
119+
InputStream ins = this.getClass().getResourceAsStream(filename);
120120
MDLV2000Reader reader = new MDLV2000Reader(ins);
121121
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
122122
IAtomContainer mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);
@@ -128,15 +128,15 @@ public void testGiveAngleBothMethods_Point2d_Point2d_Point2d_boolean() throws Ex
128128

129129
@Test
130130
public void testIsTetrahedral_IAtomContainer_IAtom_boolean() throws Exception {
131-
String filename = "data/mdl/tetrahedral_1.mol";
132-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
131+
String filename = "tetrahedral_1.mol";
132+
InputStream ins = this.getClass().getResourceAsStream(filename);
133133
MDLV2000Reader reader = new MDLV2000Reader(ins);
134134
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
135135
IAtomContainer mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);
136136
Assert.assertEquals(BondTools.isTetrahedral(mol, mol.getAtom(0), true), 1);
137137
Assert.assertEquals(BondTools.isTetrahedral(mol, mol.getAtom(1), true), 0);
138-
filename = "data/mdl/tetrahedral_1_lazy.mol";
139-
ins = this.getClass().getClassLoader().getResourceAsStream(filename);
138+
filename = "tetrahedral_1_lazy.mol";
139+
ins = this.getClass().getResourceAsStream(filename);
140140
reader = new MDLV2000Reader(ins);
141141
chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
142142
mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);
@@ -146,8 +146,8 @@ public void testIsTetrahedral_IAtomContainer_IAtom_boolean() throws Exception {
146146

147147
@Test
148148
public void testIsTrigonalBipyramidalOrOctahedral_IAtomContainer_IAtom() throws Exception {
149-
String filename = "data/mdl/trigonal_bipyramidal.mol";
150-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
149+
String filename = "trigonal_bipyramidal.mol";
150+
InputStream ins = this.getClass().getResourceAsStream(filename);
151151
MDLV2000Reader reader = new MDLV2000Reader(ins);
152152
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
153153
IAtomContainer mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);
@@ -157,8 +157,8 @@ public void testIsTrigonalBipyramidalOrOctahedral_IAtomContainer_IAtom() throws
157157

158158
@Test
159159
public void testIsStereo_IAtomContainer_IAtom() throws Exception {
160-
String filename = "data/mdl/trigonal_bipyramidal.mol";
161-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
160+
String filename = "trigonal_bipyramidal.mol";
161+
InputStream ins = this.getClass().getResourceAsStream(filename);
162162
MDLV2000Reader reader = new MDLV2000Reader(ins);
163163
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
164164
IAtomContainer mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);
@@ -168,8 +168,8 @@ public void testIsStereo_IAtomContainer_IAtom() throws Exception {
168168

169169
@Test
170170
public void testIsStereo_IAtomContainer_IAtom_forinvalid() throws Exception {
171-
String filename = "data/mdl/trigonal_bipyramidal.mol";
172-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
171+
String filename = "trigonal_bipyramidal.mol";
172+
InputStream ins = this.getClass().getResourceAsStream(filename);
173173
MDLV2000Reader reader = new MDLV2000Reader(ins);
174174
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
175175
IAtomContainer mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);
@@ -182,8 +182,8 @@ public void testIsStereo_IAtomContainer_IAtom_forinvalid() throws Exception {
182182

183183
@Test
184184
public void testIsSquarePlanar_IAtomContainer_IAtom() throws Exception {
185-
String filename = "data/mdl/squareplanar.mol";
186-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
185+
String filename = "squareplanar.mol";
186+
InputStream ins = this.getClass().getResourceAsStream(filename);
187187
MDLV2000Reader reader = new MDLV2000Reader(ins);
188188
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
189189
IAtomContainer mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);
@@ -193,14 +193,14 @@ public void testIsSquarePlanar_IAtomContainer_IAtom() throws Exception {
193193

194194
@Test
195195
public void testStereosAreOpposite_IAtomContainer_IAtom() throws Exception {
196-
String filename = "data/mdl/squareplanar.mol";
197-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
196+
String filename = "squareplanar.mol";
197+
InputStream ins = this.getClass().getResourceAsStream(filename);
198198
MDLV2000Reader reader = new MDLV2000Reader(ins);
199199
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
200200
IAtomContainer mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);
201201
Assert.assertFalse(BondTools.stereosAreOpposite(mol, mol.getAtom(0)));
202-
filename = "data/mdl/tetrahedral_with_four_wedges.mol";
203-
ins = this.getClass().getClassLoader().getResourceAsStream(filename);
202+
filename = "tetrahedral_with_four_wedges.mol";
203+
ins = this.getClass().getResourceAsStream(filename);
204204
reader = new MDLV2000Reader(ins);
205205
chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
206206
mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);
@@ -209,8 +209,8 @@ public void testStereosAreOpposite_IAtomContainer_IAtom() throws Exception {
209209

210210
@Test
211211
public void testMakeUpDownBonds_IAtomContainer() throws Exception {
212-
String filename = "data/mdl/tetrahedral_2_lazy.mol";
213-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
212+
String filename = "tetrahedral_2_lazy.mol";
213+
InputStream ins = this.getClass().getResourceAsStream(filename);
214214
MDLV2000Reader reader = new MDLV2000Reader(ins);
215215
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
216216
IAtomContainer mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);
@@ -220,8 +220,8 @@ public void testMakeUpDownBonds_IAtomContainer() throws Exception {
220220

221221
@Test
222222
public void testGiveAngle_IAtom_IAtom_IAtom() throws Exception {
223-
String filename = "data/mdl/testdoublebondconfig.mol";
224-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
223+
String filename = "testdoublebondconfig.mol";
224+
InputStream ins = this.getClass().getResourceAsStream(filename);
225225
MDLV2000Reader reader = new MDLV2000Reader(ins);
226226
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
227227
IAtomContainer mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);
@@ -231,8 +231,8 @@ public void testGiveAngle_IAtom_IAtom_IAtom() throws Exception {
231231

232232
@Test
233233
public void testGiveAngleFromMiddle_IAtom_IAtom_IAtom() throws Exception {
234-
String filename = "data/mdl/testdoublebondconfig.mol";
235-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
234+
String filename = "testdoublebondconfig.mol";
235+
InputStream ins = this.getClass().getResourceAsStream(filename);
236236
MDLV2000Reader reader = new MDLV2000Reader(ins);
237237
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
238238
IAtomContainer mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);
@@ -245,8 +245,8 @@ public void testGiveAngleFromMiddle_IAtom_IAtom_IAtom() throws Exception {
245245
*/
246246
@Test
247247
public void testBug2831420() throws Exception {
248-
String filename = "data/mdl/bug2831420.mol";
249-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
248+
String filename = "bug2831420.mol";
249+
InputStream ins = this.getClass().getResourceAsStream(filename);
250250
MDLV2000Reader reader = new MDLV2000Reader(ins);
251251
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
252252
IAtomContainer mol = chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getAtomContainer(0);

base/test-standard/src/test/java/org/openscience/cdk/graph/ConnectivityCheckerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ public void testNoAtomsIsConnected() {
228228

229229
@Test
230230
public void copySgroups() throws Exception {
231-
String filename = "data/mdl/sgroup-split.mol";
232-
try(InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
231+
String filename = "sgroup-split.mol";
232+
try(InputStream ins = this.getClass().getResourceAsStream(filename);
233233
ISimpleChemObjectReader reader = new MDLV2000Reader(ins);
234234
){
235235
ChemFile content = (ChemFile) reader.read((ChemObject) new ChemFile());

base/test-standard/src/test/java/org/openscience/cdk/graph/invariant/MorganNumbersToolsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public void testPhenylamine() {
7878
*/
7979
@Test
8080
public void testBug2846213() throws CDKException {
81-
String filename = "data/mdl/bug2846213.mol";
82-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
81+
String filename = "bug2846213.mol";
82+
InputStream ins = this.getClass().getResourceAsStream(filename);
8383
MDLV2000Reader reader = new MDLV2000Reader(ins, Mode.STRICT);
8484
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
8585
IAtomContainer ac = ChemFileManipulator.getAllAtomContainers(chemFile).get(0);

base/test-standard/src/test/java/org/openscience/cdk/isomorphism/UniversalIsomorphismTesterTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,8 @@ public void testSingleAtomMatching3() throws CDKException {
551551
@Test
552552
public void testUITTimeoutFix() throws Exception {
553553
// Load molecules
554-
String filename = "data/mdl/UITTimeout.sdf";
555-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
554+
String filename = "UITTimeout.sdf";
555+
InputStream ins = this.getClass().getResourceAsStream(filename);
556556
ISimpleChemObjectReader reader = new MDLV2000Reader(ins);
557557
ChemFile content = (ChemFile) reader.read(new ChemFile());
558558
List<IAtomContainer> cList = ChemFileManipulator.getAllAtomContainers(content);

base/test-standard/src/test/java/org/openscience/cdk/ringsearch/AllRingsFinderTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ public void testCholoylCoA() throws Exception {
174174
IRingSet ringSet = null;
175175
AllRingsFinder arf = new AllRingsFinder();
176176

177-
String filename = "data/mdl/choloylcoa.mol";
178-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
177+
String filename = "choloylcoa.mol";
178+
InputStream ins = this.getClass().getResourceAsStream(filename);
179179
MDLV2000Reader reader = new MDLV2000Reader(ins);
180180
IChemFile chemFile = (IChemFile) reader.read(new org.openscience.cdk.ChemFile());
181181
IChemSequence seq = chemFile.getChemSequence(0);
@@ -191,8 +191,8 @@ public void testAzulene() throws Exception {
191191
IRingSet ringSet = null;
192192
AllRingsFinder arf = new AllRingsFinder();
193193

194-
String filename = "data/mdl/azulene.mol";
195-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
194+
String filename = "azulene.mol";
195+
InputStream ins = this.getClass().getResourceAsStream(filename);
196196
MDLV2000Reader reader = new MDLV2000Reader(ins);
197197
IChemFile chemFile = (IChemFile) reader.read(new org.openscience.cdk.ChemFile());
198198
IChemSequence seq = chemFile.getChemSequence(0);
@@ -211,8 +211,8 @@ public void testBigMoleculeWithIsolatedRings() throws Exception {
211211
IRingSet ringSet = null;
212212
AllRingsFinder arf = new AllRingsFinder();
213213

214-
String filename = "data/cml/isolated_ringsystems.cml";
215-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
214+
String filename = "isolated_ringsystems.cml";
215+
InputStream ins = this.getClass().getResourceAsStream(filename);
216216

217217
CMLReader reader = new CMLReader(ins);
218218
IChemFile chemFile = (IChemFile) reader.read(new org.openscience.cdk.ChemFile());
@@ -250,10 +250,10 @@ public void testBug777488() throws Exception {
250250
Assume.assumeTrue(runSlowTests());
251251

252252
//String filename = "data/Bug646.cml";
253-
String filename = "data/cml/testBug777488-1-AllRingsFinder.cml";
253+
String filename = "testBug777488-1-AllRingsFinder.cml";
254254
//String filename = "data/NCI_diversity_528.mol.cml";
255255
//String filename = "data/NCI_diversity_978.mol.cml";
256-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
256+
InputStream ins = this.getClass().getResourceAsStream(filename);
257257
CMLReader reader = new CMLReader(ins);
258258
IChemFile chemFile = (IChemFile) reader.read(new org.openscience.cdk.ChemFile());
259259
IChemSequence seq = chemFile.getChemSequence(0);

base/test-standard/src/test/java/org/openscience/cdk/stereo/StereoElementFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ public void inverse_style_downbond_ambiguous() throws CDKException {
623623
public void inverse_style_downbond_dopachrome() throws Exception {
624624
MDLV2000Reader mdl = null;
625625
try {
626-
mdl = new MDLV2000Reader(getClass().getResourceAsStream("/data/mdl/CPD-7272.mol"));
626+
mdl = new MDLV2000Reader(getClass().getResourceAsStream("CPD-7272.mol"));
627627
IAtomContainer ac = mdl.read(new AtomContainer());
628628

629629
// MDL reader currently adds stereo automatically

base/test-standard/src/test/java/org/openscience/cdk/tools/HOSECodeGeneratorTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ public class HOSECodeGeneratorTest extends CDKTestCase {
5858
*/
5959
@Test
6060
public void test968852() throws Exception {
61-
String filename = "data/mdl/2,5-dimethyl-furan.mol";
62-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
61+
String filename = "2,5-dimethyl-furan.mol";
62+
InputStream ins = this.getClass().getResourceAsStream(filename);
6363
MDLV2000Reader reader = new MDLV2000Reader(ins, Mode.STRICT);
6464
IAtomContainer mol1 = reader.read(DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class));
6565
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol1);
@@ -75,13 +75,13 @@ public void test968852() throws Exception {
7575
*/
7676
@Test
7777
public void testSecondSphere() throws Exception {
78-
String filename = "data/mdl/isopropylacetate.mol";
79-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
78+
String filename = "isopropylacetate.mol";
79+
InputStream ins = this.getClass().getResourceAsStream(filename);
8080
MDLV2000Reader reader = new MDLV2000Reader(ins, Mode.STRICT);
8181
IAtomContainer mol1 = reader.read(DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class));
8282
String code1 = new HOSECodeGenerator().getHOSECode(mol1, mol1.getAtom(0), 6);
83-
filename = "data/mdl/testisopropylacetate.mol";
84-
InputStream ins2 = this.getClass().getClassLoader().getResourceAsStream(filename);
83+
filename = "testisopropylacetate.mol";
84+
InputStream ins2 = this.getClass().getResourceAsStream(filename);
8585
MDLV2000Reader reader2 = new MDLV2000Reader(ins2, Mode.STRICT);
8686
IAtomContainer mol2 = reader2.read(DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class));
8787
String code2 = new HOSECodeGenerator().getHOSECode(mol2, mol2.getAtom(2), 6);

base/test-standard/src/test/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulatorTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,8 +1088,8 @@ public void skeleton() throws Exception {
10881088
*/
10891089
@Test
10901090
public void testOverWriteConfig() throws Exception {
1091-
String filename = "data/mdl/lobtest2.sdf";
1092-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
1091+
String filename = "lobtest2.sdf";
1092+
InputStream ins = this.getClass().getResourceAsStream(filename);
10931093
ISimpleChemObjectReader reader = new MDLV2000Reader(ins);
10941094
ChemFile content = (ChemFile) reader.read(new ChemFile());
10951095
List<IAtomContainer> cList = ChemFileManipulator.getAllAtomContainers(content);

0 commit comments

Comments
 (0)