Search in sources :

Example 16 with HDFSConnection

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);
    }
}
Also used : ArrayList(java.util.ArrayList) HDFSConnection(org.talend.repository.model.hdfs.HDFSConnection) IConnParamName(org.talend.metadata.managment.ui.model.IConnParamName) IContextParameter(org.talend.core.model.process.IContextParameter) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

HDFSConnection (org.talend.repository.model.hdfs.HDFSConnection)16 ArrayList (java.util.ArrayList)6 Map (java.util.Map)5 IConnParamName (org.talend.metadata.managment.ui.model.IConnParamName)4 EHadoopParamName (org.talend.metadata.managment.ui.utils.ExtendedNodeConnectionContextUtils.EHadoopParamName)4 HashSet (java.util.HashSet)2 List (java.util.List)2 MetadataColumn (org.talend.core.model.metadata.builder.connection.MetadataColumn)2 IContextParameter (org.talend.core.model.process.IContextParameter)2 ContextItem (org.talend.core.model.properties.ContextItem)2 Property (org.talend.core.model.properties.Property)2 ConectionAdaptContextVariableModel (org.talend.core.ui.context.model.table.ConectionAdaptContextVariableModel)2 HDFSConnectionBean (org.talend.designer.hdfsbrowse.model.HDFSConnectionBean)2 HDFSConnectionItem (org.talend.repository.model.hdfs.HDFSConnectionItem)2 Test (org.junit.Test)1 EHadoopVersion4Drivers (org.talend.core.hadoop.version.EHadoopVersion4Drivers)1 MetadataTable (org.talend.core.model.metadata.builder.connection.MetadataTable)1 ERepositoryObjectType (org.talend.core.model.repository.ERepositoryObjectType)1 HDFSFile (org.talend.designer.hdfsbrowse.model.HDFSFile)1 HadoopClusterConnection (org.talend.repository.model.hadoopcluster.HadoopClusterConnection)1