use of org.pentaho.actionsequence.dom.IActionDefinition in project pentaho-platform by pentaho.
the class XQueryBaseComponent method validateAction.
@Override
protected boolean validateAction() {
boolean result = false;
IActionDefinition actionDefinition = getActionDefinition();
if (actionDefinition instanceof XQueryAction) {
XQueryAction xQueryAction = (XQueryAction) actionDefinition;
if ((xQueryAction.getSourceXml() == ActionInputConstant.NULL_INPUT) && (xQueryAction.getXmlDocument() == null)) {
error(Messages.getInstance().getString("XQueryBaseComponent.ERROR_0008_SOURCE_NOT_DEFINED", // $NON-NLS-1$
getActionName()));
} else if (xQueryAction.getQuery() == ActionInputConstant.NULL_INPUT) {
error(Messages.getInstance().getErrorString("XQueryBaseComponent.ERROR_0001_QUERY_NOT_SPECIFIED", // $NON-NLS-1$
getActionName()));
} else if ((xQueryAction.getOutputPreparedStatement() == null) && (xQueryAction.getOutputResultSet() == null)) {
error(Messages.getInstance().getErrorString("XQueryBaseComponent.ERROR_0003_OUTPUT_NOT_SPECIFIED", // $NON-NLS-1$
getActionName()));
} else {
result = true;
}
} else if (actionDefinition instanceof XQueryConnectionAction) {
XQueryConnectionAction xQueryConnectionAction = (XQueryConnectionAction) actionDefinition;
if (xQueryConnectionAction.getOutputConnection() == null) {
error(Messages.getInstance().getErrorString("XQueryBaseComponent.ERROR_0003_OUTPUT_NOT_SPECIFIED", // $NON-NLS-1$
getActionName()));
} else {
result = true;
}
} else {
error(Messages.getInstance().getErrorString("ComponentBase.ERROR_0001_UNKNOWN_ACTION_TYPE", // $NON-NLS-1$
actionDefinition.getElement().asXML()));
}
return result;
}
use of org.pentaho.actionsequence.dom.IActionDefinition in project pentaho-platform by pentaho.
the class UtilityComponent method validateAction.
@Override
protected boolean validateAction() {
boolean result = true;
IActionDefinition actionDefinition = getActionDefinition();
if (actionDefinition instanceof CopyParamAction) {
result = validateCopyAction((CopyParamAction) actionDefinition);
} else if (actionDefinition instanceof FormatMsgAction) {
result = validateFormatAction((FormatMsgAction) actionDefinition);
} else if (actionDefinition instanceof PrintMapValsAction) {
result = validateGetMapValuesAction((PrintMapValsAction) actionDefinition);
} else if (actionDefinition instanceof PrintParamAction) {
result = validatePrintParamAction((PrintParamAction) actionDefinition);
} else {
// This component allows multiple actions to be defined in a single action definition.
// While this is no longer supported by the design studio, it needs to be supported here
// for backwards compatibility with older action sequence documents.
result = validateAction(actionDefinition);
}
return result;
}
use of org.pentaho.actionsequence.dom.IActionDefinition in project pentaho-platform by pentaho.
the class ActionExecutionExceptionTest method testCustomizedConstructors.
@Test
public void testCustomizedConstructors() {
IActionDefinition actionDef = Mockito.mock(IActionDefinition.class);
try {
Constructor<ActionExecutionException> constructor = ActionExecutionException.class.getDeclaredConstructor(String.class, Throwable.class, String.class, String.class, String.class, IActionDefinition.class);
constructor.setAccessible(true);
constructor.newInstance("msg", new Exception("cause"), "sessionName", "instanceId", "actionSequenceName", actionDef);
} catch (Exception e) {
fail(ActionExecutionException.class.getSimpleName() + " Does not have a constructor with String, Throwable, String, String, String, IActionDefinition ");
}
try {
Constructor<ActionExecutionException> constructor = ActionExecutionException.class.getDeclaredConstructor(String.class, String.class, String.class, String.class, IActionDefinition.class);
constructor.setAccessible(true);
constructor.newInstance("msg", "sessionName", "instanceId", "actionSequenceName", actionDef);
} catch (Exception e) {
fail(ActionExecutionException.class.getSimpleName() + " Does not have a constructor with String, String, String, String, IActionDefinition ");
}
}
use of org.pentaho.actionsequence.dom.IActionDefinition in project pentaho-platform by pentaho.
the class UnresolvedParameterExceptionTest method testUnresolvedParameterExceptionStringThrowableStringStringStringIActionDefinition.
@Test
public void testUnresolvedParameterExceptionStringThrowableStringStringStringIActionDefinition() {
IActionDefinition actionDef = Mockito.mock(IActionDefinition.class);
try {
Constructor<UnresolvedParameterException> constructor = UnresolvedParameterException.class.getDeclaredConstructor(String.class, String.class, String.class, String.class, IActionDefinition.class);
constructor.setAccessible(true);
constructor.newInstance("msg", "sessionName", "instanceId", "actionSequenceName", actionDef);
} catch (Exception e) {
fail(UnresolvedParameterException.class.getSimpleName() + " Does not have a constructor with String, String, String, String, IActionDefinition ");
}
}
Aggregations