diff options
| author | reger <reger18@arcor.de> | 2015-04-25 03:24:28 +0200 |
|---|---|---|
| committer | reger <reger18@arcor.de> | 2015-04-25 03:24:28 +0200 |
| commit | 71bf95af8a94858cea714634f5eb7746585605b1 (patch) | |
| tree | 6614304b58cc58944a99a0952cb6f64e63a65cd5 /test | |
| parent | 579303a04e406bf49e86bbbd25bbe14cdb56069e (diff) | |
upd parser calls in test cases
Diffstat (limited to 'test')
5 files changed, 13 insertions, 10 deletions
diff --git a/test/net/yacy/document/ParserTest.java b/test/net/yacy/document/ParserTest.java index 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.java index 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.java index 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.java index 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.java index 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();
|
