Skip to content

Commit 7d49d52

Browse files
committed
work around if ReducedChemCompProvider is getting used
1 parent 589e3cb commit 7d49d52

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

biojava-structure/src/test/java/org/biojava/nbio/structure/redmine/test1DARSeqAlign.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
import org.biojava.nbio.structure.*;
2626
import org.biojava.nbio.structure.align.util.AtomCache;
2727
import org.biojava.nbio.structure.io.FileParsingParameters;
28+
import org.biojava.nbio.structure.io.mmcif.ChemCompGroupFactory;
29+
import org.biojava.nbio.structure.io.mmcif.ChemCompProvider;
30+
import org.biojava.nbio.structure.io.mmcif.DownloadChemCompProvider;
31+
import org.biojava.nbio.structure.io.mmcif.ReducedChemCompProvider;
2832

2933
/** test for https://redmine.open-bio.org/issues/3282
3034
*
@@ -41,7 +45,16 @@ public void test1DAR(){
4145
params.setLoadChemCompInfo(true);
4246

4347
cache.setFileParsingParams(params);
44-
48+
49+
boolean usingReducedChemCompProvider = false;
50+
51+
ChemCompProvider ccp =ChemCompGroupFactory.getChemCompProvider();
52+
if (ccp.getClass().getName().contains("ReducedChemCompProvider") ) {
53+
usingReducedChemCompProvider = true;
54+
55+
ChemCompGroupFactory.setChemCompProvider(new DownloadChemCompProvider());
56+
}
57+
4558

4659
try {
4760
Structure struc = cache.getStructure("1DAR");
@@ -75,7 +88,8 @@ public void test1DAR(){
7588
}
7689

7790

78-
91+
if (usingReducedChemCompProvider)
92+
ChemCompGroupFactory.setChemCompProvider(ccp);
7993

8094
cache.setFileParsingParams(orig);
8195
}

0 commit comments

Comments
 (0)