Skip to content

Commit 28261de

Browse files
johnmayegonw
authored andcommitted
Eliminate testdata from cdk-pcore moving all resources to the module (and package) where they are used.
1 parent 6a4ee0f commit 28261de

File tree

9 files changed

+22
-29
lines changed

9 files changed

+22
-29
lines changed

tool/pcore/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,6 @@
7878
<version>${project.parent.version}</version>
7979
<scope>test</scope>
8080
</dependency>
81-
<dependency>
82-
<groupId>${project.groupId}</groupId>
83-
<artifactId>cdk-testdata</artifactId>
84-
<version>${project.parent.version}</version>
85-
<type>test-jar</type>
86-
<scope>test</scope>
87-
</dependency>
8881
</dependencies>
8982

9083
</project>

tool/pcore/src/test/java/org/openscience/cdk/pharmacophore/PharmacophoreMatcherTest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public void tearDown() {}
5353

5454
@BeforeClass
5555
public static void loadConformerData() {
56-
String filename = "data/mdl/pcoretest1.sdf";
57-
InputStream ins = PharmacophoreMatcherTest.class.getClassLoader().getResourceAsStream(filename);
56+
String filename = "pcoretest1.sdf";
57+
InputStream ins = PharmacophoreMatcherTest.class.getResourceAsStream(filename);
5858
IteratingMDLConformerReader reader = new IteratingMDLConformerReader(ins,
5959
SilentChemObjectBuilder.getInstance());
6060
if (reader.hasNext()) conformers = (ConformerContainer) reader.next();
@@ -216,8 +216,8 @@ public void testInvalidQuery() throws CDKException {
216216

217217
@Test
218218
public void testCNSPcore() throws CDKException, IOException {
219-
String filename = "data/mdl/cnssmarts.sdf";
220-
InputStream ins = PharmacophoreMatcherTest.class.getClassLoader().getResourceAsStream(filename);
219+
String filename = "cnssmarts.sdf";
220+
InputStream ins = PharmacophoreMatcherTest.class.getResourceAsStream(filename);
221221
IteratingSDFReader reader = new IteratingSDFReader(ins, SilentChemObjectBuilder.getInstance());
222222

223223
PharmacophoreQuery query = new PharmacophoreQuery();
@@ -245,8 +245,8 @@ public void testCNSPcore() throws CDKException, IOException {
245245

246246
@Test
247247
public void testMatchingBonds() throws CDKException, IOException {
248-
String filename = "data/mdl/cnssmarts.sdf";
249-
InputStream ins = PharmacophoreMatcherTest.class.getClassLoader().getResourceAsStream(filename);
248+
String filename = "cnssmarts.sdf";
249+
InputStream ins = PharmacophoreMatcherTest.class.getResourceAsStream(filename);
250250
IteratingSDFReader reader = new IteratingSDFReader(ins, SilentChemObjectBuilder.getInstance());
251251

252252
PharmacophoreQuery query = new PharmacophoreQuery();
@@ -281,8 +281,8 @@ public void testMatchingBonds() throws CDKException, IOException {
281281

282282
@Test
283283
public void testAngleMatch1() throws Exception {
284-
String filename = "data/mdl/cnssmarts.sdf";
285-
InputStream ins = PharmacophoreMatcherTest.class.getClassLoader().getResourceAsStream(filename);
284+
String filename = "cnssmarts.sdf";
285+
InputStream ins = PharmacophoreMatcherTest.class.getResourceAsStream(filename);
286286
IteratingSDFReader reader = new IteratingSDFReader(ins, SilentChemObjectBuilder.getInstance());
287287

288288
PharmacophoreQuery query = new PharmacophoreQuery();
@@ -306,8 +306,8 @@ public void testAngleMatch1() throws Exception {
306306

307307
@Test
308308
public void testAngleMatch2() throws Exception {
309-
String filename = "data/mdl/cnssmarts.sdf";
310-
InputStream ins = PharmacophoreMatcherTest.class.getClassLoader().getResourceAsStream(filename);
309+
String filename = "cnssmarts.sdf";
310+
InputStream ins = PharmacophoreMatcherTest.class.getResourceAsStream(filename);
311311
IteratingSDFReader reader = new IteratingSDFReader(ins, SilentChemObjectBuilder.getInstance());
312312

313313
PharmacophoreQuery query = new PharmacophoreQuery();
@@ -404,8 +404,8 @@ public void multiSmartsQuery() throws IOException, CDKException {
404404
PharmacophoreMatcher matcher = new PharmacophoreMatcher();
405405
matcher.setPharmacophoreQuery(query);
406406

407-
String filename = "data/pcore/multismartpcore.sdf";
408-
InputStream ins = PharmacophoreMatcherTest.class.getClassLoader().getResourceAsStream(filename);
407+
String filename = "multismartpcore.sdf";
408+
InputStream ins = PharmacophoreMatcherTest.class.getResourceAsStream(filename);
409409
IteratingSDFReader reader = new IteratingSDFReader(ins, SilentChemObjectBuilder.getInstance());
410410

411411
IAtomContainer mol = (IAtomContainer) reader.next();

tool/pcore/src/test/java/org/openscience/cdk/pharmacophore/PharmacophoreUtilityTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ public class PharmacophoreUtilityTest {
4545

4646
@BeforeClass
4747
public static void loadConformerData() {
48-
String filename = "data/mdl/pcoretest1.sdf";
49-
InputStream ins = PharmacophoreUtilityTest.class.getClassLoader().getResourceAsStream(filename);
48+
String filename = "pcoretest1.sdf";
49+
InputStream ins = PharmacophoreUtilityTest.class.getResourceAsStream(filename);
5050
IteratingMDLConformerReader reader = new IteratingMDLConformerReader(ins,
5151
DefaultChemObjectBuilder.getInstance());
5252
if (reader.hasNext()) PharmacophoreUtilityTest.conformers = (ConformerContainer) reader.next();
5353
}
5454

5555
@Test
5656
public void testReadPcoreDef() throws Exception {
57-
String filename = "data/pcore/pcore.xml";
58-
InputStream ins = PharmacophoreUtilityTest.class.getClassLoader().getResourceAsStream(filename);
57+
String filename = "pcore.xml";
58+
InputStream ins = PharmacophoreUtilityTest.class.getResourceAsStream(filename);
5959
List<PharmacophoreQuery> defs = PharmacophoreUtils.readPharmacophoreDefinitions(ins);
6060

6161
Assert.assertEquals(2, defs.size());
@@ -87,8 +87,8 @@ public void testReadPcoreDef() throws Exception {
8787

8888
@Test
8989
public void testReadPcoreAngleDef() throws Exception {
90-
String filename = "data/pcore/pcoreangle.xml";
91-
InputStream ins = PharmacophoreUtilityTest.class.getClassLoader().getResourceAsStream(filename);
90+
String filename = "pcoreangle.xml";
91+
InputStream ins = PharmacophoreUtilityTest.class.getResourceAsStream(filename);
9292
List<PharmacophoreQuery> defs = PharmacophoreUtils.readPharmacophoreDefinitions(ins);
9393

9494
Assert.assertEquals(1, defs.size());
@@ -126,15 +126,15 @@ public void testReadPcoreAngleDef() throws Exception {
126126

127127
@Test(expected = CDKException.class)
128128
public void testInvalidPcoreXML() throws IOException, CDKException {
129-
String filename = "data/pcore/invalid1.xml";
130-
InputStream ins = PharmacophoreUtilityTest.class.getClassLoader().getResourceAsStream(filename);
129+
String filename = "invalid1.xml";
130+
InputStream ins = PharmacophoreUtilityTest.class.getResourceAsStream(filename);
131131
PharmacophoreUtils.readPharmacophoreDefinitions(ins);
132132
}
133133

134134
@Test
135135
public void testPCoreWrite() throws Exception {
136-
String filename = "data/pcore/pcore.xml";
137-
InputStream ins = PharmacophoreUtilityTest.class.getClassLoader().getResourceAsStream(filename);
136+
String filename = "pcore.xml";
137+
InputStream ins = PharmacophoreUtilityTest.class.getResourceAsStream(filename);
138138
List<PharmacophoreQuery> defs = PharmacophoreUtils.readPharmacophoreDefinitions(ins);
139139

140140
PharmacophoreQuery[] defarray = defs.toArray(new PharmacophoreQuery[]{});

0 commit comments

Comments
 (0)