Skip to content

Commit cd01134

Browse files
johnmayegonw
authored andcommitted
Eliminate the testdata dependency from PDB
1 parent 0e863ac commit cd01134

File tree

20 files changed

+31505
-30
lines changed

20 files changed

+31505
-30
lines changed

storage/io/src/test/java/org/openscience/cdk/io/ReaderFactoryTest.java

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

128128
@Ignore("test moved to cdk-test-pdb/PDBReaderFactoryTest")
129129
public void testPDB() throws Exception {
130-
expectReader("data/pdb/coffeine.pdb", PDBFormat.getInstance(), -1, -1);
130+
expectReader("org/openscience/cdk/io/coffeine.pdb", PDBFormat.getInstance(), -1, -1);
131131
}
132132

133133
@Test

storage/ioformats/src/test/java/org/openscience/cdk/io/FormatFactoryTest.java

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

178178
@Test
179179
public void testPDB() throws Exception {
180-
expectFormat("data/pdb/coffeine.pdb", PDBFormat.getInstance());
180+
expectFormat("org/openscience/cdk/io/coffeine.pdb", PDBFormat.getInstance());
181181
}
182182

183183
@Test

storage/pdb/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,6 @@
8282
<type>test-jar</type>
8383
<scope>test</scope>
8484
</dependency>
85-
<dependency>
86-
<groupId>${project.groupId}</groupId>
87-
<artifactId>cdk-testdata</artifactId>
88-
<version>${project.parent.version}</version>
89-
<type>test-jar</type>
90-
<scope>test</scope>
91-
</dependency>
9285
</dependencies>
9386

9487
</project>

storage/pdb/src/test/java/org/openscience/cdk/io/PDBReaderFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ void expectReader(String filename,
7272

7373
@Test
7474
public void testPDB() throws Exception {
75-
expectReader("data/pdb/coffeine.pdb", PDBFormat.getInstance());
75+
expectReader("org/openscience/cdk/io/coffeine.pdb", PDBFormat.getInstance());
7676
}
7777
}

storage/pdb/src/test/java/org/openscience/cdk/io/PDBReaderTest.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class PDBReaderTest extends SimpleChemObjectReaderTest {
6161

6262
@BeforeClass
6363
public static void setup() throws Exception {
64-
setSimpleChemObjectReader(new PDBReader(), "data/pdb/coffeine.pdb");
64+
setSimpleChemObjectReader(new PDBReader(), "org/openscience/cdk/io/coffeine.pdb");
6565
}
6666

6767
/**
@@ -129,8 +129,8 @@ public void testAccepts() {
129129

130130
@Test
131131
public void testPDBFileCoffein() throws Exception {
132-
String filename = "data/pdb/coffeine.pdb";
133-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
132+
String filename = "coffeine.pdb";
133+
InputStream ins = this.getClass().getResourceAsStream(filename);
134134

135135
ISimpleChemObjectReader oReader = new PDBReader(ins);
136136
Assert.assertNotNull(oReader);
@@ -196,8 +196,8 @@ public void testPDBFileCoffein() throws Exception {
196196
*/
197197
@Test
198198
public void testProtein() throws Exception {
199-
String filename = "data/pdb/Test-1crn.pdb";
200-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
199+
String filename = "Test-1crn.pdb";
200+
InputStream ins = this.getClass().getResourceAsStream(filename);
201201

202202
ISimpleChemObjectReader reader = new PDBReader(ins);
203203
Assert.assertNotNull(reader);
@@ -255,7 +255,7 @@ public IChemFile getChemFile(ISimpleChemObjectReader reader) throws Exception {
255255
}
256256

257257
public IChemFile getChemFile(String filename, boolean useRebond) throws Exception {
258-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
258+
InputStream ins = this.getClass().getResourceAsStream(filename);
259259
return getChemFile(new PDBReader(ins), useRebond);
260260
}
261261

@@ -304,8 +304,8 @@ public void testObjectCountsChemFile(IChemFile chemFile, int chemSequenceCount,
304304

305305
@Test
306306
public void test114D() throws Exception {
307-
String filename = "data/pdb/114D.pdb";
308-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
307+
String filename = "114D.pdb";
308+
InputStream ins = this.getClass().getResourceAsStream(filename);
309309

310310
ISimpleChemObjectReader reader = new PDBReader(ins);
311311
Assert.assertNotNull(reader);
@@ -363,7 +363,7 @@ public void test114D() throws Exception {
363363

364364
@Test
365365
public void testUnk() throws Exception {
366-
String filename = "data/pdb/unk.pdb";
366+
String filename = "unk.pdb";
367367
IChemFile chemFile = getChemFile(filename);
368368
IAtomContainer atomContainer = getFirstAtomContainer(chemFile, 1, 1, 1);
369369
Assert.assertEquals(5, atomContainer.getAtomCount());
@@ -374,7 +374,7 @@ public void testUnk() throws Exception {
374374

375375
@Test
376376
public void testHetatmOnly() throws Exception {
377-
String filename = "data/pdb/hetatm_only.pdb";
377+
String filename = "hetatm_only.pdb";
378378
IChemFile chemFile = getChemFile(filename, true);
379379
IAtomContainer atomContainer = getFirstAtomContainer(chemFile, 1, 1, 1);
380380
Assert.assertTrue(atomContainer instanceof IAtomContainer);
@@ -384,51 +384,51 @@ public void testHetatmOnly() throws Exception {
384384

385385
@Test
386386
public void test1SPX() throws Exception {
387-
String filename = "data/pdb/1SPX.pdb";
387+
String filename = "1SPX.pdb";
388388
IChemFile chemFile = getChemFile(filename);
389389
testObjectCountsChemFile(chemFile, 1, 1, 1, 1904, 1, 237, 19);
390390
}
391391

392392
@Test
393393
public void test1XKQ() throws Exception {
394-
String filename = "data/pdb/1XKQ.pdb";
394+
String filename = "1XKQ.pdb";
395395
IChemFile chemFile = getChemFile(filename);
396396
testObjectCountsChemFile(chemFile, 1, 1, 1, 8955, 4, 1085, 90);
397397
}
398398

399399
@Test
400400
public void test1A00() throws Exception {
401-
String filename = "data/pdb/1A00.pdb";
401+
String filename = "1A00.pdb";
402402
IChemFile chemFile = getChemFile(filename);
403403
testObjectCountsChemFile(chemFile, 1, 1, 1, 4770, 4, 574, 35);
404404
}
405405

406406
@Test
407407
public void test1BOQ() throws Exception {
408-
String filename = "data/pdb/1BOQ.pdb";
408+
String filename = "1BOQ.pdb";
409409
IChemFile chemFile = getChemFile(filename);
410410
testObjectCountsChemFile(chemFile, 1, 1, 1, 1538, 1, 198, 21);
411411
}
412412

413413
@Test
414414
public void test1TOH() throws Exception {
415-
String filename = "data/pdb/1TOH.pdb";
415+
String filename = "1TOH.pdb";
416416
IChemFile chemFile = getChemFile(filename);
417417
testObjectCountsChemFile(chemFile, 1, 1, 1, 2804, 1, 325, 23);
418418
}
419419

420420
@Category(SlowTest.class)
421421
@Test
422422
public void test1CKV() throws Exception {
423-
String filename = "data/pdb/1CKV.pdb";
423+
String filename = "1CKV.pdb";
424424
IChemFile chemFile = getChemFile(filename);
425425
testObjectCountsChemFile(chemFile, 1, 14, 1, 31066, 1, 141, 9);
426426
}
427427

428428
@Test
429429
public void test1D66() throws Exception {
430-
String filename = "data/pdb/1D66.pdb";
431-
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
430+
String filename = "1D66.pdb";
431+
InputStream ins = this.getClass().getResourceAsStream(filename);
432432

433433
ISimpleChemObjectReader reader = new PDBReader(ins);
434434
Assert.assertNotNull(reader);

0 commit comments

Comments
 (0)