Skip to content

Commit

Permalink
Tests now also work in Ant
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Nov 4, 2013
1 parent 0cf31de commit d68cfd8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions build-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
<pathelement location="resources"/>
<pathelement location="build"/>
<pathelement location="test"/>
<pathelement location="test-data"/>
</path>
<javac srcdir="test" debug="true"
includes="**"
Expand Down
1 change: 1 addition & 0 deletions org.bridgedb/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="src" path="test-data"/>
<classpathentry exported="true" kind="lib" path="build-lib/measure.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="bin"/>
Expand Down
7 changes: 4 additions & 3 deletions org.bridgedb/test/org/bridgedb/IDMapperStackTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.bridgedb;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
Expand Down Expand Up @@ -30,8 +29,10 @@ public void setUp() throws ClassNotFoundException, IDMapperException, MalformedU

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

0 comments on commit d68cfd8

Please sign in to comment.