|
35 | 35 | import java.util.concurrent.Future; |
36 | 36 | import java.util.concurrent.TimeUnit; |
37 | 37 | import java.util.concurrent.TimeoutException; |
| 38 | +import java.util.regex.Matcher; |
| 39 | +import java.util.regex.Pattern; |
38 | 40 |
|
39 | 41 | import org.biojava.nbio.core.util.ConcurrencyTools; |
40 | 42 | import org.biojava.nbio.structure.ecod.EcodDatabase; |
41 | 43 | import org.biojava.nbio.structure.ecod.EcodDomain; |
42 | 44 | import org.biojava.nbio.structure.ecod.EcodFactory; |
43 | 45 | import org.biojava.nbio.structure.ecod.EcodInstallation; |
| 46 | +import org.junit.Ignore; |
44 | 47 | import org.junit.Rule; |
45 | 48 | import org.junit.Test; |
46 | 49 | import org.junit.rules.TemporaryFolder; |
@@ -123,7 +126,7 @@ public void testParsing() throws IOException { |
123 | 126 | domain = ecod.getDomainsById(ecodId); |
124 | 127 | expected = new EcodDomain( |
125 | 128 | // Long uid, String domainId, Boolean manual, |
126 | | - 20669l, "e1lyw.1", null, |
| 129 | + 20669l, "e1lyw.1", false, |
127 | 130 | // Integer xGroup, Integer hGroup, Integer tGroup, Integer fGroup, String pdbId, |
128 | 131 | 1,1,1,2,"1lyw", |
129 | 132 | // String chainId, String range, String architectureName, |
@@ -224,17 +227,33 @@ public void testVersion() throws IOException { |
224 | 227 | assertNotNull(version); |
225 | 228 | assertNotEquals("latest", version); |
226 | 229 | } |
227 | | - |
| 230 | + |
| 231 | + /** |
| 232 | + * Parses all known versions. Only fails due to exceptions, so manually check for warnings. |
| 233 | + * Hierarchical field warnings are expected for versions prior to develop68. |
| 234 | + * @throws IOException |
| 235 | + */ |
| 236 | + //@Ignore |
228 | 237 | @Test |
229 | 238 | public void testAllVersions() throws IOException { |
| 239 | + // Fetch latest version |
| 240 | + EcodDatabase latest = EcodFactory.getEcodDatabase("latest"); |
| 241 | + String latestVersionStr = latest.getVersion(); |
| 242 | + int latestVersion = 0; |
| 243 | + Matcher match = Pattern.compile("develop([0-9]+)",Pattern.CASE_INSENSITIVE).matcher(latestVersionStr); |
| 244 | + if(match.matches()) |
| 245 | + latestVersion = Integer.parseInt(match.group(1)); |
| 246 | + |
| 247 | + // List all versions |
230 | 248 | int firstVersion = 45; |
231 | | - int lastVersion = 78; |
| 249 | + int lastVersion = Math.max(78,latestVersion); |
232 | 250 | List<String> versions = new ArrayList<String>(); |
233 | | - |
| 251 | + versions.add("latest"); |
234 | 252 | for(int version = firstVersion; version<= lastVersion;version++) { |
235 | 253 | versions.add("develop"+version); |
236 | 254 | } |
237 | | - versions.add("latest"); |
| 255 | + |
| 256 | + // Parse all versions |
238 | 257 | for(String version : versions) { |
239 | 258 | EcodInstallation ecod = (EcodInstallation)EcodFactory.getEcodDatabase(version); |
240 | 259 | ecod.getAllDomains(); |
|
0 commit comments