Skip to content

Commit 012397e

Browse files
committed
Fix test10ModelFromURL().
1 parent 43ad704 commit 012397e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/test/java/com/github/jfasttext/JFastTextTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.junit.Test;
55
import org.junit.runners.MethodSorters;
66

7+
import java.io.File;
78
import java.io.FileInputStream;
89
import java.io.InputStream;
910
import java.net.URL;
@@ -155,8 +156,8 @@ public void test10ModelUnloading() throws Exception {
155156
*/
156157
@Test
157158
public void test10ModelFromURL() throws Exception {
158-
String modelFile = "models/supervised.model.bin";
159-
URL modelUrl = this.getClass().getClassLoader().getResource(modelFile);
159+
String modelFile = "src/test/resources/models/supervised.model.bin";
160+
URL modelUrl = new File(modelFile).toURI().toURL();
160161
assertNotNull(String.format("Failed to locate model '%s'", modelFile), modelUrl);
161162
JFastText jft = new JFastText(modelUrl);
162163
System.out.printf("\tnumber of words = %d\n", jft.getNWords());
-59.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)