Skip to content

Commit

Permalink
Fixed where test file is found
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B authored and egonw committed Nov 4, 2013
1 parent f4f1a33 commit 0cf31de
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions org.bridgedb/test/org/bridgedb/IDMapperStackTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.bridgedb;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
Expand All @@ -18,7 +20,7 @@ public class IDMapperStackTest {
private static DataSource dsW, dsX, dsY, dsZ, dsA, dsE, dsB, dsC, dsD;

@Before
public void setUp() throws ClassNotFoundException, IDMapperException
public void setUp() throws ClassNotFoundException, IDMapperException, MalformedURLException
{
Class.forName("org.bridgedb.file.IDMapperText");

Expand All @@ -28,9 +30,8 @@ public void setUp() throws ClassNotFoundException, IDMapperException

for (String fileName : FILENAMES)
{ // Load all IDMappers for test data files
String fullName = "/org/bridgedb/" + fileName + ".csv";
URL url = IDMapperStackTest.class.getResource(fullName);
Assert.assertNotNull("Could not find resource in classpath: " + fullName, url);
File file = new File("test-data/" + fileName + ".csv");
URL url = file.toURI().toURL();
IDMapper m = BridgeDb.connect("idmapper-text:" + url);
mappers.put(fileName, m);
stack.addIDMapper(m);
Expand Down

0 comments on commit 0cf31de

Please sign in to comment.