forked from community/product-iots
parent
81a4e7c503
commit
e5df961298
@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
|
* in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.wso2.iot.integration.jmeter;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
import org.wso2.carbon.automation.engine.exceptions.AutomationFrameworkException;
|
||||||
|
import org.wso2.carbon.automation.extensions.jmeter.JMeterTest;
|
||||||
|
import org.wso2.carbon.automation.extensions.jmeter.JMeterTestManager;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JMeter Test cases for AndroidDeviceManagement API.
|
||||||
|
*/
|
||||||
|
public class AndroidDeviceManagementAPIJmeterTestCase {
|
||||||
|
private static Log log = LogFactory.getLog(AndroidDeviceManagementAPIJmeterTestCase.class);
|
||||||
|
@Test()
|
||||||
|
public void permutationTest() throws AutomationFrameworkException {
|
||||||
|
URL url = Thread.currentThread().getContextClassLoader().getResource(
|
||||||
|
"jmeter-scripts/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);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(dependsOnMethods = {"permutationTest"})
|
||||||
|
public void listServices() throws AutomationFrameworkException {
|
||||||
|
URL url = Thread.currentThread().getContextClassLoader().getResource(
|
||||||
|
"jmeter-scripts/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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,106 @@
|
|||||||
|
{
|
||||||
|
"ADVANCE_SEARCH" : {
|
||||||
|
"conditions" : [{
|
||||||
|
"key" : "deviceModel",
|
||||||
|
"value" : "S8",
|
||||||
|
"operator" : "=",
|
||||||
|
"state" : "OR"
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
"UPDATE_DEVICE_INFO": {
|
||||||
|
"id": 101234,
|
||||||
|
"name": "androiddevice1234",
|
||||||
|
"type": "android",
|
||||||
|
"description": "this is an android device",
|
||||||
|
"deviceIdentifier": "d24f870f390352a41234",
|
||||||
|
"enrolmentInfo": {
|
||||||
|
"id": 101234,
|
||||||
|
"device": {
|
||||||
|
},
|
||||||
|
"dateOfEnrolment": 0,
|
||||||
|
"dateOfLastUpdate": 0,
|
||||||
|
"ownership": "BYOD",
|
||||||
|
"status": "CREATED",
|
||||||
|
"owner": "admin"
|
||||||
|
},
|
||||||
|
"features": [
|
||||||
|
{
|
||||||
|
"id": 10,
|
||||||
|
"code": "aaaa1111",
|
||||||
|
"name": "newfeature1",
|
||||||
|
"description": "this is the new feature 1",
|
||||||
|
"deviceType": "android",
|
||||||
|
"metadataEntries": [
|
||||||
|
{
|
||||||
|
"id": 10,
|
||||||
|
"value": {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "DEVICE_MODEL",
|
||||||
|
"value": "S8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "VENDOR",
|
||||||
|
"value" : "SAMSUNG"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"deviceInfo": {
|
||||||
|
"deviceModel": "S8",
|
||||||
|
"vendor": "SAMSUNG",
|
||||||
|
"osVersion": "5.1",
|
||||||
|
"batteryLevel": 1,
|
||||||
|
"internalTotalMemory": 32,
|
||||||
|
"internalAvailableMemory": 24,
|
||||||
|
"externalTotalMemory": 64,
|
||||||
|
"externalAvailableMemory": 60,
|
||||||
|
"operator": "dialog",
|
||||||
|
"connectionType": "GSM",
|
||||||
|
"mobileSignalStrength": 1,
|
||||||
|
"ssid": "picassowifi",
|
||||||
|
"cpuUsage": 0,
|
||||||
|
"totalRAMMemory": 2,
|
||||||
|
"availableRAMMemory": 1,
|
||||||
|
"pluggedIn": false,
|
||||||
|
"location": {
|
||||||
|
"deviceId": 0,
|
||||||
|
"deviceIdentifier": {
|
||||||
|
"id": "string",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"latitude": 0,
|
||||||
|
"longitude": 0,
|
||||||
|
"street1": "string",
|
||||||
|
"street2": "string",
|
||||||
|
"city": "string",
|
||||||
|
"state": "string",
|
||||||
|
"zip": "string",
|
||||||
|
"country": "string"
|
||||||
|
},
|
||||||
|
"deviceDetailsMap": {
|
||||||
|
},
|
||||||
|
"imei": "string",
|
||||||
|
"imsi": "string"
|
||||||
|
},
|
||||||
|
"applications": [
|
||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"platform": "string",
|
||||||
|
"category": "string",
|
||||||
|
"name": "string",
|
||||||
|
"locationUrl": "string",
|
||||||
|
"imageUrl": "string",
|
||||||
|
"version": "string",
|
||||||
|
"type": "string",
|
||||||
|
"appProperties": {
|
||||||
|
},
|
||||||
|
"applicationIdentifier": "string",
|
||||||
|
"memoryUsage": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue