Skip to content

Commit 0606795

Browse files
johnmayegonw
authored andcommitted
Seperate out cdk-fingerprint from testdata, 2 test files needed duplicating.
1 parent f0e982b commit 0606795

File tree

21 files changed

+555
-35
lines changed

21 files changed

+555
-35
lines changed

base/test-core/src/test/java/org/openscience/cdk/graph/CyclesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public void unchorded() throws Exception {
253253

254254
// load a boron fullerene
255255
private IAtomContainer fullerene() throws Exception {
256-
String path = "/data/mdl/boronBuckyBall.mol";
256+
String path = "boronBuckyBall.mol";
257257
MDLV2000Reader mdl = new MDLV2000Reader(getClass().getResourceAsStream(path));
258258
try {
259259
return mdl.read(new AtomContainer());

descriptor/fingerprint/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,6 @@
109109
<version>${project.parent.version}</version>
110110
<scope>test</scope>
111111
</dependency>
112-
<dependency>
113-
<groupId>${project.groupId}</groupId>
114-
<artifactId>cdk-testdata</artifactId>
115-
<version>${project.parent.version}</version>
116-
<type>test-jar</type>
117-
<scope>test</scope>
118-
</dependency>
119112
<dependency>
120113
<groupId>${project.groupId}</groupId>
121114
<artifactId>cdk-diff</artifactId>

descriptor/fingerprint/src/test/java/org/openscience/cdk/fingerprint/AbstractFixedLengthFingerprinterTest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ public void testBug706786() throws Exception {
8686
@Test
8787
public void testBug853254() throws Exception {
8888
IChemObjectBuilder builder = SilentChemObjectBuilder.getInstance();
89-
String filename = "data/mdl/bug853254-2.mol";
90-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
89+
String filename = "bug853254-2.mol";
90+
InputStream ins = this.getClass().getResourceAsStream(filename);
9191
MDLV2000Reader reader = new MDLV2000Reader(ins, Mode.STRICT);
9292
IAtomContainer superstructure = reader.read(builder.newAtomContainer());
9393

94-
filename = "data/mdl/bug853254-1.mol";
95-
ins = this.getClass().getClassLoader().getResourceAsStream(filename);
94+
filename = "bug853254-1.mol";
95+
ins = this.getClass().getResourceAsStream(filename);
9696
reader = new MDLV2000Reader(ins, Mode.STRICT);
9797
IAtomContainer substructure = reader.read(builder.newAtomContainer());
9898

@@ -143,13 +143,13 @@ public void testBug934819() throws Exception {
143143
@Test
144144
public void testBug771485() throws Exception {
145145
IChemObjectBuilder builder = SilentChemObjectBuilder.getInstance();
146-
String filename = "data/mdl/bug771485-1.mol";
147-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
146+
String filename = "bug771485-1.mol";
147+
InputStream ins = this.getClass().getResourceAsStream(filename);
148148
MDLV2000Reader reader = new MDLV2000Reader(ins, Mode.STRICT);
149149
IAtomContainer structure1 = (IAtomContainer) reader.read(builder.newAtomContainer());
150150

151-
filename = "data/mdl/bug771485-2.mol";
152-
ins = this.getClass().getClassLoader().getResourceAsStream(filename);
151+
filename = "bug771485-2.mol";
152+
ins = this.getClass().getResourceAsStream(filename);
153153
reader = new MDLV2000Reader(ins, Mode.STRICT);
154154
IAtomContainer structure2 = (IAtomContainer) reader.read(builder.newAtomContainer());
155155

@@ -188,13 +188,13 @@ public void testBug771485() throws Exception {
188188
@Test
189189
public void testBug931608() throws Exception {
190190
IChemObjectBuilder builder = SilentChemObjectBuilder.getInstance();
191-
String filename = "data/mdl/bug931608-1.mol";
192-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
191+
String filename = "bug931608-1.mol";
192+
InputStream ins = this.getClass().getResourceAsStream(filename);
193193
MDLV2000Reader reader = new MDLV2000Reader(ins, Mode.STRICT);
194194
IAtomContainer structure1 = reader.read(builder.newAtomContainer());
195195

196-
filename = "data/mdl/bug931608-2.mol";
197-
ins = this.getClass().getClassLoader().getResourceAsStream(filename);
196+
filename = "bug931608-2.mol";
197+
ins = this.getClass().getResourceAsStream(filename);
198198
reader = new MDLV2000Reader(ins, Mode.STRICT);
199199
IAtomContainer structure2 = reader.read(builder.newAtomContainer());
200200

descriptor/fingerprint/src/test/java/org/openscience/cdk/fingerprint/ExtendedFingerprinterTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,13 +392,13 @@ public void testCondensedSingle() throws Exception {
392392
public void testChebi() throws Exception {
393393
IAtomContainer searchmol = null;
394394
IAtomContainer findmol = null;
395-
String filename = "data/mdl/chebisearch.mol";
396-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
395+
String filename = "chebisearch.mol";
396+
InputStream ins = this.getClass().getResourceAsStream(filename);
397397
MDLV2000Reader reader = new MDLV2000Reader(ins);
398398
searchmol = reader.read(new AtomContainer());
399399
reader.close();
400-
filename = "data/mdl/chebifind.mol";
401-
ins = this.getClass().getClassLoader().getResourceAsStream(filename);
400+
filename = "chebifind.mol";
401+
ins = this.getClass().getResourceAsStream(filename);
402402
reader = new MDLV2000Reader(ins);
403403
findmol = reader.read(new AtomContainer());
404404
reader.close();

descriptor/fingerprint/src/test/java/org/openscience/cdk/fingerprint/FingerprinterTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ public void testFingerprinterBitSetSize() throws Exception {
160160
*/
161161
@Test
162162
public void testBug1851202() throws Exception {
163-
String filename1 = "data/mdl/0002.stg01.rxn";
163+
String filename1 = "0002.stg01.rxn";
164164
logger.info("Testing: " + filename1);
165-
InputStream ins1 = this.getClass().getClassLoader().getResourceAsStream(filename1);
165+
InputStream ins1 = this.getClass().getResourceAsStream(filename1);
166166
MDLRXNV2000Reader reader = new MDLRXNV2000Reader(ins1, Mode.STRICT);
167167
IReaction reaction = (IReaction) reader.read(new Reaction());
168168
Assert.assertNotNull(reaction);
@@ -178,9 +178,9 @@ public void testBug1851202() throws Exception {
178178
@Test(expected = CDKException.class)
179179
@Category(SlowTest.class)
180180
public void testbug2917084() throws Exception {
181-
String filename1 = "data/mdl/boronBuckyBall.mol";
181+
String filename1 = "boronBuckyBall.mol";
182182
logger.info("Testing: " + filename1);
183-
InputStream ins1 = this.getClass().getClassLoader().getResourceAsStream(filename1);
183+
InputStream ins1 = this.getClass().getResourceAsStream(filename1);
184184
MDLV2000Reader reader = new MDLV2000Reader(ins1, Mode.STRICT);
185185
IChemFile chemFile = reader.read(new ChemFile());
186186
Assert.assertNotNull(chemFile);

descriptor/fingerprint/src/test/java/org/openscience/cdk/similarity/DistanceMomentTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class DistanceMomentTest extends CDKTestCase {
2121
boolean standAlone = false;
2222

2323
private IAtomContainer loadMolecule(String path) throws Exception {
24-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(path);
24+
InputStream ins = this.getClass().getResourceAsStream(path);
2525
MDLV2000Reader reader = new MDLV2000Reader(ins, Mode.STRICT);
2626
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
2727
reader.close();
@@ -31,15 +31,15 @@ private IAtomContainer loadMolecule(String path) throws Exception {
3131

3232
@Test
3333
public void test3DSim1() throws Exception {
34-
String filename = "data/mdl/sim3d1.sdf";
34+
String filename = "sim3d1.sdf";
3535
IAtomContainer ac = loadMolecule(filename);
3636
float sim = DistanceMoment.calculate(ac, ac);
3737
Assert.assertEquals(1.0000, sim, 0.00001);
3838
}
3939

4040
@Test
4141
public void testGenerateMoments() throws Exception {
42-
String filename = "data/mdl/sim3d1.sdf";
42+
String filename = "sim3d1.sdf";
4343
IAtomContainer ac = loadMolecule(filename);
4444
float[] expected = new float[]{3.710034f, 1.780116f, 0.26535583f, 3.7945938f, 2.2801101f, 0.20164771f, 7.1209f,
4545
9.234152f, -0.49032924f, 6.6067924f, 8.89391f, -0.048539735f};
@@ -54,8 +54,8 @@ public void testGenerateMoments() throws Exception {
5454

5555
@Test
5656
public void test3DSim2() throws Exception {
57-
IAtomContainer ac1 = loadMolecule("data/mdl/sim3d1.sdf");
58-
IAtomContainer ac2 = loadMolecule("data/mdl/sim3d2.sdf");
57+
IAtomContainer ac1 = loadMolecule("sim3d1.sdf");
58+
IAtomContainer ac2 = loadMolecule("sim3d2.sdf");
5959
float sim = DistanceMoment.calculate(ac1, ac2);
6060
Assert.assertEquals(0.24962, sim, 0.00001);
6161
}

0 commit comments

Comments
 (0)