use of org.talend.components.marketo.tmarketoconnection.TMarketoConnectionProperties in project components by Talend.
the class MarketoSourceOrSink method getEffectiveConnection.
public TMarketoConnectionProperties getEffectiveConnection(RuntimeContainer container) {
TMarketoConnectionProperties connProps = properties.getConnectionProperties();
String refComponentId = connProps.getReferencedComponentId();
// Using another component's connection
if (refComponentId != null) {
// In a runtime container
if (container != null) {
TMarketoConnectionProperties shared = (TMarketoConnectionProperties) container.getComponentData(refComponentId, KEY_CONNECTION_PROPERTIES);
if (shared != null) {
return shared;
}
}
// Design time
connProps = connProps.getReferencedConnectionProperties();
}
if (container != null) {
container.setComponentData(container.getCurrentComponentId(), KEY_CONNECTION_PROPERTIES, connProps);
}
return connProps;
}
use of org.talend.components.marketo.tmarketoconnection.TMarketoConnectionProperties in project components by Talend.
the class MarketoCustomObjectsSchemasPropertiesTest method setUp.
@Before
public void setUp() throws Exception {
properties = new MarketoCustomObjectsSchemasProperties("test");
properties.setupProperties();
connection = new TMarketoConnectionProperties("testconn");
connection.setupProperties();
connection.endpoint.setValue("http://fakeendpoint.com");
connection.clientAccessId.setValue("user0000");
connection.secretKey.setValue("secretk");
properties.setupLayout();
}
use of org.talend.components.marketo.tmarketoconnection.TMarketoConnectionProperties in project components by Talend.
the class MarketoConnectionWizardTest method testSetupProperties.
@Test
public void testSetupProperties() throws Exception {
TMarketoConnectionProperties p = new TMarketoConnectionProperties("test");
p.setupProperties();
wiz.setupProperties(p);
assertEquals(p, wiz.connProperties);
assertEquals(p, wiz.coProps.connection);
}
use of org.talend.components.marketo.tmarketoconnection.TMarketoConnectionProperties in project components by Talend.
the class MarketoSourceOrSink method validate.
@Override
public ValidationResult validate(RuntimeContainer container) {
TMarketoConnectionProperties conn = getEffectiveConnection(container);
String endpoint = conn.endpoint.getValue();
String clientAccess = conn.clientAccessId.getValue();
String secretKey = conn.secretKey.getValue();
ValidationResultMutable vr = new ValidationResultMutable();
if (endpoint == null || endpoint.isEmpty()) {
vr.setMessage(messages.getMessage("error.validation.connection.endpoint"));
vr.setStatus(ValidationResult.Result.ERROR);
return vr;
}
if (clientAccess == null || clientAccess.isEmpty()) {
vr.setMessage(messages.getMessage("error.validation.connection.clientaccess"));
vr.setStatus(ValidationResult.Result.ERROR);
return vr;
}
if (secretKey == null || secretKey.isEmpty()) {
vr.setMessage(messages.getMessage("error.validation.connection.secretkey"));
vr.setStatus(ValidationResult.Result.ERROR);
return vr;
}
// bug/TDI-38439_MarketoWizardConnection
return validateConnection(conn);
}
use of org.talend.components.marketo.tmarketoconnection.TMarketoConnectionProperties in project components by Talend.
the class MarketoConnectionWizardTest method testWizardDefinitionCreateWizard.
@Test
public void testWizardDefinitionCreateWizard() throws Exception {
MarketoConnectionWizard w = (MarketoConnectionWizard) def.createWizard(repoLoc);
assertNotNull(w);
w = (MarketoConnectionWizard) def.createWizard(new TMarketoConnectionProperties("test"), repoLoc);
assertNotNull(w);
}
Aggregations