use of org.talend.repository.model.hdfs.HDFSConnection in project tbd-studio-se by Talend.
the class HdfsContextHandlerTest method testCreateContextParameters.
@Test
public void testCreateContextParameters() {
// $NON-NLS-1$
String prefixName = "testHDFS";
HDFSConnection connection = (HDFSConnection) HDFSConnectionTestUtils.createDefaultHDFSItem().getConnection();
Set<IConnParamName> paramSet = new HashSet<>();
paramSet.add(EHadoopParamName.HdfsUser);
paramSet.add(EHadoopParamName.HdfsFileSeparator);
paramSet.add(EHadoopParamName.HdfsRowSeparator);
paramSet.add(EHadoopParamName.HdfsRowHeader);
List<String> contextParameterNames = new ArrayList<>();
for (IConnParamName paramName : paramSet) {
contextParameterNames.add(prefixName + ConnectionContextHelper.LINE + paramName);
}
List<IContextParameter> contextParameters = contextHandler.createContextParameters(prefixName, connection, paramSet);
for (IContextParameter contextParameter : contextParameters) {
String contextParameterName = contextParameter.getName();
assertTrue(contextParameterNames.contains(contextParameterName));
checkContextParameter(contextParameter, connection);
}
}
Aggregations