/** * 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().runScriptOnResource(new ScriptContext("LANGUAGE", "", new HashMap<>()), 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().runScriptOnResource( 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().runScriptOnResource( 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().runScriptOnResource( 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().runScriptOnResource( 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().runScriptOnResource( 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("----------------------------------------------------"); } }
} else if (scriptOperation.isResourceHost()) { InternalMonitor.recordConnectorOperation("runScriptOnResource"); output = connIdConnectorFacade.runScriptOnResource(scriptContext, new OperationOptionsBuilder().build());
Object result = getConnectorFacade().runScriptOnResource( new ScriptContext(language, script, arguments), getOperationOptionsByOp(ScriptOnResourceApiOp.class));
Object result = getConnectorFacade().runScriptOnResource( new ScriptContext(language, script, arguments), getOperationOptionsByOp(ScriptOnResourceApiOp.class));
Object result = getConnectorFacade().runScriptOnResource( new ScriptContext(language, script, arguments), getOperationOptionsByOp(null, ScriptOnResourceApiOp.class));