use of org.talend.dataprep.api.dataset.DataSetMetadata in project data-prep by Talend.
the class HtmlSchemaParserTest method should_not_accept_csv_update.
@Test
public void should_not_accept_csv_update() throws Exception {
final DataSetMetadata metadata = metadataBuilder.metadata().id("toto").formatFamilyId("formatGuess#csv").build();
assertFalse(parser.accept(metadata));
}
use of org.talend.dataprep.api.dataset.DataSetMetadata in project data-prep by Talend.
the class HtmlSchemaParserTest method should_not_accept_xls_update.
@Test
public void should_not_accept_xls_update() throws Exception {
final DataSetMetadata metadata = metadataBuilder.metadata().id("tata").formatFamilyId("formatGuess#xls").build();
assertFalse(parser.accept(metadata));
}
use of org.talend.dataprep.api.dataset.DataSetMetadata in project data-prep by Talend.
the class XlsSchemaParserTest method should_not_accept_html_update.
@Test
public void should_not_accept_html_update() throws Exception {
final DataSetMetadata metadata = metadataBuilder.metadata().id("tata").formatFamilyId("formatGuess#html").build();
assertFalse(parser.accept(metadata));
}
use of org.talend.dataprep.api.dataset.DataSetMetadata in project data-prep by Talend.
the class XlsSchemaParserTest method should_not_accept_csv_update.
@Test
public void should_not_accept_csv_update() throws Exception {
final DataSetMetadata metadata = metadataBuilder.metadata().id("toto").formatFamilyId("formatGuess#csv").build();
assertFalse(parser.accept(metadata));
}
use of org.talend.dataprep.api.dataset.DataSetMetadata in project data-prep by Talend.
the class XlsSchemaParserTest method checkColumnsName.
/**
* Load the excel file and check the parsed columns name against the given ones.
*
* @param inputStream the excel file name as inputStream
* @param expectedColsName the expected columns name.
* @throws IOException if an error occurs while reading the excel file.
*/
private void checkColumnsName(InputStream inputStream, String... expectedColsName) throws IOException {
DataSetMetadata datasetMetadata = ioTestUtils.getSimpleDataSetMetadata();
Schema result = parser.parse(new SchemaParser.Request(inputStream, datasetMetadata));
List<ColumnMetadata> columns = result.getSheetContents().get(0).getColumnMetadatas();
final List<String> actual = columns.stream().map(ColumnMetadata::getName).collect(Collectors.toList());
assertThat(actual).containsExactly(expectedColsName);
}
Aggregations