use of org.wso2.siddhi.core.function.Script in project product-iots by wso2.
the class DeviceTypeManagementJMeterTestCase method DeviceTypeManagementTest.
@Test(description = "This test case tests the Device Type/Device Management/Device Agent APIs")
public void DeviceTypeManagementTest() throws AutomationFrameworkException {
URL url = Thread.currentThread().getContextClassLoader().getResource("jmeter-scripts" + File.separator + "DeviceTypeManagementAPI.jmx");
JMeterTest script = new JMeterTest(new File(url.getPath()));
JMeterTestManager manager = new JMeterTestManager();
log.info("Running Device Type/Device Management/Device Agent management api test cases using jmeter scripts");
manager.runTest(script);
log.info("Completed DeviceType API service test using jmeter scripts");
}
use of org.wso2.siddhi.core.function.Script in project product-iots by wso2.
the class NotificationManagementAPIJMeterTestCase method NotificationManagementTest.
@Test(description = "This test case tests the Notification Management APIs")
public void NotificationManagementTest() throws AutomationFrameworkException {
URL url = Thread.currentThread().getContextClassLoader().getResource("jmeter-scripts" + File.separator + "NotificationManagementAPI.jmx");
JMeterTest script = new JMeterTest(new File(url.getPath()));
JMeterTestManager manager = new JMeterTestManager();
log.info("Running notification management api test cases using jmeter scripts");
manager.runTest(script);
}
use of org.wso2.siddhi.core.function.Script in project siddhi by wso2.
the class DefinitionParserHelper method addFunction.
public static void addFunction(SiddhiAppContext siddhiAppContext, final FunctionDefinition functionDefinition) {
Extension extension = new Extension() {
@Override
public String getNamespace() {
return "script";
}
@Override
public String getName() {
return functionDefinition.getLanguage().toLowerCase();
}
};
try {
Script script = (Script) SiddhiClassLoader.loadExtensionImplementation(extension, ScriptExtensionHolder.getInstance(siddhiAppContext));
ConfigReader configReader = siddhiAppContext.getSiddhiContext().getConfigManager().generateConfigReader(extension.getNamespace(), extension.getName());
script.setReturnType(functionDefinition.getReturnType());
script.init(functionDefinition.getId(), functionDefinition.getBody(), configReader);
siddhiAppContext.getScriptFunctionMap().put(functionDefinition.getId(), script);
} catch (Throwable t) {
ExceptionUtil.populateQueryContext(t, functionDefinition, siddhiAppContext);
throw t;
}
}
use of org.wso2.siddhi.core.function.Script in project carbon-business-process by wso2.
the class ActivitiEngineBuilder method buildEngine.
/* Instantiates the engine. Builds the state of the engine
*
* @return ProcessEngineImpl object
* @throws BPSFault Throws in the event of failure of ProcessEngine
*/
public ProcessEngine buildEngine() throws BPSFault {
try {
String carbonConfigDirPath = CarbonUtils.getCarbonConfigDirPath();
String activitiConfigPath = carbonConfigDirPath + File.separator + BPMNConstants.ACTIVITI_CONFIGURATION_FILE_NAME;
File activitiConfigFile = new File(activitiConfigPath);
ProcessEngineConfigurationImpl processEngineConfigurationImpl = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration.createProcessEngineConfigurationFromInputStream(new FileInputStream(activitiConfigFile));
// Add script engine resolvers
setResolverFactories(processEngineConfigurationImpl);
// Add supported variable types
setSupportedVariableTypes(processEngineConfigurationImpl);
// we have to build the process engine first to initialize session factories.
processEngine = processEngineConfigurationImpl.buildProcessEngine();
processEngineConfigurationImpl.getSessionFactories().put(UserIdentityManager.class, new BPSUserManagerFactory());
processEngineConfigurationImpl.getSessionFactories().put(GroupIdentityManager.class, new BPSGroupManagerFactory());
dataSourceJndiName = processEngineConfigurationImpl.getProcessEngineConfiguration().getDataSourceJndiName();
} catch (FileNotFoundException e) {
String msg = "Failed to create an Activiti engine. Activiti configuration file not found";
throw new BPSFault(msg, e);
}
return processEngine;
}
use of org.wso2.siddhi.core.function.Script in project product-iots by wso2.
the class AndroidDeviceManagementAPIJmeterTestCase method listServices.
@Test(description = "Testing the basic android device management API calls", dependsOnMethods = { "permutationTest" })
public void listServices() throws AutomationFrameworkException {
URL url = Thread.currentThread().getContextClassLoader().getResource("jmeter-scripts" + File.separator + "NewAndroidDeviceManagementAPI.jmx");
JMeterTest script = new JMeterTest(new File(url.getPath()));
JMeterTestManager manager = new JMeterTestManager();
log.info("Running API service test using jmeter scripts");
manager.runTest(script);
}
Aggregations