Skip to content

Commit

Permalink
Eliminate testdata from cdk-builder3d moving all resources to the mod…
Browse files Browse the repository at this point in the history
…ule (and package) where they are used. We need to duplicate one resource also used in cdk-io test.
  • Loading branch information
johnmay authored and egonw committed Dec 29, 2021
1 parent 96566b9 commit c2066cc
Show file tree
Hide file tree
Showing 11 changed files with 114 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@ public void testPolycarpol() throws Exception {

@Test
public void testReserpine() throws Exception {
String filename = "data/mdl/reserpine.mol";
String filename = "reserpine.mol";
logger.info("Testing: " + filename);
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
InputStream ins = this.getClass().getResourceAsStream(filename);
MDLV2000Reader reader = new MDLV2000Reader(ins);
ChemFile chemFile = reader.read(new ChemFile());
reader.close();
Expand Down
7 changes: 0 additions & 7 deletions tool/builder3d/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,6 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cdk-testdata</artifactId>
<version>${project.parent.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cdk-builder3dtools</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ public void testAllHeavyAtomsPlaced_IAtomContainer() {

@Test
public void testFindHeavyAtomsInChain_IAtomContainer_IAtomContainer() throws Exception {
String filename = "data/mdl/allmol232.mol";
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
String filename = "allmol232.mol";
InputStream ins = this.getClass().getResourceAsStream(filename);
// TODO: shk3-cleanuptests: best to use the STRICT IO mode here
MDLV2000Reader reader = new MDLV2000Reader(ins);
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ public void testModelBuilder3D_232() throws Exception {
Assume.assumeTrue(runSlowTests());

ModelBuilder3D mb3d = ModelBuilder3D.getInstance(DefaultChemObjectBuilder.getInstance());
String filename = "data/mdl/allmol232.mol";
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
String filename = "allmol232.mol";
InputStream ins = this.getClass().getResourceAsStream(filename);
MDLV2000Reader reader = new MDLV2000Reader(ins);
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
reader.close();
Expand All @@ -239,8 +239,8 @@ public void testModelBuilder3D_231() throws Exception {
Assume.assumeTrue(runSlowTests());

ModelBuilder3D mb3d = ModelBuilder3D.getInstance(DefaultChemObjectBuilder.getInstance());
String filename = "data/mdl/allmol231.mol";
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
String filename = "allmol231.mol";
InputStream ins = this.getClass().getResourceAsStream(filename);
MDLV2000Reader reader = new MDLV2000Reader(ins);
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
reader.close();
Expand Down Expand Up @@ -367,8 +367,8 @@ public void testModel3D_bug_1610997() throws Exception {
@Category(SlowTest.class)
public void testModelBuilder3D_bug_1241421() throws Exception {
ModelBuilder3D mb3d = ModelBuilder3D.getInstance(DefaultChemObjectBuilder.getInstance());
String filename = "data/mdl/bug1241421.mol";
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
String filename = "bug1241421.mol";
InputStream ins = this.getClass().getResourceAsStream(filename);
MDLV2000Reader reader = new MDLV2000Reader(ins);
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
reader.close();
Expand All @@ -382,8 +382,8 @@ public void testModelBuilder3D_bug_1241421() throws Exception {
@Category(SlowTest.class)
public void testModelBuilder3D_reserpine() throws Exception {
ModelBuilder3D mb3d = ModelBuilder3D.getInstance(DefaultChemObjectBuilder.getInstance());
String filename = "data/mdl/reserpine.mol";
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
String filename = "reserpine.mol";
InputStream ins = this.getClass().getResourceAsStream(filename);
MDLV2000Reader reader = new MDLV2000Reader(ins);
ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
reader.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public void testFingerprints() throws Exception {
parseBitSet("{3, 18, 26, 32, 33, 43, 140, 155, 188, 189, 226, 238, 262, 267, 287, 315, 319, 326, 375, 450, 577, 629, 644, 690, 719, 732, 745, 746, 751, 775, 847, 850, 881, 959, 971, 995, 1015, 1019}"),
parseBitSet("{3, 18, 29, 33, 90, 105, 125, 272, 280, 301, 433, 521, 590, 618, 651, 672, 696, 698, 745, 760, 829, 844, 876, 890, 899, 924, 1013}")};

String filename = "data/mdl/fingerprints_from_modelbuilder3d.sdf";
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
String filename = "fingerprints_from_modelbuilder3d.sdf";
InputStream ins = this.getClass().getResourceAsStream(filename);
List<IBitFingerprint> data = new TemplateExtractor().makeFingerprintsFromSdf(true, false,
new HashMap<String, Integer>(), new BufferedReader(new InputStreamReader(ins)), 10);
QueryChemObject obj = new QueryChemObject(DefaultChemObjectBuilder.getInstance());
Expand All @@ -101,8 +101,8 @@ public void testAnonFingerprints() throws Exception {
parseBitSet("{148, 206, 392, 542, 637, 742, 752, 830}"),
parseBitSet("{148, 206, 392, 542, 637, 742, 752, 830}")};

String filename = "data/mdl/fingerprints_from_modelbuilder3d.sdf";
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
String filename = "fingerprints_from_modelbuilder3d.sdf";
InputStream ins = this.getClass().getResourceAsStream(filename);
List<IBitFingerprint> data = new TemplateExtractor().makeFingerprintsFromSdf(true, true,
new HashMap<String, Integer>(), new BufferedReader(new InputStreamReader(ins)), 10);
QueryChemObject obj = new QueryChemObject(DefaultChemObjectBuilder.getInstance());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
0-reserpin.mol
ChemDraw09189816272D

44 49 0 0 0 0 0 0 0 0 1 V2000
-9.9600 2.3925 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-9.9600 0.8900 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-8.6600 0.1400 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-7.3650 0.8900 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-7.3650 2.3925 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-8.6600 3.1400 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-5.9400 0.4275 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
-5.0625 1.6400 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-5.9400 2.8500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-3.5775 1.7950 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.9725 3.1575 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
-3.8500 4.3600 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-5.3350 4.2025 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.7025 0.5900 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.2200 0.7450 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.6150 2.1050 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.4900 3.3075 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.3475 -0.4575 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.1275 -0.3025 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.7325 1.0500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.8575 2.2500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
3.2250 1.2075 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
4.5250 1.9600 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
5.8275 1.2075 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
5.8275 -0.2925 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
7.1250 -1.0425 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
8.4200 -0.2925 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
8.4200 1.2075 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
7.1250 1.9575 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-11.0200 -0.1700 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
1.8800 -1.6025 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
-1.0975 -1.7600 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.3475 -3.0600 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
-1.0975 -4.3600 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-11.0200 -1.6700 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
4.5250 3.4600 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
9.7225 1.9600 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
11.0225 1.2075 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
9.7225 -1.0425 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
11.0225 -0.2925 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
7.1250 -2.5450 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
5.8250 -3.2950 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.1275 -2.9050 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.6000 -1.7600 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
1 2 2 0 0 0 0
2 3 1 0 0 0 0
3 4 2 0 0 0 0
4 5 1 0 0 0 0
5 6 2 0 0 0 0
1 6 1 0 0 0 0
4 7 1 0 0 0 0
7 8 1 0 0 0 0
8 9 2 0 0 0 0
5 9 1 0 0 0 0
8 10 1 0 0 0 0
10 11 1 0 0 0 0
11 12 1 0 0 0 0
12 13 1 0 0 0 0
9 13 1 0 0 0 0
10 14 1 0 0 0 0
14 15 1 0 0 0 0
15 16 1 0 0 0 0
16 17 1 0 0 0 0
11 17 1 0 0 0 0
15 18 1 0 0 0 0
18 19 1 0 0 0 0
19 20 1 0 0 0 0
20 21 1 0 0 0 0
16 21 1 0 0 0 0
20 22 1 0 0 0 0
22 23 1 0 0 0 0
23 24 1 0 0 0 0
24 25 2 0 0 0 0
25 26 1 0 0 0 0
26 27 2 0 0 0 0
27 28 1 0 0 0 0
28 29 2 0 0 0 0
24 29 1 0 0 0 0
2 30 1 0 0 0 0
19 31 1 0 0 0 0
18 32 1 0 0 0 0
32 33 1 0 0 0 0
33 34 1 0 0 0 0
30 35 1 0 0 0 0
23 36 2 0 0 0 0
28 37 1 0 0 0 0
37 38 1 0 0 0 0
27 39 1 0 0 0 0
39 40 1 0 0 0 0
26 41 1 0 0 0 0
41 42 1 0 0 0 0
31 43 1 0 0 0 0
32 44 2 0 0 0 0
M END

0 comments on commit c2066cc

Please sign in to comment.