use of org.pentaho.di.core.CheckResultInterface in project pentaho-kettle by pentaho.
the class CheckResultDialog method getData.
/**
* Copy information from the meta-data input to the dialog fields.
*/
public void getData() {
wFields.table.removeAll();
for (int i = 0; i < remarks.size(); i++) {
CheckResultInterface cr = remarks.get(i);
if (show_successful_results || cr.getType() != CheckResultInterface.TYPE_RESULT_OK) {
TableItem ti = new TableItem(wFields.table, SWT.NONE);
// MB - Support both JobEntry and Step Checking
// 6/25/07
CheckResultSourceInterface sourceMeta = cr.getSourceInfo();
if (sourceMeta != null) {
ti.setText(1, sourceMeta.getName());
} else {
ti.setText(1, "<global>");
}
ti.setText(2, cr.getType() + " - " + cr.getTypeDesc());
ti.setText(3, cr.getText());
Color col = ti.getBackground();
switch(cr.getType()) {
case CheckResultInterface.TYPE_RESULT_OK:
col = green;
break;
case CheckResultInterface.TYPE_RESULT_ERROR:
col = red;
break;
case CheckResultInterface.TYPE_RESULT_WARNING:
col = yellow;
break;
case CheckResultInterface.TYPE_RESULT_COMMENT:
default:
break;
}
ti.setBackground(col);
}
}
if (wFields.table.getItemCount() == 0) {
wFields.clearAll(false);
}
wFields.setRowNums();
wFields.optWidth(true);
if (show_successful_results) {
wlFields.setText(STRING_HIDE_REMARKS);
wNoOK.setText(STRING_HIDE_SUCESSFUL);
} else {
wlFields.setText(STRING_SHOW_REMARKS);
wNoOK.setText(STRING_SHOW_SUCESSFUL);
}
shell.layout();
}
use of org.pentaho.di.core.CheckResultInterface in project pentaho-kettle by pentaho.
the class SalesforceDeleteMetaTest method testCheck.
@Test
public void testCheck() {
SalesforceDeleteMeta meta = new SalesforceDeleteMeta();
meta.setDefault();
List<CheckResultInterface> remarks = new ArrayList<CheckResultInterface>();
meta.check(remarks, null, null, null, null, null, null, null, null, null);
boolean hasError = false;
for (CheckResultInterface cr : remarks) {
if (cr.getType() == CheckResult.TYPE_RESULT_ERROR) {
hasError = true;
}
}
assertFalse(remarks.isEmpty());
assertTrue(hasError);
remarks.clear();
meta.setDefault();
meta.setUsername("user");
meta.check(remarks, null, null, null, null, null, null, null, null, null);
hasError = false;
for (CheckResultInterface cr : remarks) {
if (cr.getType() == CheckResult.TYPE_RESULT_ERROR) {
hasError = true;
}
}
assertFalse(remarks.isEmpty());
assertFalse(hasError);
}
use of org.pentaho.di.core.CheckResultInterface in project pentaho-kettle by pentaho.
the class SalesforceInsertMetaTest method testCheck.
@Test
public void testCheck() {
SalesforceInsertMeta meta = new SalesforceInsertMeta();
meta.setDefault();
List<CheckResultInterface> remarks = new ArrayList<CheckResultInterface>();
meta.check(remarks, null, null, null, null, null, null, null, null, null);
boolean hasError = false;
for (CheckResultInterface cr : remarks) {
if (cr.getType() == CheckResult.TYPE_RESULT_ERROR) {
hasError = true;
}
}
assertFalse(remarks.isEmpty());
assertTrue(hasError);
remarks.clear();
meta.setDefault();
meta.setUsername("user");
meta.setUpdateLookup(new String[] { "SalesforceField" });
meta.setUpdateStream(new String[] { "StreamField" });
meta.setUseExternalId(new Boolean[] { false });
meta.check(remarks, null, null, null, null, null, null, null, null, null);
hasError = false;
for (CheckResultInterface cr : remarks) {
if (cr.getType() == CheckResult.TYPE_RESULT_ERROR) {
hasError = true;
}
}
assertFalse(remarks.isEmpty());
assertFalse(hasError);
}
use of org.pentaho.di.core.CheckResultInterface in project pentaho-kettle by pentaho.
the class MQTTProducerMetaTest method testCheckOptions.
@Test
public void testCheckOptions() {
List<CheckResultInterface> remarks = new ArrayList<>();
MQTTProducerMeta meta = new MQTTProducerMeta();
meta.setMqttServer("theserver:1883");
meta.setClientId("client100");
meta.setTopic("newtopic");
meta.setQOS("2");
meta.setMessageField("Messages");
meta.setUsername("testuser");
meta.setPassword("test");
meta.setKeepAliveInterval("1000");
meta.setMaxInflight("2000");
meta.setConnectionTimeout("3000");
meta.setCleanSession("true");
meta.setStorageLevel("/Users/noname/temp");
meta.setServerUris("mqttHost2:1883");
meta.setMqttVersion("3");
meta.setAutomaticReconnect("true");
meta.check(remarks, null, null, null, null, null, null, new Variables(), null, null);
assertEquals(0, remarks.size());
}
use of org.pentaho.di.core.CheckResultInterface in project pentaho-kettle by pentaho.
the class SalesforceUpdateMetaTest method testCheck.
@Test
public void testCheck() {
SalesforceUpdateMeta meta = new SalesforceUpdateMeta();
meta.setDefault();
List<CheckResultInterface> remarks = new ArrayList<CheckResultInterface>();
meta.check(remarks, null, null, null, null, null, null, null, null, null);
boolean hasError = false;
for (CheckResultInterface cr : remarks) {
if (cr.getType() == CheckResult.TYPE_RESULT_ERROR) {
hasError = true;
}
}
assertFalse(remarks.isEmpty());
assertTrue(hasError);
remarks.clear();
meta.setDefault();
meta.setUsername("user");
meta.setUpdateLookup(new String[] { "SalesforceField" });
meta.setUpdateStream(new String[] { "StreamField" });
meta.setUseExternalId(new Boolean[] { false });
meta.check(remarks, null, null, null, null, null, null, null, null, null);
hasError = false;
for (CheckResultInterface cr : remarks) {
if (cr.getType() == CheckResult.TYPE_RESULT_ERROR) {
hasError = true;
}
}
assertFalse(remarks.isEmpty());
assertFalse(hasError);
}
Aggregations