Search in sources :

Example 1 with Script

use of org.wso2.siddhi.core.function.Script in project carbon-business-process by wso2.

the class ActivitiEngineBuilder method setResolverFactories.

/**
 * Function to register resolver factories that used by script engines and JUEL
 * @param processEngineConfiguration
 */
private void setResolverFactories(ProcessEngineConfigurationImpl processEngineConfiguration) {
    List<ResolverFactory> resolverFactories = new ArrayList<>();
    // Resolvers from Activiti
    resolverFactories.add(new VariableScopeResolverFactory());
    resolverFactories.add(new BeansResolverFactory());
    // Resolvers added for WSO2 BPS
    resolverFactories.add(new XmlAPIResolverFactory());
    resolverFactories.add(new JsonAPIResolverFactory());
    processEngineConfiguration.setResolverFactories(resolverFactories);
}
Also used : JsonAPIResolverFactory(org.wso2.carbon.bpmn.core.types.datatypes.json.JsonAPIResolverFactory) XmlAPIResolverFactory(org.wso2.carbon.bpmn.core.types.datatypes.xml.XmlAPIResolverFactory) BeansResolverFactory(org.activiti.engine.impl.scripting.BeansResolverFactory) ArrayList(java.util.ArrayList) BeansResolverFactory(org.activiti.engine.impl.scripting.BeansResolverFactory) VariableScopeResolverFactory(org.activiti.engine.impl.scripting.VariableScopeResolverFactory) JsonAPIResolverFactory(org.wso2.carbon.bpmn.core.types.datatypes.json.JsonAPIResolverFactory) XmlAPIResolverFactory(org.wso2.carbon.bpmn.core.types.datatypes.xml.XmlAPIResolverFactory) ResolverFactory(org.activiti.engine.impl.scripting.ResolverFactory) VariableScopeResolverFactory(org.activiti.engine.impl.scripting.VariableScopeResolverFactory)

Example 2 with Script

use of org.wso2.siddhi.core.function.Script in project product-iots by wso2.

the class MobileQSGTestCase method testPolicyCreation.

@Test(description = "This test case tests the policy creation through qsg script", dependsOnMethods = { "executeQSGScript" })
public void testPolicyCreation() throws Exception {
    HttpResponse response = client.get(Constants.PolicyManagement.VIEW_POLICY_LIST_ENDPOINT + "?offset=0&limit=10");
    Assert.assertEquals(response.getResponseCode(), HttpStatus.SC_OK);
    Assert.assertTrue(response.getData().contains("android-passcode-policy1"), "Android pass-code policy is not " + "added from qsg script");
    Assert.assertTrue(response.getData().contains("windows-passcode-policy1"), "Windows pass-code policy is not " + "added from qsg script");
}
Also used : HttpResponse(org.wso2.carbon.automation.test.utils.http.client.HttpResponse) Test(org.testng.annotations.Test)

Example 3 with Script

use of org.wso2.siddhi.core.function.Script in project product-iots by wso2.

the class AndroidDeviceManagementAPIJmeterTestCase method permutationTest.

@Test(description = "Testing the response when sending different input parameters with different values")
public void permutationTest() throws AutomationFrameworkException {
    URL url = Thread.currentThread().getContextClassLoader().getResource("jmeter-scripts" + File.separator + "AndroidDeviceManagementAPIAdditionalPermutations.jmx");
    JMeterTest script = new JMeterTest(new File(url.getPath()));
    JMeterTestManager manager = new JMeterTestManager();
    log.info("Running permutation test using jmeter scripts");
    manager.runTest(script);
}
Also used : JMeterTest(org.wso2.carbon.automation.extensions.jmeter.JMeterTest) File(java.io.File) URL(java.net.URL) JMeterTestManager(org.wso2.carbon.automation.extensions.jmeter.JMeterTestManager) JMeterTest(org.wso2.carbon.automation.extensions.jmeter.JMeterTest) Test(org.testng.annotations.Test)

Example 4 with Script

use of org.wso2.siddhi.core.function.Script in project product-iots by wso2.

the class PolicyManagementJMeterTestCase method PolicyManagementTest.

@Test(description = "This test case tests the Policy Management APIs")
public void PolicyManagementTest() throws AutomationFrameworkException {
    URL url = Thread.currentThread().getContextClassLoader().getResource("jmeter-scripts" + File.separator + "PolicyManagementAPI.jmx");
    JMeterTest script = new JMeterTest(new File(url.getPath()));
    JMeterTestManager manager = new JMeterTestManager();
    log.info("Running policy management api test cases using jmeter scripts");
    manager.runTest(script);
}
Also used : JMeterTest(org.wso2.carbon.automation.extensions.jmeter.JMeterTest) File(java.io.File) URL(java.net.URL) JMeterTestManager(org.wso2.carbon.automation.extensions.jmeter.JMeterTestManager) JMeterTest(org.wso2.carbon.automation.extensions.jmeter.JMeterTest) Test(org.testng.annotations.Test)

Example 5 with Script

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");
}
Also used : JMeterTest(org.wso2.carbon.automation.extensions.jmeter.JMeterTest) File(java.io.File) URL(java.net.URL) JMeterTestManager(org.wso2.carbon.automation.extensions.jmeter.JMeterTestManager) Test(org.testng.annotations.Test) JMeterTest(org.wso2.carbon.automation.extensions.jmeter.JMeterTest)

Aggregations

Test (org.testng.annotations.Test)11 ArrayList (java.util.ArrayList)10 HashMap (java.util.HashMap)10 LinkedHashMap (java.util.LinkedHashMap)10 ByteArrayInputStream (java.io.ByteArrayInputStream)9 File (java.io.File)9 InputStream (java.io.InputStream)9 ResultSet (java.sql.ResultSet)9 URITemplate (org.wso2.carbon.apimgt.api.model.URITemplate)9 URL (java.net.URL)8 PreparedStatement (java.sql.PreparedStatement)8 SQLException (java.sql.SQLException)8 JMeterTest (org.wso2.carbon.automation.extensions.jmeter.JMeterTest)8 JMeterTestManager (org.wso2.carbon.automation.extensions.jmeter.JMeterTestManager)8 Connection (java.sql.Connection)7 HashSet (java.util.HashSet)7 LinkedHashSet (java.util.LinkedHashSet)7 Scope (org.wso2.carbon.apimgt.api.model.Scope)7 Gson (com.google.gson.Gson)5 ClientCertificateDTO (org.wso2.carbon.apimgt.api.dto.ClientCertificateDTO)4