/** * Tests running a script with empty script text. */ @Test public void testRunScriptFailEmptyScriptText() { // run test only in case operation is supported if (ConnectorHelper.operationsSupported(getConnectorFacade(), getAPIOperations())) { try { getConnectorFacade().runScriptOnConnector( new ScriptContext("LANGUAGE", "", new HashMap<String, Object>()), null); fail("Script text is empty and script language is not probably supported, should throw an exception."); } catch (RuntimeException ex) { // expected } } else { LOG.info("----------------------------------------------------"); LOG.info("Skipping test ''testRunScriptFailEmptyScriptText''."); LOG.info("----------------------------------------------------"); } }
/** * Tests running a script with empty script text. */ @Test public void testRunScriptFailEmptyScriptText() { // run test only in case operation is supported if (ConnectorHelper.operationsSupported(getConnectorFacade(), getAPIOperations())) { try { getConnectorFacade().runScriptOnConnector( new ScriptContext("LANGUAGE", "", new HashMap<String, Object>()), null); fail("Script text is empty and script language is not probably supported, should throw an exception."); } catch (RuntimeException ex) { // expected } } else { LOG.info("----------------------------------------------------"); LOG.info("Skipping test ''testRunScriptFailEmptyScriptText''."); LOG.info("----------------------------------------------------"); } } }
/** * Tests running a script with empty script text. */ @Test public void testRunScriptFailEmptyScriptText() { // run test only in case operation is supported if (ConnectorHelper.operationsSupported(getConnectorFacade(), getAPIOperations())) { try { getConnectorFacade().runScriptOnConnector( new ScriptContext("LANGUAGE", "", new HashMap<String, Object>()), null); fail("Script text is empty and script language is not probably supported, should throw an exception."); } catch (RuntimeException ex) { // expected } } else { LOG.info("----------------------------------------------------"); LOG.info("Skipping test ''testRunScriptFailEmptyScriptText''."); LOG.info("----------------------------------------------------"); } }
/** * Tests running a script with unknown language. */ @Test public void testRunScriptFailUnknownLanguage() { // run test only in case operation is supported if (ConnectorHelper.operationsSupported(getConnectorFacade(), getAPIOperations())) { try { getConnectorFacade().runScriptOnConnector( new ScriptContext("NONEXISTING LANGUAGE", "script", new HashMap<>()), null); fail("Script language is not supported, should throw an exception."); } catch (RuntimeException ex) { // expected } } else { LOG.info("----------------------------------------------------"); LOG.info("Skipping test ''testRunScriptFailUnknownLanguage''."); LOG.info("----------------------------------------------------"); } }
/** * Tests running a script with unknown language. */ @Test public void testRunScriptFailUnknownLanguage() { // run test only in case operation is supported if (ConnectorHelper.operationsSupported(getConnectorFacade(), getAPIOperations())) { try { getConnectorFacade().runScriptOnConnector( new ScriptContext("NONEXISTING LANGUAGE", "script", new HashMap<String, Object>()), null); fail("Script language is not supported, should throw an exception."); } catch (RuntimeException ex) { // expected } } else { LOG.info("----------------------------------------------------"); LOG.info("Skipping test ''testRunScriptFailUnknownLanguage''."); LOG.info("----------------------------------------------------"); } }
/** * Tests running a script with unknown language. */ @Test public void testRunScriptFailUnknownLanguage() { // run test only in case operation is supported if (ConnectorHelper.operationsSupported(getConnectorFacade(), getAPIOperations())) { try { getConnectorFacade().runScriptOnConnector( new ScriptContext("NONEXISTING LANGUAGE", "script", new HashMap<String, Object>()), null); fail("Script language is not supported, should throw an exception."); } catch (RuntimeException ex) { // expected } } else { LOG.info("----------------------------------------------------"); LOG.info("Skipping test ''testRunScriptFailUnknownLanguage''."); LOG.info("----------------------------------------------------"); } }
if (scriptOperation.isConnectorHost()) { InternalMonitor.recordConnectorOperation("runScriptOnConnector"); output = connIdConnectorFacade.runScriptOnConnector(scriptContext, new OperationOptionsBuilder().build()); } else if (scriptOperation.isResourceHost()) { InternalMonitor.recordConnectorOperation("runScriptOnResource");
Object result = getConnectorFacade().runScriptOnConnector( new ScriptContext(language, script, arguments), getOperationOptionsByOp(ScriptOnConnectorApiOp.class));
Object result = getConnectorFacade().runScriptOnConnector( new ScriptContext(language, script, arguments), getOperationOptionsByOp(ScriptOnConnectorApiOp.class));
Object result = getConnectorFacade().runScriptOnConnector( new ScriptContext(language, script, arguments), getOperationOptionsByOp(null, ScriptOnConnectorApiOp.class));