Search in sources :

Example 1 with TMarketoOutputProperties

use of org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties in project components by Talend.

the class MarketoWriterTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    TMarketoOutputProperties pout = new TMarketoOutputProperties("test");
    pout.connection.setupProperties();
    pout.setupProperties();
    MarketoSink sink = new MarketoSink();
    sink.initialize(null, pout);
    wop = (MarketoWriteOperation) sink.createWriteOperation();
    writer = (MarketoWriter) wop.createWriter(null);
}
Also used : TMarketoOutputProperties(org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties) Before(org.junit.Before)

Example 2 with TMarketoOutputProperties

use of org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties in project components by Talend.

the class MarketoCustomObjectClientTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    iprops = new TMarketoInputProperties("test");
    iprops.schemaInput.setupProperties();
    iprops.schemaInput.setupLayout();
    iprops.connection.setupProperties();
    iprops.connection.setupLayout();
    iprops.connection.setupProperties();
    iprops.connection.endpoint.setValue("https://fake.io/rest");
    iprops.connection.clientAccessId.setValue("clientaccess");
    iprops.connection.secretKey.setValue("sekret");
    // shorten interval for tests
    iprops.connection.attemptsIntervalTime.setValue(200);
    iprops.setupProperties();
    iprops.setupLayout();
    iprops.customObjectName.setValue("car_c");
    iprops.inputOperation.setValue(InputOperation.CustomObject);
    oprops = new TMarketoOutputProperties("test");
    oprops.schemaInput.setupProperties();
    oprops.schemaInput.setupLayout();
    oprops.connection.setupProperties();
    oprops.connection.setupLayout();
    oprops.connection.setupProperties();
    oprops.connection.endpoint.setValue("https://fake.io/rest");
    oprops.connection.clientAccessId.setValue("clientaccess");
    oprops.connection.secretKey.setValue("sekret");
    // shorten interval for tests
    oprops.connection.attemptsIntervalTime.setValue(200);
    oprops.setupProperties();
    oprops.setupLayout();
    oprops.customObjectName.setValue("car_c");
}
Also used : TMarketoOutputProperties(org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties) TMarketoInputProperties(org.talend.components.marketo.tmarketoinput.TMarketoInputProperties) Before(org.junit.Before)

Example 3 with TMarketoOutputProperties

use of org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties in project components by Talend.

the class MarketoClientCustomObjectsTestIT method setUp.

@Before
public void setUp() throws Exception {
    irProps = new TMarketoInputProperties("test");
    irProps.connection.setupProperties();
    irProps.connection.endpoint.setValue(ENDPOINT_REST);
    irProps.connection.clientAccessId.setValue(USERID_REST);
    irProps.connection.secretKey.setValue(SECRETKEY_REST);
    irProps.connection.apiMode.setValue(REST);
    irProps.schemaInput.setupProperties();
    irProps.mappingInput.setupProperties();
    irProps.setupProperties();
    irProps.includeTypes.setupProperties();
    irProps.includeTypes.type.setValue(new ArrayList<String>());
    irProps.excludeTypes.setupProperties();
    irProps.excludeTypes.type.setValue(new ArrayList<String>());
    irProps.connection.setupLayout();
    irProps.schemaInput.setupLayout();
    irProps.setupLayout();
    // 
    oprops = new TMarketoOutputProperties("test");
    oprops.connection.setupProperties();
    oprops.connection.apiMode.setValue(REST);
    oprops.connection.endpoint.setValue(ENDPOINT_REST);
    oprops.connection.clientAccessId.setValue(USERID_REST);
    oprops.connection.secretKey.setValue(SECRETKEY_REST);
    oprops.schemaInput.setupProperties();
    oprops.setupProperties();
    oprops.connection.setupLayout();
    oprops.schemaInput.setupLayout();
    oprops.setupLayout();
}
Also used : TMarketoOutputProperties(org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties) TMarketoInputProperties(org.talend.components.marketo.tmarketoinput.TMarketoInputProperties) Before(org.junit.Before)

Example 4 with TMarketoOutputProperties

use of org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties in project components by Talend.

the class MarketoRESTClientTestIT method setUp.

@Before
public void setUp() throws Exception {
    iprops = new TMarketoInputProperties("test");
    iprops.connection.setupProperties();
    iprops.connection.endpoint.setValue(ENDPOINT_REST);
    iprops.connection.clientAccessId.setValue(USERID_REST);
    iprops.connection.secretKey.setValue(SECRETKEY_REST);
    iprops.connection.apiMode.setValue(APIMode.REST);
    iprops.schemaInput.setupProperties();
    iprops.mappingInput.setupProperties();
    iprops.setupProperties();
    iprops.includeTypes.setupProperties();
    iprops.includeTypes.type.setValue(new ArrayList<String>());
    iprops.excludeTypes.setupProperties();
    iprops.excludeTypes.type.setValue(new ArrayList<String>());
    iprops.connection.setupLayout();
    iprops.schemaInput.setupLayout();
    iprops.setupLayout();
    // 
    listProperties = new TMarketoListOperationProperties("test");
    listProperties.connection.setupProperties();
    listProperties.connection.endpoint.setValue(ENDPOINT_REST);
    listProperties.connection.clientAccessId.setValue(USERID_REST);
    listProperties.connection.secretKey.setValue(SECRETKEY_REST);
    listProperties.connection.apiMode.setValue(APIMode.REST);
    listProperties.schemaInput.setupProperties();
    listProperties.setupProperties();
    listProperties.connection.setupLayout();
    listProperties.schemaInput.setupLayout();
    listProperties.setupLayout();
    // 
    outProperties = new TMarketoOutputProperties("test");
    outProperties.connection.setupProperties();
    outProperties.connection.endpoint.setValue(ENDPOINT_REST);
    outProperties.connection.clientAccessId.setValue(USERID_REST);
    outProperties.connection.secretKey.setValue(SECRETKEY_REST);
    outProperties.connection.apiMode.setValue(APIMode.REST);
    outProperties.schemaInput.setupProperties();
    outProperties.setupProperties();
    outProperties.connection.setupLayout();
    outProperties.schemaInput.setupLayout();
    outProperties.setupLayout();
}
Also used : TMarketoOutputProperties(org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties) TMarketoListOperationProperties(org.talend.components.marketo.tmarketolistoperation.TMarketoListOperationProperties) TMarketoInputProperties(org.talend.components.marketo.tmarketoinput.TMarketoInputProperties) Before(org.junit.Before)

Example 5 with TMarketoOutputProperties

use of org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties in project components by Talend.

the class MarketoBaseTestIT method initClient.

public static TMarketoOutputProperties initClient() throws Exception {
    TMarketoOutputProperties p = new TMarketoOutputProperties("test");
    p.setupProperties();
    p.connection.setupProperties();
    p.connection.endpoint.setValue(ENDPOINT_REST);
    p.connection.clientAccessId.setValue(USERID_REST);
    p.connection.secretKey.setValue(SECRETKEY_REST);
    p.connection.apiMode.setValue(REST);
    p.connection.setupLayout();
    p.schemaInput.setupProperties();
    p.schemaInput.setupLayout();
    p.setupLayout();
    p.batchSize.setValue(300);
    p.outputOperation.setValue(OutputOperation.syncLead);
    p.operationType.setValue(OperationType.createOrUpdate);
    p.lookupField.setValue(RESTLookupFields.email);
    p.deDupeEnabled.setValue(false);
    p.updateSchemaRelated();
    MarketoSource source = new MarketoSource();
    source.initialize(null, p);
    datasetsClient = (MarketoRESTClient) source.getClientService(null);
    return p;
}
Also used : TMarketoOutputProperties(org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties)

Aggregations

TMarketoOutputProperties (org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties)17 Before (org.junit.Before)9 TMarketoInputProperties (org.talend.components.marketo.tmarketoinput.TMarketoInputProperties)9 TMarketoListOperationProperties (org.talend.components.marketo.tmarketolistoperation.TMarketoListOperationProperties)7 Test (org.junit.Test)3 AuthenticationHeader (com.marketo.mktows.AuthenticationHeader)1 MktowsPort (com.marketo.mktows.MktowsPort)1 ObjectFactory (com.marketo.mktows.ObjectFactory)1 ParamsListMObjects (com.marketo.mktows.ParamsListMObjects)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 GregorianCalendar (java.util.GregorianCalendar)1 Schema (org.apache.avro.Schema)1 Field (org.apache.avro.Schema.Field)1 IndexedRecord (org.apache.avro.generic.IndexedRecord)1 RuntimeContainer (org.talend.components.api.container.RuntimeContainer)1 MarketoProvideConnectionProperties (org.talend.components.marketo.MarketoProvideConnectionProperties)1 SyncStatus (org.talend.components.marketo.runtime.client.rest.type.SyncStatus)1 ListOperationParameters (org.talend.components.marketo.runtime.client.type.ListOperationParameters)1 MarketoSyncResult (org.talend.components.marketo.runtime.client.type.MarketoSyncResult)1