Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
upd parser calls in test cases
reger71bf95af8a94
diff --git a/test/net/yacy/document/ParserTest.java b/test/net/yacy/document/ParserTest.javaindex 22004863c..9d00c9b07 100644--- a/test/net/yacy/document/ParserTest.java+++ b/test/net/yacy/document/ParserTest.java@@ -36,7 +36,7 @@ public class ParserTest {final AnchorURL url = new AnchorURL("http://localhost/"+filename);AbstractParser p = new ooxmlParser();- final Document[] docs = p.parse(url, mimetype, null, null, new FileInputStream(file));+ final Document[] docs = p.parse(url, mimetype, null, new VocabularyScraper(), 0, new FileInputStream(file));for (final Document doc: docs) {final Reader content = new InputStreamReader(doc.getTextStream(), doc.getCharset());final StringBuilder str = new StringBuilder();@@ -70,7 +70,7 @@ public class ParserTest {final AnchorURL url = new AnchorURL("http://localhost/"+filename);AbstractParser p = new odtParser();- final Document[] docs = p.parse(url, mimetype, null, null, new FileInputStream(file));+ final Document[] docs = p.parse(url, mimetype, null, new VocabularyScraper(), 0, new FileInputStream(file));for (final Document doc: docs) {final Reader content = new InputStreamReader(doc.getTextStream(), doc.getCharset());final StringBuilder str = new StringBuilder();@@ -102,7 +102,7 @@ public class ParserTest {final AnchorURL url = new AnchorURL("http://localhost/"+filename);AbstractParser p = new pdfParser();- final Document[] docs = p.parse(url, mimetype, null, null, new FileInputStream(file));+ final Document[] docs = p.parse(url, mimetype, null, new VocabularyScraper(), 0, new FileInputStream(file));for (final Document doc: docs) {final Reader content = new InputStreamReader(doc.getTextStream(), doc.getCharset());final StringBuilder str = new StringBuilder();@@ -134,7 +134,7 @@ public class ParserTest {final AnchorURL url = new AnchorURL("http://localhost/"+filename);AbstractParser p = new docParser();- final Document[] docs = p.parse(url, mimetype, null, null, new FileInputStream(file));+ final Document[] docs = p.parse(url, mimetype, null, new VocabularyScraper(), 0, new FileInputStream(file));for (final Document doc: docs) {final Reader content = new InputStreamReader(doc.getTextStream(), doc.getCharset());final StringBuilder str = new StringBuilder();@@ -172,7 +172,7 @@ public class ParserTest {final AnchorURL url = new AnchorURL("http://localhost/" + filename);AbstractParser p = new pptParser();- final Document[] docs = p.parse(url, mimetype, null, null, new FileInputStream(file));+ final Document[] docs = p.parse(url, mimetype, null, new VocabularyScraper(), 0, new FileInputStream(file));for (final Document doc : docs) {final Reader content = new InputStreamReader(doc.getTextStream(), doc.getCharset());final StringBuilder str = new StringBuilder();diff --git a/test/net/yacy/document/parser/htmlParserTest.java b/test/net/yacy/document/parser/htmlParserTest.javaindex 32626934a..1ab31f9bf 100644--- a/test/net/yacy/document/parser/htmlParserTest.java+++ b/test/net/yacy/document/parser/htmlParserTest.java@@ -75,7 +75,7 @@ public class htmlParserTest extends TestCase {System.out.println("parse file: " + filename);htmlParser p = new htmlParser();- final Document[] docs = p.parse(url, mimetype, null, null, new FileInputStream(file));+ final Document[] docs = p.parse(url, mimetype, null, new VocabularyScraper(), 0, new FileInputStream(file));Document doc = docs[0];String txt = doc.getCharset();@@ -101,7 +101,7 @@ public class htmlParserTest extends TestCase {+ "<figure><img width=\"550px\" title=\"image as exemple\" alt=\"image as exemple\" src=\"./img/my_image.png\"></figrue>" // + img width 550 (+html5 figure)+ "</body></html>";- ContentScraper scraper = parseToScraper(url, mimetype, new VocabularyScraper(), testhtml, 10);+ ContentScraper scraper = parseToScraper(url, mimetype, new VocabularyScraper(), 0, testhtml, 10);List<AnchorURL> anchorlist = scraper.getAnchors();String linktxt = anchorlist.get(0).getTextProperty();diff --git a/test/net/yacy/document/parser/images/genericImageParserTest.java b/test/net/yacy/document/parser/images/genericImageParserTest.javaindex d2b3c0fe0..f2da567be 100644--- a/test/net/yacy/document/parser/images/genericImageParserTest.java+++ b/test/net/yacy/document/parser/images/genericImageParserTest.java@@ -5,6 +5,7 @@ import java.io.File;import java.io.FileInputStream;import net.yacy.cora.document.id.AnchorURL;import net.yacy.document.Document;+import net.yacy.document.VocabularyScraper;import org.junit.Test;import static org.junit.Assert.*;@@ -28,7 +29,7 @@ public class genericImageParserTest {System.out.println("parse file: " + filename);genericImageParser p = new genericImageParser();- final Document[] docs = p.parse(url, mimetype, charset, null, new FileInputStream(file));+ final Document[] docs = p.parse(url, mimetype, charset, new VocabularyScraper(), 0, new FileInputStream(file));Document doc = docs[0];assertEquals("YaCy Logo",doc.dc_title());diff --git a/test/net/yacy/document/parser/images/metadataImageParserTest.java b/test/net/yacy/document/parser/images/metadataImageParserTest.javaindex 194900104..4c0939319 100644--- a/test/net/yacy/document/parser/images/metadataImageParserTest.java+++ b/test/net/yacy/document/parser/images/metadataImageParserTest.java@@ -5,6 +5,7 @@ import java.io.File;import java.io.FileInputStream;import net.yacy.cora.document.id.AnchorURL;import net.yacy.document.Document;+import net.yacy.document.VocabularyScraper;import org.junit.Test;import static org.junit.Assert.*;@@ -29,7 +30,7 @@ public class metadataImageParserTest {System.out.println("parse file: " + filename);metadataImageParser p = new metadataImageParser();- final Document[] docs = p.parse(url, mimetype, charset, null, new FileInputStream(file));+ final Document[] docs = p.parse(url, mimetype, charset, new VocabularyScraper(), 0, new FileInputStream(file));Document doc = docs[0];assertEquals("YaCy Logo",doc.dc_title());diff --git a/test/net/yacy/document/parser/pdfParserTest.java b/test/net/yacy/document/parser/pdfParserTest.javaindex d7934b73b..56cc2d842 100644--- a/test/net/yacy/document/parser/pdfParserTest.java+++ b/test/net/yacy/document/parser/pdfParserTest.java@@ -6,6 +6,7 @@ import java.util.Collection;import static junit.framework.TestCase.assertEquals;import net.yacy.cora.document.id.AnchorURL;import net.yacy.document.Document;+import net.yacy.document.VocabularyScraper;import org.junit.Test;public class pdfParserTest {@@ -29,7 +30,7 @@ public class pdfParserTest {System.out.println("parse file: " + filename);pdfParser p = new pdfParser();- final Document[] docs = p.parse(url, mimetype, charset, null, new FileInputStream(file));+ final Document[] docs = p.parse(url, mimetype, charset, new VocabularyScraper(), 0, new FileInputStream(file));Document doc = docs[0];int ilinks = doc.getAnchors().size();