Commit c2f3d3b5 authored by Nico Mack's avatar Nico Mack

Added sanity checks on specified connector

parent 467f9ab6
......@@ -103,9 +103,15 @@ public class RESTfulWebServiceExecutor extends Executor {
public boolean eval(String script) {
boolean success = true;
this.executionErrors.reset();
if (!(this.connector instanceof WebServiceConnector)) {
LOGGER.error("Specified connector is not a WebServiceConnector!"); //$NON-NLS-1$
return false;
}
WebServiceConnector webService = (WebServiceConnector) this.connector;
Matcher callMatcher = SCRIPT_PATTERN.matcher(script);
if (callMatcher.matches()) {
WebServiceConnector webService = (WebServiceConnector) this.connector;
long elapsed = System.currentTimeMillis();
Client client = webService.getConnection();
String targetUri = webService.buildTargetUri(callMatcher.group(2));
......
......@@ -506,6 +506,12 @@ public class SqlExecutor extends Executor {
@Override
public boolean eval(String script) {
long elapsed = System.currentTimeMillis();
if (!(this.connector instanceof JdbcConnector)) {
LOGGER.error("Specified connector is not a JdbcConnector!"); //$NON-NLS-1$
return false;
}
Connection connection = ((JdbcConnector) this.connector).getConnection();
List<String> variables = new ArrayList<String>();
String queryString = this.interpolate(script, variables, this.parameters, false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment