use of org.talend.dataprep.schema.html.HtmlFormatFamily in project data-prep by Talend.
the class CompositeFormatDetectorTest method guess_html_format_fail.
@Test
public void guess_html_format_fail() throws Exception {
String fileName = "html/foo.html";
DataSetMetadata datasetMetadata = ioTestUtils.getSimpleDataSetMetadata();
datasetMetadata.setEncoding("UTF-16");
Format actual = formatDetector.detect(this.getClass().getResourceAsStream(fileName));
assertFalse(actual.getFormatFamily() instanceof HtmlFormatFamily);
}
use of org.talend.dataprep.schema.html.HtmlFormatFamily in project data-prep by Talend.
the class CompositeFormatDetectorTest method guess_html_format_success.
@Test
public void guess_html_format_success() throws Exception {
String fileName = "html/sales-force.xls";
DataSetMetadata datasetMetadata = ioTestUtils.getSimpleDataSetMetadata();
datasetMetadata.setEncoding("UTF-16");
Charset charset = new HtmlEncodingDetector().detect(this.getClass().getResourceAsStream(fileName), new Metadata());
Format actual = formatDetector.detect(this.getClass().getResourceAsStream(fileName));
assertTrue(actual.getFormatFamily() instanceof HtmlFormatFamily);
assertTrue(StringUtils.equals("UTF-16", actual.getEncoding()));
}
Aggregations