|
16 | 16 | */ |
17 | 17 | package org.apache.nutch.parse.js; |
18 | 18 |
|
19 | | -import static org.junit.Assert.assertEquals; |
20 | | -import static org.junit.Assert.assertTrue; |
| 19 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
| 20 | +import static org.junit.jupiter.api.Assertions.assertTrue; |
21 | 21 |
|
22 | 22 | import java.io.File; |
23 | 23 | import java.io.IOException; |
@@ -95,20 +95,23 @@ public void testJavaScriptOutlinkExtraction() |
95 | 95 | for (int i = 0; i < filenames.length; i++) { |
96 | 96 | Outlink[] outlinks = getOutlinks(filenames[i]); |
97 | 97 | if (filenames[i].endsWith("parse_pure_js_test.js")) { |
98 | | - assertEquals("number of outlinks in .js test file should be X", 2, |
99 | | - outlinks.length); |
100 | | - assertEquals("http://search.lucidimagination.com/p:nutch", outlinks[0].getToUrl()); |
| 98 | + assertEquals(2, outlinks.length, |
| 99 | + "number of outlinks in .js test file should be X"); |
| 100 | + assertEquals("http://search.lucidimagination.com/p:nutch", |
| 101 | + outlinks[0].getToUrl()); |
101 | 102 | assertEquals("http://search-lucene.com/nutch", outlinks[1].getToUrl()); |
102 | 103 | } else { |
103 | | - assertTrue("number of outlinks in .html file should be at least 2", outlinks.length >= 2); |
| 104 | + assertTrue(outlinks.length >= 2, |
| 105 | + "number of outlinks in .html file should be at least 2"); |
104 | 106 | Set<String> outlinkSet = new TreeSet<>(); |
105 | 107 | for (Outlink o : outlinks) { |
106 | 108 | outlinkSet.add(o.getToUrl()); |
107 | 109 | } |
108 | | - assertTrue("http://search.lucidimagination.com/p:nutch not in outlinks", |
109 | | - outlinkSet.contains("http://search.lucidimagination.com/p:nutch")); |
110 | | - assertTrue("http://search-lucene.com/nutch not in outlinks", |
111 | | - outlinkSet.contains("http://search-lucene.com/nutch")); |
| 110 | + assertTrue( |
| 111 | + outlinkSet.contains("http://search.lucidimagination.com/p:nutch"), |
| 112 | + "http://search.lucidimagination.com/p:nutch not in outlinks"); |
| 113 | + assertTrue(outlinkSet.contains("http://search-lucene.com/nutch"), |
| 114 | + "http://search-lucene.com/nutch not in outlinks"); |
112 | 115 | } |
113 | 116 | } |
114 | 117 | } |
|
0 commit comments