Search in sources :

Example 1 with GenericRepository

use of org.talend.repository.generic.persistence.GenericRepository in project tdi-studio-se by Talend.

the class RepositoryUpdateTest method setupPropertiesWithProxy.

private void setupPropertiesWithProxy(String id) {
    SalesforceConnectionProperties sfp = new SalesforceConnectionProperties("test");
    sfp.init();
    sfp.loginType.setValue(SalesforceConnectionProperties.LoginType.Basic);
    sfp.userPassword.userId.setStoredValue("myUser");
    sfp.userPassword.password.setStoredValue("myPassword");
    sfp.proxy.useProxy.setStoredValue(Boolean.TRUE);
    sfp.proxy.host.setStoredValue("host");
    sfp.proxy.port.setStoredValue(1234);
    sfp.proxy.userPassword.userId.setStoredValue("proxyUser");
    sfp.proxy.userPassword.password.setStoredValue("proxyPassword");
    GenericRepository gr = new GenericRepository();
    gr.storeProperties(sfp, "test", id, null);
}
Also used : GenericRepository(org.talend.repository.generic.persistence.GenericRepository) SalesforceConnectionProperties(org.talend.components.salesforce.SalesforceConnectionProperties)

Example 2 with GenericRepository

use of org.talend.repository.generic.persistence.GenericRepository in project tdi-studio-se by Talend.

the class RepositoryUpdateTest method prepareTableForTest.

private MetadataTable prepareTableForTest(String id) {
    MetadataTable table = ConnectionFactory.eINSTANCE.createMetadataTable();
    table.setLabel("myTableTest");
    MetadataColumn col1 = ConnectionFactory.eINSTANCE.createMetadataColumn();
    col1.setLabel("myColumn1");
    col1.setTalendType(JavaTypesManager.STRING.getId());
    col1.setLength(25);
    table.getColumns().add(col1);
    Schema avroSchema = MetadataToolAvroHelper.convertToAvro(table);
    TaggedValue tv = CoreFactory.eINSTANCE.createTaggedValue();
    tv.setTag(IComponentConstants.COMPONENT_PROPERTIES_TAG);
    SalesforceModuleProperties smp = new SalesforceModuleProperties("test");
    smp.connection.init();
    // because we should get connection always from the main
    smp.connection.userPassword.userId.setValue("old");
    // SalesforceConnectionProperties
    smp.moduleName.setStoredValue("myModule");
    smp.main.schema.setStoredValue(avroSchema);
    GenericRepository gr = new GenericRepository();
    gr.storeProperties(smp, table.getLabel(), id + "#", "main.schema");
    return table;
}
Also used : MetadataColumn(org.talend.core.model.metadata.builder.connection.MetadataColumn) SalesforceModuleProperties(org.talend.components.salesforce.SalesforceModuleProperties) GenericRepository(org.talend.repository.generic.persistence.GenericRepository) TaggedValue(orgomg.cwm.objectmodel.core.TaggedValue) Schema(org.apache.avro.Schema) MetadataTable(org.talend.core.model.metadata.builder.connection.MetadataTable)

Example 3 with GenericRepository

use of org.talend.repository.generic.persistence.GenericRepository in project tdi-studio-se by Talend.

the class RepositoryUpdateTest method setupPropertiesWithProxyEmptyVars.

private void setupPropertiesWithProxyEmptyVars(String id) {
    SalesforceConnectionProperties sfp = new SalesforceConnectionProperties("test");
    sfp.init();
    sfp.loginType.setValue(SalesforceConnectionProperties.LoginType.Basic);
    sfp.userPassword.userId.setStoredValue("myUser");
    sfp.userPassword.password.setStoredValue("myPassword");
    sfp.proxy.useProxy.setStoredValue(Boolean.TRUE);
    sfp.proxy.host.setStoredValue(null);
    sfp.proxy.port.setStoredValue(null);
    sfp.proxy.userPassword.userId.setStoredValue(null);
    sfp.proxy.userPassword.password.setStoredValue(null);
    GenericRepository gr = new GenericRepository();
    gr.storeProperties(sfp, "test", id, null);
}
Also used : GenericRepository(org.talend.repository.generic.persistence.GenericRepository) SalesforceConnectionProperties(org.talend.components.salesforce.SalesforceConnectionProperties)

Example 4 with GenericRepository

use of org.talend.repository.generic.persistence.GenericRepository in project tdi-studio-se by Talend.

the class RepositoryUpdateTest method setupPropertiesWithoutProxy.

private void setupPropertiesWithoutProxy(String id) {
    SalesforceConnectionProperties sfp = new SalesforceConnectionProperties("test");
    sfp.init();
    sfp.loginType.setValue(SalesforceConnectionProperties.LoginType.Basic);
    sfp.userPassword.userId.setStoredValue("myUser");
    sfp.userPassword.password.setStoredValue("myPassword");
    GenericRepository gr = new GenericRepository();
    gr.storeProperties(sfp, "test", id, null);
}
Also used : GenericRepository(org.talend.repository.generic.persistence.GenericRepository) SalesforceConnectionProperties(org.talend.components.salesforce.SalesforceConnectionProperties)

Aggregations

GenericRepository (org.talend.repository.generic.persistence.GenericRepository)4 SalesforceConnectionProperties (org.talend.components.salesforce.SalesforceConnectionProperties)3 Schema (org.apache.avro.Schema)1 SalesforceModuleProperties (org.talend.components.salesforce.SalesforceModuleProperties)1 MetadataColumn (org.talend.core.model.metadata.builder.connection.MetadataColumn)1 MetadataTable (org.talend.core.model.metadata.builder.connection.MetadataTable)1 TaggedValue (orgomg.cwm.objectmodel.core.TaggedValue)1