Search in sources :

Example 1 with SalesforceStepMeta

use of org.pentaho.di.trans.steps.salesforce.SalesforceStepMeta in project pentaho-kettle by pentaho.

the class SalesforceInputMetaTest method testErrorHandling.

@Test
public void testErrorHandling() {
    SalesforceStepMeta meta = new SalesforceInputMeta();
    assertFalse(meta.supportsErrorHandling());
}
Also used : SalesforceStepMeta(org.pentaho.di.trans.steps.salesforce.SalesforceStepMeta) SalesforceMetaTest(org.pentaho.di.trans.steps.salesforce.SalesforceMetaTest) Test(org.junit.Test)

Example 2 with SalesforceStepMeta

use of org.pentaho.di.trans.steps.salesforce.SalesforceStepMeta in project pentaho-kettle by pentaho.

the class SalesforceUpdateMetaTest method testErrorHandling.

@Test
public void testErrorHandling() {
    SalesforceStepMeta meta = new SalesforceUpdateMeta();
    assertTrue(meta.supportsErrorHandling());
}
Also used : SalesforceStepMeta(org.pentaho.di.trans.steps.salesforce.SalesforceStepMeta) SalesforceMetaTest(org.pentaho.di.trans.steps.salesforce.SalesforceMetaTest) Test(org.junit.Test)

Example 3 with SalesforceStepMeta

use of org.pentaho.di.trans.steps.salesforce.SalesforceStepMeta in project pentaho-kettle by pentaho.

the class SalesforceUpsertMetaTest method testErrorHandling.

@Test
public void testErrorHandling() {
    SalesforceStepMeta meta = new SalesforceUpsertMeta();
    assertTrue(meta.supportsErrorHandling());
}
Also used : SalesforceStepMeta(org.pentaho.di.trans.steps.salesforce.SalesforceStepMeta) SalesforceMetaTest(org.pentaho.di.trans.steps.salesforce.SalesforceMetaTest) Test(org.junit.Test)

Example 4 with SalesforceStepMeta

use of org.pentaho.di.trans.steps.salesforce.SalesforceStepMeta in project pentaho-kettle by pentaho.

the class SalesforceStepDialog method test.

protected void test() {
    boolean successConnection = true;
    String msgError = null;
    SalesforceConnection connection = null;
    String realUsername = null;
    try {
        SalesforceStepMeta meta = META_CLASS.newInstance();
        getInfo(meta);
        // get real values
        String realURL = transMeta.environmentSubstitute(meta.getTargetURL());
        realUsername = transMeta.environmentSubstitute(meta.getUsername());
        String realPassword = Utils.resolvePassword(transMeta, meta.getPassword());
        int realTimeOut = Const.toInt(transMeta.environmentSubstitute(meta.getTimeout()), 0);
        connection = new SalesforceConnection(log, realURL, realUsername, realPassword);
        connection.setTimeOut(realTimeOut);
        connection.connect();
    } catch (Exception e) {
        successConnection = false;
        msgError = e.getMessage();
    } finally {
        if (connection != null) {
            try {
                connection.close();
            } catch (Exception e) {
            /* Ignore */
            }
        }
    }
    if (successConnection) {
        MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_INFORMATION);
        mb.setMessage(BaseMessages.getString(PKG, "SalesforceDialog.Connected.OK", realUsername) + Const.CR);
        mb.setText(BaseMessages.getString(PKG, "SalesforceDialog.Connected.Title.Ok"));
        mb.open();
    } else {
        new ErrorDialog(shell, BaseMessages.getString(PKG, "SalesforceDialog.Connected.Title.Error"), BaseMessages.getString(PKG, "SalesforceDialog.Connected.NOK", realUsername), new Exception(msgError));
    }
}
Also used : ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) SalesforceStepMeta(org.pentaho.di.trans.steps.salesforce.SalesforceStepMeta) SalesforceConnection(org.pentaho.di.trans.steps.salesforce.SalesforceConnection) KettleException(org.pentaho.di.core.exception.KettleException) MessageBox(org.eclipse.swt.widgets.MessageBox)

Example 5 with SalesforceStepMeta

use of org.pentaho.di.trans.steps.salesforce.SalesforceStepMeta in project pentaho-kettle by pentaho.

the class SalesforceDeleteMetaTest method testErrorHandling.

@Test
public void testErrorHandling() {
    SalesforceStepMeta meta = new SalesforceDeleteMeta();
    assertTrue(meta.supportsErrorHandling());
}
Also used : SalesforceStepMeta(org.pentaho.di.trans.steps.salesforce.SalesforceStepMeta) SalesforceMetaTest(org.pentaho.di.trans.steps.salesforce.SalesforceMetaTest) Test(org.junit.Test)

Aggregations

SalesforceStepMeta (org.pentaho.di.trans.steps.salesforce.SalesforceStepMeta)6 Test (org.junit.Test)5 SalesforceMetaTest (org.pentaho.di.trans.steps.salesforce.SalesforceMetaTest)5 MessageBox (org.eclipse.swt.widgets.MessageBox)1 KettleException (org.pentaho.di.core.exception.KettleException)1 SalesforceConnection (org.pentaho.di.trans.steps.salesforce.SalesforceConnection)1 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)1