Merge branch 'wso2-master' into test-merge

application-manager-new
sinthuja 8 years ago
commit 9d866509bd

@ -168,6 +168,35 @@
</replacements> </replacements>
</configuration> </configuration>
</execution> </execution>
<!-- Replace the purge config in the analytics-co.xml file -->
<execution>
<id>replace-for-analytics-config</id>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<file>${basedir}/../p2-profile/analytics-profile/target/wso2carbon-core-${carbon.kernel.version}/wso2/conf/analytics/analytics-config.xml</file>
<replacements>
<replacement>
<xpath>/analytics-dataservice-configuration/analytics-data-purging/purging-enable</xpath>
<token>(false)</token>
<value>true</value>
</replacement>
<replacement>
<xpath>/analytics-dataservice-configuration/analytics-data-purging/purge-include-tables/table</xpath>
<token>(.\*)</token>
<value>IOT_PER_DEVICE_STREAM.*</value>
</replacement>
<replacement>
<xpath>/analytics-dataservice-configuration/analytics-data-purging/data-retention-days</xpath>
<token>(365)</token>
<value>31</value>
</replacement>
</replacements>
</configuration>
</execution>
</executions> </executions>
</plugin> </plugin>

@ -28,7 +28,7 @@
<property key="url">tcp://${mqtt.broker.host}:${mqtt.broker.port}</property> <property key="url">tcp://${mqtt.broker.host}:${mqtt.broker.port}</property>
<property key="username">admin</property> <property key="username">admin</property>
<property key="password">admin</property> <property key="password">admin</property>
<property key="contentValidator">iot-mqtt</property> <property key="contentValidator">deviceid-topic-content-validator</property>
<property key="cleanSession">true</property> <property key="cleanSession">true</property>
</adapterConfig>]]></value> </adapterConfig>]]></value>
</add> </add>

@ -86,6 +86,9 @@ log4j.logger.org.spark-project=WARN
log4j.logger.akka=WARN log4j.logger.akka=WARN
log4j.logger.org.apache.spark.util.ClosureCleaner=ERROR log4j.logger.org.apache.spark.util.ClosureCleaner=ERROR
# uncomment the following logs to see http calls headers and messages
#log4j.logger.feign=DEBUG
log4j.additivity.org.apache.axis2.clustering=false log4j.additivity.org.apache.axis2.clustering=false
log4j.additivity.com.atomikos=false log4j.additivity.com.atomikos=false
log4j.additivity.org.apache=false log4j.additivity.org.apache=false

@ -252,7 +252,9 @@
<exclude>**/synapse-configs/**</exclude> <exclude>**/synapse-configs/**</exclude>
<exclude>**/web-apps/**</exclude> <exclude>**/web-apps/**</exclude>
<exclude>**/appm-tenant-conf.xml</exclude> <exclude>**/appm-tenant-conf.xml</exclude>
<exclude>**/client-truststore.jks</exclude>
</excludes> </excludes>
</fileSet> </fileSet>
<fileSet> <fileSet>
@ -322,6 +324,9 @@
</directory> </directory>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/resources <outputDirectory>${pom.artifactId}-${pom.version}/repository/resources
</outputDirectory> </outputDirectory>
<excludes>
<exclude>**/client-truststore.jks</exclude>
</excludes>
</fileSet> </fileSet>
<!-- Copying device type deployer files --> <!-- Copying device type deployer files -->
@ -685,6 +690,7 @@
<exclude>**/LICENSE.txt</exclude> <exclude>**/LICENSE.txt</exclude>
<exclude>**/release-notes.html</exclude> <exclude>**/release-notes.html</exclude>
<exclude>**/webapp-mode/WEB-INF/web.xml</exclude> <exclude>**/webapp-mode/WEB-INF/web.xml</exclude>
<exclude>**/repository/resources/security/client-truststore.jks</exclude>
</excludes> </excludes>
</fileSet> </fileSet>
@ -967,6 +973,7 @@
<exclude>**/LICENSE.txt</exclude> <exclude>**/LICENSE.txt</exclude>
<exclude>**/release-notes.html</exclude> <exclude>**/release-notes.html</exclude>
<exclude>**/dbscripts</exclude> <exclude>**/dbscripts</exclude>
<exclude>**/repository/resources/security/client-truststore.jks</exclude>
</excludes> </excludes>
</fileSet> </fileSet>
@ -1906,5 +1913,23 @@
<fileMode>644</fileMode> <fileMode>644</fileMode>
</file> </file>
<!-- ********************************* End of Broker Profile ********************************* --> <!-- ********************************* End of Broker Profile ********************************* -->
<!--Start - Need to remove after kernel 4.4.17 release-->
<file>
<source>src/core/resources/security/client-truststore.jks</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/resources/security</outputDirectory>
<fileMode>644</fileMode>
</file>
<file>
<source>src/core/resources/security/client-truststore.jks</source>
<outputDirectory>${pom.artifactId}-${pom.version}/wso2/analytics/repository/resources/security</outputDirectory>
<fileMode>644</fileMode>
</file>
<file>
<source>src/core/resources/security/client-truststore.jks</source>
<outputDirectory>${pom.artifactId}-${pom.version}/wso2/broker/repository/resources/security</outputDirectory>
<fileMode>644</fileMode>
</file>
<!--End-->
</files> </files>
</assembly> </assembly>

@ -21,7 +21,7 @@ product.key=IoT
product.version=3.1.0-SNAPSHOT product.version=3.1.0-SNAPSHOT
product.doc.version=310 product.doc.version=310
carbon.version=4.4.14 carbon.version=4.4.16
default.server.role=IoTServer default.server.role=IoTServer
cep.server.role=ComplexEventProcessor cep.server.role=ComplexEventProcessor
das.server.role=DataAnalyticsServer das.server.role=DataAnalyticsServer

@ -43,7 +43,7 @@ This file is ciphertool compliant. Refer PRODUCT_HOME/repository/conf/security/c
<clusterNotificationTimeout>10</clusterNotificationTimeout> <clusterNotificationTimeout>10</clusterNotificationTimeout>
<!-- Configurations related RDBMS based coordination algorithm --> <!-- Configurations related RDBMS based coordination algorithm -->
<rdbmsBasedCoordination enabled="false"> <rdbmsBasedCoordination enabled="true">
<!-- Heartbeat interval used in the RDBMS base coordination algorithm in milliseconds --> <!-- Heartbeat interval used in the RDBMS base coordination algorithm in milliseconds -->
<heartbeatInterval>5000</heartbeatInterval> <heartbeatInterval>5000</heartbeatInterval>
@ -58,7 +58,7 @@ This file is ciphertool compliant. Refer PRODUCT_HOME/repository/conf/security/c
<!-- Enabling this will make the cluster notifications such as Queue changes(additions and deletions), <!-- Enabling this will make the cluster notifications such as Queue changes(additions and deletions),
Subscription changes, etc. sent within the cluster be synchronized using RDBMS. If set to false, Hazelcast Subscription changes, etc. sent within the cluster be synchronized using RDBMS. If set to false, Hazelcast
will be used for this purpose.--> will be used for this purpose.-->
<RDBMSBasedClusterEventSynchronization enabled="false"> <rdbmsBasedClusterEventSynchronization enabled="true">
<!--Specifies the interval at which, the cluster events will be read from the database. Needs to be <!--Specifies the interval at which, the cluster events will be read from the database. Needs to be
declared in milliseconds. Setting this to a very low value could downgrade the performance where as declared in milliseconds. Setting this to a very low value could downgrade the performance where as
@ -66,7 +66,7 @@ This file is ciphertool compliant. Refer PRODUCT_HOME/repository/conf/security/c
all the nodes in a cluster.--> all the nodes in a cluster.-->
<eventSyncInterval>1000</eventSyncInterval> <eventSyncInterval>1000</eventSyncInterval>
</RDBMSBasedClusterEventSynchronization> </rdbmsBasedClusterEventSynchronization>
</coordination> </coordination>
<!-- You can enable/disable specific messaging transports in this section. By default all <!-- You can enable/disable specific messaging transports in this section. By default all
@ -95,7 +95,7 @@ This file is ciphertool compliant. Refer PRODUCT_HOME/repository/conf/security/c
<allowSharedTopicSubscriptions>false</allowSharedTopicSubscriptions> <allowSharedTopicSubscriptions>false</allowSharedTopicSubscriptions>
<allowStrictNameValidation>true</allowStrictNameValidation> <allowStrictNameValidation>true</allowStrictNameValidation>
<!-- Refer conf/advanced/qpid-config.xml for further AMQP-specific configurations.--> <!-- Refer repository/conf/advanced/qpid-config.xml for further AMQP-specific configurations.-->
</amqp> </amqp>
<mqtt enabled="true"> <mqtt enabled="true">
<bindAddress>0.0.0.0</bindAddress> <bindAddress>0.0.0.0</bindAddress>
@ -117,8 +117,7 @@ This file is ciphertool compliant. Refer PRODUCT_HOME/repository/conf/security/c
<!--All receiving events/messages will be in this ring buffer. Ring buffer size <!--All receiving events/messages will be in this ring buffer. Ring buffer size
of MQTT inbound event disruptor. Default is set to 32768 (1024 * 32) of MQTT inbound event disruptor. Default is set to 32768 (1024 * 32)
Having a large ring buffer wi Having a large ring buffer will have a increase memory usage and will improve performance
ll have a increase memory usage and will improve performance
and vise versa --> and vise versa -->
<inboundBufferSize>32768</inboundBufferSize> <inboundBufferSize>32768</inboundBufferSize>
@ -172,17 +171,7 @@ This file is ciphertool compliant. Refer PRODUCT_HOME/repository/conf/security/c
inherit from org.dna.mqtt.moquette.server.IAutherizer inherit from org.dna.mqtt.moquette.server.IAutherizer
Note: default implementation authorizes against carbon permission with the topic. Note: default implementation authorizes against carbon permission with the topic.
--> -->
<!--connectionPermission is required for a user to connect to broker
subscriberPermission is needed to subscribe(subriber permission can be more than one)
publisherPermission is needed to publish(publisher permission can be more than one)
-->
<authorizer class="org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.DeviceAccessBasedMQTTAuthorizer"> <authorizer class="org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.DeviceAccessBasedMQTTAuthorizer">
<!--<property name="connectionPermission">/permission/admin/device-mgt/user</property>-->
<!--topic subscription permissions which are assigned through grouping-->
<property name="subscriberPermission">/permission/device-mgt/user/groups/device_events</property>
<!--topic publisher permissions which are assigned through grouping-->
<property name="publisherPermission">/permission/device-mgt/user/groups/device_operation</property>
<property name="username">admin</property> <property name="username">admin</property>
<property name="password">admin</property> <property name="password">admin</property>
<property name="tokenEndpoint">https://localhost:8243</property> <property name="tokenEndpoint">https://localhost:8243</property>
@ -211,7 +200,7 @@ This file is ciphertool compliant. Refer PRODUCT_HOME/repository/conf/security/c
by pointing to the correct data source by updating the property "dataSource". by pointing to the correct data source by updating the property "dataSource".
Data source entry should be present in Data source entry should be present in
<MB_HOME>/conf/datasources/master-datasources.xml. <MB_HOME>/repository/conf/datasources/master-datasources.xml.
--> -->
<persistence> <persistence>
@ -270,10 +259,14 @@ This file is ciphertool compliant. Refer PRODUCT_HOME/repository/conf/security/c
<!--Publisher transaction related configurations.--> <!--Publisher transaction related configurations.-->
<transaction> <transaction>
<!--Maximum batch size (Messages) for a transaction. Exceeding this limit will result <!--Maximum batch size (Messages) in kilobytes for a transaction. Exceeding this limit will
in a failure in the subsequent commit request. Default is set to 10MB. Limit is result in a failure in the subsequent commit (or prepare) request. Default is set to 1MB.
calculated considering the payload of messages--> Limit is calculated considering the payload of messages.-->
<maxBatchSizeInBytes>10000000</maxBatchSizeInBytes> <maxBatchSizeInKB>10240</maxBatchSizeInKB>
<!-- Maximum number of parallel dtx enabled channel count. Distributed transaction
requests exceeding this limit will fail. -->
<maxParallelDtxChannels>20</maxParallelDtxChannels>
</transaction> </transaction>
<!-- This section allows you to tweak memory and processor allocations used by WSO2 MB. <!-- This section allows you to tweak memory and processor allocations used by WSO2 MB.
@ -282,6 +275,11 @@ This file is ciphertool compliant. Refer PRODUCT_HOME/repository/conf/security/c
<performanceTuning> <performanceTuning>
<slots> <slots>
<!--Rough estimate for size of a slot. What is meant by size is the number of messages
contained within bounties of a slot. -->
<windowSize>1000</windowSize>
<!-- <!--
If message publishers are slow, time taken to fill the slot (up to <windowSize>) will be longer. If message publishers are slow, time taken to fill the slot (up to <windowSize>) will be longer.
This will add an latency to messages. Therefore broker will mark the slot as This will add an latency to messages. Therefore broker will mark the slot as
@ -290,17 +288,27 @@ This file is ciphertool compliant. Refer PRODUCT_HOME/repository/conf/security/c
--> -->
<messageAccumulationTimeout>2000</messageAccumulationTimeout> <messageAccumulationTimeout>2000</messageAccumulationTimeout>
<!--Rough estimate for size of a slot-->
<windowSize>1000</windowSize>
<!-- Time interval which broker check for slots that can be marked as 'ready to deliver' <!-- Time interval which broker check for slots that can be marked as 'ready to deliver'
(- slots which have a aged more than 'messageAccumulationTimeout') (- slots which have a aged more than 'messageAccumulationTimeout')
NOTE: specified in milliseconds. NOTE: specified in milliseconds.
--> -->
<timerPeriod>1000</timerPeriod> <maxSubmitDelay>1000</maxSubmitDelay>
<!--Number of MessageDeliveryWorker threads that should be started-->
<deliveryThreadCount>5</deliveryThreadCount>
<!--Number of SlotDeliveryWorker threads that should be started--> <!-- Number of parallel threads to execute slot deletion task. Increasing this value will remove slots
<workerThreadCount>5</workerThreadCount> whose messages are read/delivered to consumers/acknowledged faster reducing heap memory used by
server.-->
<deleteThreadCount>5</deleteThreadCount>
<!-- Max number of pending message count to delete per Slot Deleting Task. This config is used to raise
a WARN when pending scheduled number of slots exceeds this limit (indicate of an issue that can lead to
message accumulation on server.-->
<SlotDeleteQueueDepthWarningThreshold>1000</SlotDeleteQueueDepthWarningThreshold>
<!-- Maximum number of thrift client connections that should be created in the thrift connection pool -->
<thriftClientPoolSize>10</thriftClientPoolSize>
</slots> </slots>
@ -521,11 +529,6 @@ This file is ciphertool compliant. Refer PRODUCT_HOME/repository/conf/security/c
</bufferBased> </bufferBased>
</flowControl> </flowControl>
<slotManagement>
<!--Set slot storage mode (RDBMS/HazelCast)-->
<storage>RDBMS</storage>
</slotManagement>
<!-- <!--
Message broker keeps track of all messages it has received as groups. These groups are termed Message broker keeps track of all messages it has received as groups. These groups are termed
'Slots' (To know more information about Slots and message broker install please refer to online wiki). 'Slots' (To know more information about Slots and message broker install please refer to online wiki).

@ -144,6 +144,9 @@ log4j.appender.CARBON_MEMORY.layout.TenantPattern=%U%@%D [%T] [%S]
log4j.appender.CARBON_MEMORY.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace log4j.appender.CARBON_MEMORY.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace
log4j.appender.CARBON_MEMORY.threshold=DEBUG log4j.appender.CARBON_MEMORY.threshold=DEBUG
# uncomment the following logs to see http calls headers and messages
#log4j.logger.feign=DEBUG
# CARBON_LOGFILE is set to be a DailyRollingFileAppender using a PatternLayout. # CARBON_LOGFILE is set to be a DailyRollingFileAppender using a PatternLayout.
log4j.appender.CARBON_LOGFILE=org.apache.log4j.DailyRollingFileAppender log4j.appender.CARBON_LOGFILE=org.apache.log4j.DailyRollingFileAppender
# Log file will be overridden by the configuration setting in the DB # Log file will be overridden by the configuration setting in the DB

@ -36,9 +36,7 @@
</ProvisioningConnectorConfigs> </ProvisioningConnectorConfigs>
<!--<DefaultProvisioningConnectorConfig></DefaultProvisioningConnectorConfig>--> <!--<DefaultProvisioningConnectorConfig></DefaultProvisioningConnectorConfig>-->
<ClaimConfig></ClaimConfig> <ClaimConfig></ClaimConfig>
<Certificate> <Certificate>MIIDSTCCAjGgAwIBAgIERUubMzANBgkqhkiG9w0BAQsFADBVMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxDTALBgNVBAoTBFdTTzIxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xNzAzMjEwOTEzMDdaFw0xNzA2MTkwOTEzMDdaMFUxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzENMAsGA1UEChMEV1NPMjESMBAGA1UEAxMJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu8lfLCQV2hbiz8OGA8baKI1E1cgE/QLKefa4Od2G2KextaAwSESr5ICakVX8w6tU5+IhKYQQKt9U3/U0ae9tXf04g6iWh0dRllsr9mOgjSZxQK09/ygUsFH8syL5aD3heRUYzJWZ/KOsd57BXuI2QZnuEjN0g0+5jNvnswfwD/tM01totaJpI3xN+2JZsaBRCc0G5yA/pdW83Aa4IE30EL57wkK7u8YDl3UTcmi+HO74XQmK1VEqSnA+/mFo3M16cRlm2PTZ2Z1E5gd4j+5sV1P5v63uqyFniEU0zPXforBb06pgSBoIRQBintSSDyEmyuVzW0pc2eYC5Dhfgk337QIDAQABoyEwHzAdBgNVHQ4EFgQU4lneZCvKn04NH5DtJItdRXdXankwDQYJKoZIhvcNAQELBQADggEBAEnCNr0JEcAxtF/ypwGgFu1rYOv3i02PB4jDWbFj8s58l1zF1tMr480khVX4d3AmLjsUpvV+Jg83JFIk1rJFLEb48EFv0nJ/G7pTQrCypNKozyuyLzx5UvKNFBMmnGvkHVqt6j4MSiOjnRdlo7ofDluA/umSkSf/VmsOIZ+5610pCJpahnPUkb8GYK0HcwNV2NLU/0X4nSjKjGwWYv0tX8XW8RwJKb/r0GDehA8PESi76XOVrpXSjP9WPK8XaK//8B0SH3hm0xpzmSQYgtkNQwP2MqBe/ZEUuKxrn3pP6oxo9RxeSIQ8dTLiBA/mcsBmAlpQPPi0LqqDKpkyHt8Ar2w=</Certificate>
MIICNTCCAZ6gAwIBAgIES343gjANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxDTALBgNVBAoMBFdTTzIxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xMDAyMTkwNzAyMjZaFw0zNTAyMTMwNzAyMjZaMFUxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTEWMBQGA1UEBwwNTW91bnRhaW4gVmlldzENMAsGA1UECgwEV1NPMjESMBAGA1UEAwwJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCUp/oV1vWc8/TkQSiAvTousMzOM4asB2iltr2QKozni5aVFu818MpOLZIr8LMnTzWllJvvaA5RAAdpbECb+48FjbBe0hseUdN5HpwvnH/DW8ZccGvk53I6Orq7hLCv1ZHtuOCokghz/ATrhyPq+QktMfXnRS4HrKGJTzxaCcU7OQIDAQABoxIwEDAOBgNVHQ8BAf8EBAMCBPAwDQYJKoZIhvcNAQEFBQADgYEAW5wPR7cr1LAdq+IrR44iQlRG5ITCZXY9hI0PygLP2rHANh+PYfTmxbuOnykNGyhM6FjFLbW2uZHQTY1jMrPprjOrmyK5sjJRO4d1DeGHT/YnIjs9JogRKv4XHECwLtIVdAbIdWHEtVZJyMSktcyysFcvuhPQK8Qc/E/Wq8uHSCo=
</Certificate>
<PermissionAndRoleConfig></PermissionAndRoleConfig> <PermissionAndRoleConfig></PermissionAndRoleConfig>
<JustInTimeProvisioningConfig></JustInTimeProvisioningConfig> <JustInTimeProvisioningConfig></JustInTimeProvisioningConfig>
</IdentityProvider> </IdentityProvider>

@ -29,7 +29,7 @@
<property key="url">tcp://${mqtt.broker.host}:${mqtt.broker.port}</property> <property key="url">tcp://${mqtt.broker.host}:${mqtt.broker.port}</property>
<property key="username">admin</property> <property key="username">admin</property>
<property key="password">admin</property> <property key="password">admin</property>
<property key="contentValidator">iot-mqtt</property> <property key="contentValidator">deviceid-topic-content-validator</property>
<property key="cleanSession">true</property> <property key="cleanSession">true</property>
</adapterConfig>]]></value> </adapterConfig>]]></value>
</add> </add>

@ -28,15 +28,6 @@
<Authenticator name="SignedJWTAuthenticator" disabled="false"> <Authenticator name="SignedJWTAuthenticator" disabled="false">
<Priority>5</Priority> <Priority>5</Priority>
</Authenticator> </Authenticator>
<Authenticator name="OAuthAuthenticator" disabled="true">
<Priority>10</Priority>
<Config>
<Parameter name="isRemote">false</Parameter>
<Parameter name="hostURL">https://localhost:9443</Parameter>
<Parameter name="adminUsername">admin</Parameter>
<Parameter name="adminPassword">admin</Parameter>
</Config>
</Authenticator>
<!-- authenticator Configurations for TokenUIAuthenticator --> <!-- authenticator Configurations for TokenUIAuthenticator -->
<Authenticator name="TokenUIAuthenticator" disabled="false"> <Authenticator name="TokenUIAuthenticator" disabled="false">

@ -0,0 +1,13 @@
ALTER TABLE DM_DEVICE_TYPE ADD COLUMN LAST_UPDATED_TIMESTAMP TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE DM_DEVICE_TYPE ADD COLUMN DEVICE_TYPE_META VARCHAR(20000) DEFAULT NULL;
ALTER TABLE DM_ENROLMENT_OP_MAPPING ADD COLUMN PUSH_NOTIFICATION_STATUS VARCHAR(50) NULL;
UPDATE DM_ENROLMENT_OP_MAPPING SET PUSH_NOTIFICATION_STATUS = 'COMPLETED';
ALTER TABLE DM_CONFIG_OPERATION ADD COLUMN ENABLED BOOLEAN NOT NULL DEFAULT FALSE;
CREATE TABLE IF NOT EXISTS DM_DEVICE_PROPERTIES (
DEVICE_TYPE_NAME VARCHAR(300) NOT NULL,
DEVICE_IDENTIFICATION VARCHAR(300) NOT NULL,
PROPERTY_NAME VARCHAR(100) DEFAULT 0,
PROPERTY_VALUE VARCHAR(100) DEFAULT NULL,
TENANT_ID VARCHAR(100) DEFAULT NULL,
PRIMARY KEY (DEVICE_TYPE_NAME, DEVICE_IDENTIFICATION, PROPERTY_NAME, TENANT_ID)
);

@ -0,0 +1,13 @@
ALTER TABLE DM_DEVICE_TYPE ADD COLUMN LAST_UPDATED_TIMESTAMP TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE DM_DEVICE_TYPE ADD COLUMN DEVICE_TYPE_META VARCHAR(20000) DEFAULT NULL;
ALTER TABLE DM_ENROLMENT_OP_MAPPING ADD COLUMN PUSH_NOTIFICATION_STATUS VARCHAR(50) NULL;
UPDATE DM_ENROLMENT_OP_MAPPING SET PUSH_NOTIFICATION_STATUS = 'COMPLETED';
ALTER TABLE DM_CONFIG_OPERATION ADD COLUMN ENABLED BOOLEAN NOT NULL DEFAULT FALSE;
CREATE TABLE IF NOT EXISTS DM_DEVICE_PROPERTIES (
DEVICE_TYPE_NAME VARCHAR(300) NOT NULL,
DEVICE_IDENTIFICATION VARCHAR(300) NOT NULL,
PROPERTY_NAME VARCHAR(100) DEFAULT 0,
PROPERTY_VALUE VARCHAR(100) DEFAULT NULL,
TENANT_ID VARCHAR(100) DEFAULT NULL,
PRIMARY KEY (DEVICE_TYPE_NAME, DEVICE_IDENTIFICATION, PROPERTY_NAME, TENANT_ID)
)ENGINE = InnoDB;

@ -20,7 +20,7 @@
<eventReceiver name="connected_cup_receiver" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventreceiver"> <eventReceiver name="connected_cup_receiver" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventreceiver">
<from eventAdapterType="oauth-mqtt"> <from eventAdapterType="oauth-mqtt">
<property name="topic">carbon.super/connectedcup/#</property> <property name="topic">carbon.super/connectedcup/#</property>
<property name="contentValidator">iot-mqtt</property> <property name="contentValidator">deviceid-topic-content-validator</property>
<property name="contentTransformer">default</property> <property name="contentTransformer">default</property>
<property name="cleanSession">true</property> <property name="cleanSession">true</property>
</from> </from>

@ -66,67 +66,110 @@ public final class Constants {
+ "perm:android:disenroll perm:android:update-application perm:android:unlock-devices " + "perm:android:disenroll perm:android:update-application perm:android:unlock-devices "
+ "perm:android:control-camera perm:android:reboot perm:android:logcat appm:read appm:subscribe " + "perm:android:control-camera perm:android:reboot perm:android:logcat appm:read appm:subscribe "
+ "perm:sign-csr perm:admin:devices:view perm:roles:add perm:roles:add-users perm:roles:update " + "perm:sign-csr perm:admin:devices:view perm:roles:add perm:roles:add-users perm:roles:update "
+ "perm:roles:permissions perm:roles:details perm:roles:view perm:roles:create-combined-role perm:roles:delete " +
"perm:roles:permissions perm:roles:details perm:roles:view perm:roles:create-combined-role " +
"perm:roles:delete "
+ "perm:dashboard:vulnerabilities perm:dashboard:non-compliant-count perm:dashboard:non-compliant " + "perm:dashboard:vulnerabilities perm:dashboard:non-compliant-count perm:dashboard:non-compliant "
+ "perm:dashboard:by-groups perm:dashboard:device-counts perm:dashboard:feature-non-compliant " + "perm:dashboard:by-groups perm:dashboard:device-counts perm:dashboard:feature-non-compliant "
+ "perm:dashboard:count-overview perm:dashboard:filtered-count perm:dashboard:details perm:get-activity " +
+ "perm:devices:delete perm:devices:applications perm:devices:effective-policy perm:devices:compliance-data " "perm:dashboard:count-overview perm:dashboard:filtered-count perm:dashboard:details perm:get-activity "
+ "perm:devices:features perm:devices:operations perm:devices:search perm:devices:details perm:devices:update " +
"perm:devices:delete perm:devices:applications perm:devices:effective-policy " +
"perm:devices:compliance-data "
+
"perm:devices:features perm:devices:operations perm:devices:search perm:devices:details " +
"perm:devices:update "
+ "perm:devices:view perm:view-configuration perm:manage-configuration perm:policies:remove " + "perm:devices:view perm:view-configuration perm:manage-configuration perm:policies:remove "
+ "perm:policies:priorities perm:policies:deactivate perm:policies:get-policy-details perm:policies:manage " +
"perm:policies:priorities perm:policies:deactivate perm:policies:get-policy-details " +
"perm:policies:manage "
+ "perm:policies:activate perm:policies:update perm:policies:changes perm:policies:get-details " + "perm:policies:activate perm:policies:update perm:policies:changes perm:policies:get-details "
+ "perm:users:add perm:users:details perm:users:count perm:users:delete perm:users:roles perm:users:user-details " +
+ "perm:users:credentials perm:users:search perm:users:is-exist perm:users:update perm:users:send-invitation " "perm:users:add perm:users:details perm:users:count perm:users:delete perm:users:roles " +
"perm:users:user-details "
+
"perm:users:credentials perm:users:search perm:users:is-exist perm:users:update " +
"perm:users:send-invitation "
+ "perm:admin-users:view perm:groups:devices perm:groups:update perm:groups:add perm:groups:device " + "perm:admin-users:view perm:groups:devices perm:groups:update perm:groups:add perm:groups:device "
+ "perm:groups:devices-count perm:groups:remove perm:groups:groups perm:groups:groups-view perm:groups:share " +
+ "perm:groups:count perm:groups:roles perm:groups:devices-remove perm:groups:devices-add perm:groups:assign " "perm:groups:devices-count perm:groups:remove perm:groups:groups perm:groups:groups-view " +
+ "perm:device-types:features perm:device-types:types perm:applications:install perm:applications:uninstall " "perm:groups:share "
+ "perm:admin-groups:count perm:admin-groups:view perm:notifications:mark-checked perm:notifications:view " +
"perm:groups:count perm:groups:roles perm:groups:devices-remove perm:groups:devices-add " +
"perm:groups:assign "
+
"perm:device-types:features perm:device-types:types perm:applications:install " +
"perm:applications:uninstall "
+
"perm:admin-groups:count perm:admin-groups:view perm:notifications:mark-checked " +
"perm:notifications:view "
+ "perm:admin:certificates:delete perm:admin:certificates:details perm:admin:certificates:view " + "perm:admin:certificates:delete perm:admin:certificates:details perm:admin:certificates:view "
+ "perm:admin:certificates:add perm:admin:certificates:verify perm:ios:enroll perm:ios:view-device " + "perm:admin:certificates:add perm:admin:certificates:verify perm:ios:enroll perm:ios:view-device "
+ "perm:ios:apn perm:ios:ldap perm:ios:enterprise-app perm:ios:store-application perm:ios:remove-application " +
"perm:ios:apn perm:ios:ldap perm:ios:enterprise-app perm:ios:store-application " +
"perm:ios:remove-application "
+ "perm:ios:app-list perm:ios:profile-list perm:ios:lock perm:ios:enterprise-wipe perm:ios:device-info " + "perm:ios:app-list perm:ios:profile-list perm:ios:lock perm:ios:enterprise-wipe perm:ios:device-info "
+ "perm:ios:restriction perm:ios:email perm:ios:cellular perm:ios:applications perm:ios:wifi perm:ios:ring " +
"perm:ios:restriction perm:ios:email perm:ios:cellular perm:ios:applications perm:ios:wifi " +
"perm:ios:ring "
+ "perm:ios:location perm:ios:notification perm:ios:airplay perm:ios:caldav perm:ios:cal-subscription " + "perm:ios:location perm:ios:notification perm:ios:airplay perm:ios:caldav perm:ios:cal-subscription "
+ "perm:ios:passcode-policy perm:ios:webclip perm:ios:vpn perm:ios:per-app-vpn perm:ios:app-to-per-app-vpn " +
"perm:ios:passcode-policy perm:ios:webclip perm:ios:vpn perm:ios:per-app-vpn " +
"perm:ios:app-to-per-app-vpn "
+ "perm:ios:app-lock perm:ios:clear-passcode perm:ios:remove-profile perm:ios:get-restrictions " + "perm:ios:app-lock perm:ios:clear-passcode perm:ios:remove-profile perm:ios:get-restrictions "
+ "perm:ios:wipe-data perm:admin perm:android:applications perm:devicetype:deployment " + "perm:ios:wipe-data perm:admin perm:android:applications perm:devicetype:deployment "
+ "perm:android-sense:enroll perm:firealarm:enroll"; + "perm:android-sense:enroll perm:admin:device-type perm:device-types:events "
+ "perm:device-types:events:view perm:device-types:types perm:device:enroll perm:device:disenroll "
+
"perm:device:modify perm:device:operations perm:device:publish-event perm:devices:operations " +
"perm:devices:operations perm:firealarm:enroll ";
public static final String OAUTH_TOKEN_PAYLOAD = "username=admin&password=admin" + public static final String OAUTH_TOKEN_PAYLOAD = "username=admin&password=admin" +
MULTI_TENANT_OAUTH_TOKEN_PAYLOAD; MULTI_TENANT_OAUTH_TOKEN_PAYLOAD;
private static StringBuffer dynamicClientPayloadBuffer = new StringBuffer(); private static StringBuffer dynamicClientPayloadBuffer = new StringBuffer();
public static final String API_APP_REGISTRATION_PAYLOAD = dynamicClientPayloadBuffer.append("{ \n" public static final String API_APP_REGISTRATION_PAYLOAD = dynamicClientPayloadBuffer.append("{ \n"
+ " \"applicationName\":\"app_123456\",\n" + " \"isAllowedToAllDomains\":false,\n" +
+ " \"tags\":[\"android\", \"device_management\"],\n" + " \"isMappingAnExistingOAuthApp\":false\n" " \"applicationName\":\"app_123456\",\n" +
+ "}").toString(); " \"isAllowedToAllDomains\":false,\n"
public static final String PERMISSION_LIST = "appm:read appm:subscribe perm:admin-groups:count " +
+ "perm:admin-groups:view perm:admin-users:view perm:admin:certificates:add perm:admin:certificates:delete " " \"tags\":[\"android\", \"device_management\"],\n" +
+ "perm:admin:certificates:details perm:admin:certificates:verify perm:admin:certificates:view " " \"isMappingAnExistingOAuthApp\":false\n"
+ "perm:admin:devices:view perm:android-sense:enroll perm:android:applications " + "}")
+ "perm:android:blacklist-applications perm:android:change-lock-code perm:android:clear-password " .toString();
+ "perm:android:configure-vpn perm:android:configure-wifi perm:android:control-camera " public static final String PERMISSION_LIST =
+ "perm:android:disenroll perm:android:encrypt-storage " "appm:read appm:subscribe perm:admin-groups:count perm:admin-groups:view perm:admin-users:view " +
+ "perm:android:enroll perm:android:enterprise-wipe perm:android:info perm:android:install-application " "perm:admin:certificates:add perm:admin:certificates:delete perm:admin:certificates:details " +
+ "perm:android:location perm:android:lock-devices perm:android:logcat perm:android:manage-configuration " "perm:admin:certificates:verify perm:admin:certificates:view perm:admin:device-type " +
+ "perm:android:mute perm:android:reboot perm:android:ring perm:android:send-notification " "perm:admin:devices:view perm:android-sense:enroll perm:android:applications " +
+ "perm:android:set-password-policy perm:android:set-webclip perm:android:uninstall-application " "perm:android:blacklist-applications perm:android:change-lock-code " +
+ "perm:android:unlock-devices perm:android:update-application perm:android:upgrade-firmware " "perm:android:clear-password perm:android:configure-vpn perm:android:configure-wifi " +
+ "perm:android:view-configuration perm:android:wipe perm:applications:install perm:applications:uninstall " "perm:android:control-camera perm:android:disenroll perm:android:encrypt-storage " +
+ "perm:device-types:features perm:device-types:types perm:devices:applications " "perm:android:enroll perm:android:enterprise-wipe perm:android:info " +
+ "perm:devices:compliance-data perm:devices:delete perm:devices:details perm:devices:effective-policy " "perm:android:install-application perm:android:location perm:android:lock-devices " +
+ "perm:devices:features perm:devices:operations perm:devices:search perm:devices:update " "perm:android:logcat perm:android:manage-configuration perm:android:mute perm:android:reboot " +
+ "perm:devices:view perm:devicetype:deployment perm:firealarm:enroll perm:get-activity " "perm:android:ring perm:android:send-notification perm:android:set-password-policy " +
+ "perm:groups:add perm:groups:assign perm:groups:count perm:groups:device perm:groups:devices " "perm:android:set-webclip perm:android:uninstall-application perm:android:unlock-devices " +
+ "perm:groups:devices-add perm:groups:devices-count perm:groups:devices-remove perm:groups:groups " "perm:android:update-application perm:android:upgrade-firmware " +
+ "perm:groups:groups-view perm:groups:remove perm:groups:roles perm:groups:share perm:groups:update " "perm:android:view-configuration perm:android:wipe perm:applications:install " +
+ "perm:manage-configuration perm:notifications:mark-checked perm:notifications:view perm:policies:activate " "perm:applications:uninstall perm:device-types:events perm:device-types:events:view " +
+ "perm:policies:changes perm:policies:deactivate perm:policies:get-details perm:policies:get-policy-details " "perm:device-types:features perm:device-types:types perm:device:disenroll perm:device:enroll " +
+ "perm:policies:manage perm:policies:priorities perm:policies:remove perm:policies:update perm:roles:add" "perm:device:modify perm:device:operations perm:device:publish-event " +
+ " perm:roles:add-users perm:roles:create-combined-role perm:roles:delete perm:roles:details " "perm:devices:applications perm:devices:compliance-data perm:devices:delete " +
+ "perm:roles:permissions perm:roles:update perm:roles:view perm:users:add perm:users:count " "perm:devices:details perm:devices:effective-policy perm:devices:features " +
+ "perm:users:credentials perm:users:delete perm:users:details perm:users:is-exist perm:users:roles " "perm:devices:operations perm:devices:search perm:devices:update perm:devices:view " +
+ "perm:users:search perm:users:send-invitation perm:users:update perm:users:user-details perm:view-configuration"; "perm:devicetype:deployment perm:firealarm:enroll perm:get-activity perm:groups:add " +
"perm:groups:assign perm:groups:count perm:groups:device perm:groups:devices " +
"perm:groups:devices-add perm:groups:devices-count perm:groups:devices-remove " +
"perm:groups:groups perm:groups:groups-view perm:groups:remove perm:groups:roles " +
"perm:groups:share perm:groups:update perm:manage-configuration " +
"perm:notifications:mark-checked perm:notifications:view perm:policies:activate " +
"perm:policies:changes perm:policies:deactivate perm:policies:get-details " +
"perm:policies:get-policy-details perm:policies:manage perm:policies:priorities " +
"perm:policies:remove perm:policies:update perm:roles:add perm:roles:add-users " +
"perm:roles:create-combined-role perm:roles:delete perm:roles:details perm:roles:permissions " +
"perm:roles:update perm:roles:view perm:users:add perm:users:count perm:users:credentials " +
"perm:users:delete perm:users:details perm:users:is-exist perm:users:roles perm:users:search " +
"perm:users:send-invitation perm:users:update perm:users:user-details perm:view-configuration";
private APIApplicationRegistration() { private APIApplicationRegistration() {
throw new AssertionError(); throw new AssertionError();
@ -141,6 +184,7 @@ public final class Constants {
public static final String UPDATE_APPLICATION_METHOD = "UPDATE_APPLICATIONS"; public static final String UPDATE_APPLICATION_METHOD = "UPDATE_APPLICATIONS";
public static final String ANDROID_DEVICE_TYPE = "android"; public static final String ANDROID_DEVICE_TYPE = "android";
public static final String GET_PENDING_OPERATIONS_METHOD = "GET_PENDING_OPERATIONS"; public static final String GET_PENDING_OPERATIONS_METHOD = "GET_PENDING_OPERATIONS";
private AndroidEnrollment() { private AndroidEnrollment() {
throw new AssertionError(); throw new AssertionError();
} }
@ -171,7 +215,8 @@ public final class Constants {
"windows" + File.separator + "enrollment" + File.separator + "ms_xcep.xml"; "windows" + File.separator + "enrollment" + File.separator + "ms_xcep.xml";
public static final String WS_STEP_FILE = public static final String WS_STEP_FILE =
"windows" + File.separator + "enrollment" + File.separator + "wstep.xml"; "windows" + File.separator + "enrollment" + File.separator + "wstep.xml";
public static final String BSD_PAYLOAD = "{\"credentials\" : {\"username\" : \"admin\", \"email\" : \"admin@wso2.com\", " + public static final String BSD_PAYLOAD =
"{\"credentials\" : {\"username\" : \"admin\", \"email\" : \"admin@wso2.com\", " +
"\"password\" : \"admin\", \"ownership\" : \"BYOD\", " + "\"password\" : \"admin\", \"ownership\" : \"BYOD\", " +
"\"token\" : \"cbe53efd46ec612c456540f8dfef5428\"}}"; "\"token\" : \"cbe53efd46ec612c456540f8dfef5428\"}}";
@ -347,6 +392,7 @@ public final class Constants {
public static final String USER_RESPONSE_PAYLOAD_FILE_NAME = "user-response-payloads.json"; public static final String USER_RESPONSE_PAYLOAD_FILE_NAME = "user-response-payloads.json";
public static final String GET_ROLES_METHOD = "GET_ROLES"; public static final String GET_ROLES_METHOD = "GET_ROLES";
public static final String RESET_PASSWORD_PAYLOAD = "RESET_PASSWORD"; public static final String RESET_PASSWORD_PAYLOAD = "RESET_PASSWORD";
private UserManagement() { private UserManagement() {
throw new AssertionError(); throw new AssertionError();
} }
@ -360,6 +406,7 @@ public final class Constants {
public static final String ROLE_RESPONSE_PAYLOAD_FILE_NAME = "role-response-payloads.json"; public static final String ROLE_RESPONSE_PAYLOAD_FILE_NAME = "role-response-payloads.json";
public static final String GET_FILTERED_ROLED_METHOD = "GET_FILTERED_ROLES"; public static final String GET_FILTERED_ROLED_METHOD = "GET_FILTERED_ROLES";
public static final String UPDATE_ROLES_METHOD = "UPDATE_USERS"; public static final String UPDATE_ROLES_METHOD = "UPDATE_USERS";
private RoleManagement() { private RoleManagement() {
throw new AssertionError(); throw new AssertionError();
} }
@ -427,11 +474,13 @@ public final class Constants {
public static final class AndroidSenseEnrollment { public static final class AndroidSenseEnrollment {
public static final String ENROLLMENT_ENDPOINT = "/android_sense/1.0.0/device/"; public static final String ENROLLMENT_ENDPOINT = "/android_sense/1.0.0/device/";
public static final String RETRIEVER_ENDPOINT = "analytics/tables/"; public static final String RETRIEVER_ENDPOINT = "analytics/tables/";
public static final String ANALYTICS_ARTIFACTS_DEPLOYMENT_ENDPOINT = "/api/device-mgt/v1.0/admin/devicetype/1.0.0/deploy/android_sense"; public static final String ANALYTICS_ARTIFACTS_DEPLOYMENT_ENDPOINT =
"/api/device-mgt/v1.0/admin/publish-artifact/1.0.0/deploy/android_sense";
public static final String ENROLLMENT_PAYLOAD_FILE_NAME = "android-sense-enrollment-payloads.json"; public static final String ENROLLMENT_PAYLOAD_FILE_NAME = "android-sense-enrollment-payloads.json";
public static final String PUBLISH_DATA_OPERATION = "PUBLISH_DATA"; public static final String PUBLISH_DATA_OPERATION = "PUBLISH_DATA";
public static final String BATTERY_STATS_TABLE_NAME = "ORG_WSO2_IOT_ANDROID_BATTERY_STATS"; public static final String BATTERY_STATS_TABLE_NAME = "ORG_WSO2_IOT_ANDROID_BATTERY_STATS";
public static final String IS_TABLE_EXIST_CHECK_URL = "analytics/table_exists"; public static final String IS_TABLE_EXIST_CHECK_URL = "analytics/table_exists";
private AndroidSenseEnrollment() { private AndroidSenseEnrollment() {
throw new AssertionError(); throw new AssertionError();
} }
@ -450,7 +499,7 @@ public final class Constants {
public static final String STATS_ENDPOINT = "/virtual_firealarm/1.0.0/device/stats"; public static final String STATS_ENDPOINT = "/virtual_firealarm/1.0.0/device/stats";
public static final String PAYLOAD_FILE = "virtual-fire-alarm-enrollment-payloads.json"; public static final String PAYLOAD_FILE = "virtual-fire-alarm-enrollment-payloads.json";
public static final String ANALYTICS_ARTIFACTS_DEPLOYMENT_ENDPOINT = public static final String ANALYTICS_ARTIFACTS_DEPLOYMENT_ENDPOINT =
"/api/device-mgt/v1.0/admin/devicetype/1.0.0/deploy/virtual_firealarm"; "/api/device-mgt/v1.0/admin/publish-artifact/1.0.0/deploy/virtual_firealarm";
public static final String POLICY_DATA = "POLICY_DATA"; public static final String POLICY_DATA = "POLICY_DATA";
public static final String ACTIVATE_POLICY_ENDPOINT = "/api/device-mgt/v1.0/policies/activate-policy"; public static final String ACTIVATE_POLICY_ENDPOINT = "/api/device-mgt/v1.0/policies/activate-policy";
public static final String APPLY_CHANGES_ENDPOINT = "/api/device-mgt/v1.0/policies/apply-changes"; public static final String APPLY_CHANGES_ENDPOINT = "/api/device-mgt/v1.0/policies/apply-changes";

@ -75,17 +75,15 @@ public class AndroidSenseEnrollment extends TestBase {
HttpResponse response = client HttpResponse response = client
.post(Constants.AndroidSenseEnrollment.ANALYTICS_ARTIFACTS_DEPLOYMENT_ENDPOINT, ""); .post(Constants.AndroidSenseEnrollment.ANALYTICS_ARTIFACTS_DEPLOYMENT_ENDPOINT, "");
Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode()); Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
// Time for deploying the carbon apps
Thread.sleep(30000);
} }
} }
@Test(description = "Test an Android sense device enrollment.") @Test(description = "Test an Android sense device enrollment.")
public void testEnrollment() throws Exception { public void testEnrollment() throws Exception {
HttpResponse response = client.post(Constants.AndroidSenseEnrollment.ENROLLMENT_ENDPOINT + DEVICE_ID
+ "/register?deviceName=android_sense_test", "");
// Time for deploying the carbon apps // Time for deploying the carbon apps
Thread.sleep(30000); Thread.sleep(30000);
HttpResponse response = client.post(Constants.AndroidSenseEnrollment.ENROLLMENT_ENDPOINT + DEVICE_ID
+ "/register?deviceName=android_sense_test", "");
Assert.assertEquals(HttpStatus.SC_OK, response.getResponseCode()); Assert.assertEquals(HttpStatus.SC_OK, response.getResponseCode());
JsonElement jsonElement = new JsonParser().parse(response.getData()); JsonElement jsonElement = new JsonParser().parse(response.getData());
JsonObject expectedPayloadObject = jsonElement.getAsJsonObject(); JsonObject expectedPayloadObject = jsonElement.getAsJsonObject();
@ -96,8 +94,7 @@ public class AndroidSenseEnrollment extends TestBase {
} }
@Test(description = "Test an Android sense device data publishing.", dependsOnMethods = {"testEnrollment"}, @Test(description = "Test an Android sense device data publishing.", dependsOnMethods = {"testEnrollment"})
groups = {"androidSense"})
public void testEventPublishing() throws Exception { public void testEventPublishing() throws Exception {
String DEVICE_TYPE = "android_sense"; String DEVICE_TYPE = "android_sense";
String topic = automationContext.getContextTenant().getDomain() + "/" + DEVICE_TYPE + "/" + DEVICE_ID + "/data"; String topic = automationContext.getContextTenant().getDomain() + "/" + DEVICE_TYPE + "/" + DEVICE_ID + "/data";
@ -118,17 +115,20 @@ public class AndroidSenseEnrollment extends TestBase {
.getJsonArray(Constants.AndroidSenseEnrollment.ENROLLMENT_PAYLOAD_FILE_NAME, .getJsonArray(Constants.AndroidSenseEnrollment.ENROLLMENT_PAYLOAD_FILE_NAME,
Constants.AndroidSenseEnrollment.PUBLISH_DATA_OPERATION).toString().getBytes()); Constants.AndroidSenseEnrollment.PUBLISH_DATA_OPERATION).toString().getBytes());
message.setQos(qos); message.setQos(qos);
for (int i = 0; i< 100 ; i++) {
sampleClient.publish(topic, message); sampleClient.publish(topic, message);
log.info("Message is published to Mqtt Client"); log.info("Message is published to Mqtt Client");
Thread.sleep(30000); Thread.sleep(1000);
}
sampleClient.disconnect();
HttpResponse response = analyticsClient HttpResponse response = analyticsClient
.get(Constants.AndroidSenseEnrollment.IS_TABLE_EXIST_CHECK_URL + "?table=" .get(Constants.AndroidSenseEnrollment.IS_TABLE_EXIST_CHECK_URL + "?table="
+ Constants.AndroidSenseEnrollment.BATTERY_STATS_TABLE_NAME); + Constants.AndroidSenseEnrollment.BATTERY_STATS_TABLE_NAME);
Assert.assertEquals("ORG_WSO2_IOT_ANDROID_BATTERY_STATS table does not exist. Problem with the android sense " Assert.assertEquals("ORG_WSO2_IOT_ANDROID_BATTERY_STATS table does not exist. Problem with the android sense "
+ "analytics", HttpStatus.SC_OK, response.getResponseCode()); + "analytics", HttpStatus.SC_OK, response.getResponseCode());
// Allow some time to perform the analytics tasks. // Allow some time to perform the analytics tasks.
Thread.sleep(30000);
sampleClient.disconnect();
log.info("Mqtt Client is Disconnected"); log.info("Mqtt Client is Disconnected");
String url = Constants.AndroidSenseEnrollment.RETRIEVER_ENDPOINT String url = Constants.AndroidSenseEnrollment.RETRIEVER_ENDPOINT
@ -137,11 +137,12 @@ public class AndroidSenseEnrollment extends TestBase {
url += timestamp.getTime() + "/" + new Timestamp(System.currentTimeMillis()).getTime() + "/0/100"; url += timestamp.getTime() + "/" + new Timestamp(System.currentTimeMillis()).getTime() + "/0/100";
response = analyticsClient.get(url); response = analyticsClient.get(url);
JsonArray jsonArray = new JsonParser().parse(response.getData()).getAsJsonArray(); JsonArray jsonArray = new JsonParser().parse(response.getData()).getAsJsonArray();
Assert.assertEquals( //TODO: temporarily commenting out untill new changes are merged
"Published event for the device with the id " + DEVICE_ID + " is not inserted to analytics table", // Assert.assertEquals(
HttpStatus.SC_OK, response.getResponseCode()); // "Published event for the device with the id " + DEVICE_ID + " is not inserted to analytics table",
Assert.assertEquals( // HttpStatus.SC_OK, response.getResponseCode());
"Published event for the device with the id " + DEVICE_ID + " is not inserted to analytics table", 1, // Assert.assertTrue(
jsonArray.size()); // "Published event for the device with the id " + DEVICE_ID + " is not inserted to analytics table",
// jsonArray.size() > 0);
} }
} }

@ -0,0 +1,128 @@
/*
* 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 com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.JsonPrimitive;
import junit.framework.Assert;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Factory;
import org.testng.annotations.Test;
import org.wso2.carbon.automation.engine.context.TestUserMode;
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 org.wso2.carbon.automation.test.utils.http.client.HttpResponse;
import org.wso2.iot.integration.common.Constants;
import org.wso2.iot.integration.common.MqttSubscriberClient;
import org.wso2.iot.integration.common.PayloadGenerator;
import org.wso2.iot.integration.common.RestClient;
import org.wso2.iot.integration.common.TestBase;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
/**
* This test case is used to run the jmeter test cases related with DeviceType Management APIs.
*/
public class DeviceTypeManagementJMeterTestCase extends TestBase {
private static Log log = LogFactory.getLog(DeviceTypeManagementJMeterTestCase.class);
private String broker = "tcp://localhost:1886";
private RestClient restClient;
@BeforeClass(alwaysRun = true)
public void initTest() throws Exception {
super.init(TestUserMode.SUPER_TENANT_ADMIN);
restClient = new RestClient(backendHTTPSURL, Constants.APPLICATION_JSON, accessTokenString);
}
@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");
}
@Test(description = "Test whether the policy publishing from the server to device works", dependsOnMethods =
{"DeviceTypeManagementTest"} )
public void testMqttFlow() throws Exception {
String deviceId = "123422578912";
String deviceType = "firealarmmqtt";
String payload = "{\"deviceIdentifiers\":[123422578912],\"operation\":{\"code\":\"ring\",\"type\":\"CONFIG\"," +
"\"payLoad\":\"volume:30%\"}}";
String topic = automationContext.getContextTenant().getDomain() + "/"+deviceType+"/" + deviceId + "/operation/#";
String clientId = deviceId + ":firealarmmqtt";
MqttSubscriberClient mqttDeviceSubscriberClient = new MqttSubscriberClient(broker, clientId, topic, accessToken);
restClient.post("/api/device-mgt/v1.0/devices/" + deviceType + "/operations", payload);
// Allow some time for message delivery
Thread.sleep(10000);
ArrayList<MqttMessage> mqttMessages = mqttDeviceSubscriberClient.getMqttMessages();
Assert.assertEquals("listener did not recieve mqtt messages ", 1, mqttMessages.size());
String topicPub = automationContext.getContextTenant().getDomain() + "/"+deviceType+"/"+deviceId+"/events";
int qos = 2;
String clientIdPub = deviceId + ":firealarmmqttpub";
MemoryPersistence persistence = new MemoryPersistence();
MqttClient sampleClient = new MqttClient(broker, clientIdPub, persistence);
MqttConnectOptions connOpts = new MqttConnectOptions();
connOpts.setUserName(accessToken);
connOpts.setPassword("".toCharArray());
connOpts.setKeepAliveInterval(120);
connOpts.setCleanSession(false);
log.info("Connecting to broker: " + broker);
sampleClient.connect(connOpts);
log.info("Connected");
for (int i = 0; i < 100; i++) {
payload = "{\"temperature\":%d,\"status\":\"workingh\",\"humidity\":20}";
MqttMessage message = new MqttMessage(String.format(payload, i).getBytes());
message.setQos(qos);
sampleClient.publish(topicPub, message);
log.info("Message is published to Mqtt Client");
Thread.sleep(1000);
}
sampleClient.disconnect();
log.info("Mqtt Client is Disconnected");
// Allow some time for message delivery
HttpResponse response = restClient.get("/api/device-mgt/v1.0/events/last-known/" + deviceType + "/" + deviceId);
Assert.assertEquals("No published event found (mqtt)", HttpStatus.SC_OK,
response.getResponseCode());
log.error(response.getData());
JsonElement jsonElement = new JsonParser().parse(response.getData()).getAsJsonObject().get("count");
int count = jsonElement.getAsInt();
Assert.assertTrue("Event count does not match published event count, " + response.getData(),
count > 0);
}
}

@ -20,6 +20,8 @@ package org.wso2.iot.integration.mobileDevice;
import junit.framework.Assert; import junit.framework.Assert;
import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeSuite; import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Factory; import org.testng.annotations.Factory;
@ -37,6 +39,8 @@ import java.util.concurrent.TimeUnit;
* This class contains integration tests for API Mobile Device Management with No Devices Enrolled. * This class contains integration tests for API Mobile Device Management with No Devices Enrolled.
*/ */
public class MobileDeviceManagementWithNoDevices extends TestBase { public class MobileDeviceManagementWithNoDevices extends TestBase {
private static Log log = LogFactory.getLog(MobileDeviceManagementWithNoDevices.class);
private IOTHttpClient client; private IOTHttpClient client;
@Factory(dataProvider = "userModeProvider") @Factory(dataProvider = "userModeProvider")
@ -80,6 +84,7 @@ public class MobileDeviceManagementWithNoDevices extends TestBase {
private boolean checkScopes(String permissionsList) throws Exception { private boolean checkScopes(String permissionsList) throws Exception {
String tokenString = OAuthUtil.getScopes(backendHTTPSURL, backendHTTPSURL); String tokenString = OAuthUtil.getScopes(backendHTTPSURL, backendHTTPSURL);
log.info("issued-scopes: " + tokenString);
return tokenString.contains(permissionsList); return tokenString.contains(permissionsList);
} }
} }

@ -70,13 +70,13 @@ public class VirtualFireAlarmTestCase extends TestBase {
HttpResponse response = restClient HttpResponse response = restClient
.post(Constants.VirtualFireAlarmConstants.ANALYTICS_ARTIFACTS_DEPLOYMENT_ENDPOINT, ""); .post(Constants.VirtualFireAlarmConstants.ANALYTICS_ARTIFACTS_DEPLOYMENT_ENDPOINT, "");
Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode()); Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
// Time for deploying the carbon apps
Thread.sleep(30000);
} }
} }
@Test(description = "This test case tests the virtual fire alarm enrollment") @Test(description = "This test case tests the virtual fire alarm enrollment")
public void testEnrollment() throws Exception { public void testEnrollment() throws Exception {
// Time for deploying the carbon apps
Thread.sleep(30000);
RestClient client = new RestClient(backendHTTPSURL, Constants.APPLICATION_ZIP, accessTokenString); RestClient client = new RestClient(backendHTTPSURL, Constants.APPLICATION_ZIP, accessTokenString);
// Enroll an advanced agent and check whether that enrollment succeeds without issues. // Enroll an advanced agent and check whether that enrollment succeeds without issues.
HttpResponse response = client.get(Constants.VirtualFireAlarmConstants.ENROLLMENT_ENDPOINT HttpResponse response = client.get(Constants.VirtualFireAlarmConstants.ENROLLMENT_ENDPOINT
@ -130,9 +130,13 @@ public class VirtualFireAlarmTestCase extends TestBase {
metaDataPayload.addProperty("deviceId", deviceId1); metaDataPayload.addProperty("deviceId", deviceId1);
eventPayload.add("metaData", metaDataPayload); eventPayload.add("metaData", metaDataPayload);
fireAlarmPayload.add("event", eventPayload); fireAlarmPayload.add("event", eventPayload);
MqttMessage message = new MqttMessage(fireAlarmPayload.toString().getBytes()); MqttMessage message;
for (int i = 0; i < 100; i++) {
message = new MqttMessage(fireAlarmPayload.toString().getBytes());
message.setQos(qos); message.setQos(qos);
sampleClient.publish(topic, message); sampleClient.publish(topic, message);
Thread.sleep(1000);
}
log.info("Message is published to Mqtt Client"); log.info("Message is published to Mqtt Client");
sampleClient.disconnect(); sampleClient.disconnect();
log.info("Mqtt Client is Disconnected"); log.info("Mqtt Client is Disconnected");
@ -153,15 +157,19 @@ public class VirtualFireAlarmTestCase extends TestBase {
log.info("Connected"); log.info("Connected");
fireAlarmPayload = PayloadGenerator.getJsonPayload(Constants.VirtualFireAlarmConstants fireAlarmPayload = PayloadGenerator.getJsonPayload(Constants.VirtualFireAlarmConstants
.PAYLOAD_FILE, Constants.AndroidSenseEnrollment.PUBLISH_DATA_OPERATION); .PAYLOAD_FILE,
Constants.AndroidSenseEnrollment.PUBLISH_DATA_OPERATION);
eventPayload = fireAlarmPayload.getAsJsonObject("event"); eventPayload = fireAlarmPayload.getAsJsonObject("event");
metaDataPayload = eventPayload.getAsJsonObject("metaData"); metaDataPayload = eventPayload.getAsJsonObject("metaData");
metaDataPayload.addProperty("deviceId", deviceId2); metaDataPayload.addProperty("deviceId", deviceId2);
eventPayload.add("metaData", metaDataPayload); eventPayload.add("metaData", metaDataPayload);
fireAlarmPayload.add("event", eventPayload); fireAlarmPayload.add("event", eventPayload);
for (int i = 0; i < 100; i++) {
message = new MqttMessage(fireAlarmPayload.toString().getBytes()); message = new MqttMessage(fireAlarmPayload.toString().getBytes());
message.setQos(qos); message.setQos(qos);
sampleClient.publish(topic, message); sampleClient.publish(topic, message);
Thread.sleep(1000);
}
log.info("Message is published to Mqtt Client"); log.info("Message is published to Mqtt Client");
sampleClient.disconnect(); sampleClient.disconnect();
log.info("Mqtt Client is Disconnected"); log.info("Mqtt Client is Disconnected");
@ -169,10 +177,10 @@ public class VirtualFireAlarmTestCase extends TestBase {
} }
@Test(description = "Test whether the policy publishing from the server to device works", dependsOnMethods = @Test(description = "Test whether the policy publishing from the server to device works", dependsOnMethods =
{"testEnrollment"} ) {"testEventPublishing"} )
public void testPolicyPublishing() throws Exception { public void testPolicyPublishing() throws Exception {
String deviceId2 = userMode == TestUserMode.TENANT_ADMIN ? tenantDeviceId2 : VirtualFireAlarmTestCase.deviceId2; String deviceId2 = userMode == TestUserMode.TENANT_ADMIN ? tenantDeviceId2 : VirtualFireAlarmTestCase.deviceId2;
String topic = automationContext.getContextTenant().getDomain() + "/" + DEVICE_TYPE + "/" + deviceId2 + "/#"; String topic = automationContext.getContextTenant().getDomain() + "/" + DEVICE_TYPE + "/" + deviceId2 + "/operation/#";
String clientId = deviceId2 + ":" + DEVICE_TYPE; String clientId = deviceId2 + ":" + DEVICE_TYPE;
HttpResponse response = restClient.post("/api/device-mgt/v1.0/policies", PayloadGenerator HttpResponse response = restClient.post("/api/device-mgt/v1.0/policies", PayloadGenerator
.getJsonPayload(Constants.VirtualFireAlarmConstants.PAYLOAD_FILE, .getJsonPayload(Constants.VirtualFireAlarmConstants.PAYLOAD_FILE,
@ -194,8 +202,48 @@ public class VirtualFireAlarmTestCase extends TestBase {
// Allow some time for message delivery // Allow some time for message delivery
Thread.sleep(20000); Thread.sleep(20000);
ArrayList<MqttMessage> mqttMessages = mqttSubscriberClient.getMqttMessages(); ArrayList<MqttMessage> mqttMessages = mqttSubscriberClient.getMqttMessages();
Assert.assertEquals("Policy published message is not received by the mqtt listener. ", 1, mqttMessages.size()); Assert.assertEquals("Policy published message is not received by the mqtt listener. ", 2, mqttMessages.size());
}
// Test case related to virtual fire alarm added here as the batch cron runs for every 5 minutes and rather than
// waiting for that we can check them in a latter test cases
@Test(description = "Test whether data that is published is stored in analytics event table", dependsOnMethods =
{"testPolicyPublishing"} )
public void testBatchDataPersistence() throws Exception {
String deviceId1 =
this.userMode == TestUserMode.TENANT_ADMIN ? tenantDeviceId1 : VirtualFireAlarmTestCase.deviceId1;
String deviceId2 =
this.userMode == TestUserMode.TENANT_ADMIN ? tenantDeviceId2 : VirtualFireAlarmTestCase.deviceId2;
long MilliSecondDifference = System.currentTimeMillis() - VirtualFireAlarmTestCase.currentTime;
if (MilliSecondDifference < 300000) {
Thread.sleep(300000 - MilliSecondDifference);
}
String url = Constants.VirtualFireAlarmConstants.STATS_ENDPOINT + "/" + deviceId1;
url += "?from=" + (VirtualFireAlarmTestCase.currentTime - 300000)/1000 + "&to=" + System.currentTimeMillis()
/1000;
HttpResponse response = restClient.get(url);
// TODO:Need to verify this testcase
// JsonArray jsonArray = new JsonParser().parse(response.getData()).getAsJsonArray();
// Assert.assertEquals(
// "Published event for the device with the id " + deviceId1 + " is not inserted to "
// + "analytics table", HttpStatus.SC_OK, response.getResponseCode());
// Assert.assertTrue(
// "Published event for the device with the id " + deviceId1 + " is not inserted to analytics table",
// jsonArray.size() > 0);
//
// url = Constants.VirtualFireAlarmConstants.STATS_ENDPOINT + "/" + deviceId2;
// url += "?from=" + (VirtualFireAlarmTestCase.currentTime - 300000)/1000 + "&to=" + System.currentTimeMillis()
// /1000;
// response = restClient.get(url);
// log.info("PAYLOADXX : " + response.getData());
// jsonArray = new JsonParser().parse(response.getData()).getAsJsonArray();
// Assert.assertEquals(
// "Published event for the device with the id " + deviceId2 + " is not inserted to "
// + "analytics table", HttpStatus.SC_OK, response.getResponseCode());
// Assert.assertTrue(
// "Published event for the device with the id " + deviceId2 + " is not inserted to analytics table",
// jsonArray.size() > 0);
} }
} }

@ -166,47 +166,8 @@ public class UserManagement extends TestBase {
Assert.assertEquals(HttpStatus.SC_OK, response.getResponseCode()); Assert.assertEquals(HttpStatus.SC_OK, response.getResponseCode());
} }
// Test case related to virtual fire alarm added here as the batch cron runs for every 5 minutes and rather than
// waiting for that we can check them in a latter test cases
@Test(description = "Test whether data that is published is stored in analytics event table", dependsOnMethods =
{"testRemoveUser"} )
public void testBatchDataPersistence() throws Exception {
String deviceId1 =
this.userMode == TestUserMode.TENANT_ADMIN ? tenantDeviceId1 : VirtualFireAlarmTestCase.deviceId1;
String deviceId2 =
this.userMode == TestUserMode.TENANT_ADMIN ? tenantDeviceId2 : VirtualFireAlarmTestCase.deviceId2;
long MilliSecondDifference = System.currentTimeMillis() - VirtualFireAlarmTestCase.currentTime;
if (MilliSecondDifference < 300000) {
Thread.sleep(300000 - MilliSecondDifference);
}
String url = Constants.VirtualFireAlarmConstants.STATS_ENDPOINT + "/" + deviceId1;
url += "?from=" + (VirtualFireAlarmTestCase.currentTime - 300000)/1000 + "&to=" + System.currentTimeMillis()
/1000;
HttpResponse response = client.get(url);
JsonArray jsonArray = new JsonParser().parse(response.getData()).getAsJsonArray();
Assert.assertEquals(
"Published event for the device with the id " + deviceId1 + " is not inserted to "
+ "analytics table", HttpStatus.SC_OK, response.getResponseCode());
Assert.assertEquals(
"Published event for the device with the id " + deviceId1 + " is not inserted to analytics table", 1,
jsonArray.size());
url = Constants.VirtualFireAlarmConstants.STATS_ENDPOINT + "/" + deviceId2;
url += "?from=" + (VirtualFireAlarmTestCase.currentTime - 300000)/1000 + "&to=" + System.currentTimeMillis()
/1000;
response = client.get(url);
jsonArray = new JsonParser().parse(response.getData()).getAsJsonArray();
Assert.assertEquals(
"Published event for the device with the id " + deviceId2 + " is not inserted to "
+ "analytics table", HttpStatus.SC_OK, response.getResponseCode());
Assert.assertEquals(
"Published event for the device with the id " + deviceId2 + " is not inserted to analytics table", 1,
jsonArray.size());
}
@Test(description = "Test whether the API that is used to change the password works as expected.", @Test(description = "Test whether the API that is used to change the password works as expected.",
dependsOnMethods = {"testBatchDataPersistence"}) dependsOnMethods = {"testRemoveUser"})
public void testChangePassword() throws Exception { public void testChangePassword() throws Exception {
String url = Constants.UserManagement.USER_ENDPOINT + "/credentials"; String url = Constants.UserManagement.USER_ENDPOINT + "/credentials";
HttpResponse response = client.put(url, PayloadGenerator HttpResponse response = client.put(url, PayloadGenerator

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.9" jmeter="3.0 r1743807"> <jmeterTestPlan version="1.2" properties="2.8" jmeter="2.13 r1665067">
<hashTree> <hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Android Device Management API" enabled="true"> <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Android Device Management API" enabled="true">
<stringProp name="TestPlan.comments"></stringProp> <stringProp name="TestPlan.comments"></stringProp>
@ -304,6 +304,7 @@
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage> <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave> <assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes> <bytes>true</bytes>
<threadCounts>true</threadCounts>
</value> </value>
</objProp> </objProp>
<stringProp name="filename">/home/ace/Desktop/results_multi_user_multi_tenancy.jtl</stringProp> <stringProp name="filename">/home/ace/Desktop/results_multi_user_multi_tenancy.jtl</stringProp>
@ -2127,73 +2128,6 @@ GEL4ZNjZ+jnwSkzwBU5vh/QS&quot;,&#xd;
</HeaderManager> </HeaderManager>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Android Device Management - PUT Pending Operations" enabled="true">
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
<collectionProp name="Arguments.arguments">
<elementProp name="" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">[&#xd;
{&#xd;
&quot;code&quot;: &quot;aaa&quot;,&#xd;
&quot;properties&quot;: {},&#xd;
&quot;type&quot;: &quot;CONFIG&quot;,&#xd;
&quot;id&quot;: 0,&#xd;
&quot;status&quot;: &quot;IN_PROGRESS&quot;,&#xd;
&quot;control&quot;: &quot;REPEAT&quot;,&#xd;
&quot;receivedTimeStamp&quot;: &quot;string&quot;,&#xd;
&quot;createdTimeStamp&quot;: &quot;string&quot;,&#xd;
&quot;payLoad&quot;: {},&#xd;
&quot;operationResponse&quot;: &quot;string&quot;,&#xd;
&quot;activityId&quot;: &quot;string&quot;,&#xd;
&quot;responses&quot;: [&#xd;
{&#xd;
&quot;response&quot;: &quot;string&quot;,&#xd;
&quot;receivedTimeStamp&quot;: &quot;string&quot;&#xd;
}&#xd;
],&#xd;
&quot;enabled&quot;: false&#xd;
}&#xd;
]</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.domain">${host}</stringProp>
<stringProp name="HTTPSampler.port">${https_port}</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding">UTF-8</stringProp>
<stringProp name="HTTPSampler.path">/api/device-mgt/android/v1.0/devices/d24f870f390352a41000${DeviceID}/pending-operations</stringProp>
<stringProp name="HTTPSampler.method">PUT</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
<boolProp name="HTTPSampler.monitor">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
</HTTPSamplerProxy>
<hashTree>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
<collectionProp name="HeaderManager.headers">
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Authorization</stringProp>
<stringProp name="Header.value">Bearer ${access_token}</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Content-Type</stringProp>
<stringProp name="Header.value">application/json</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Accept</stringProp>
<stringProp name="Header.value">application/json</stringProp>
</elementProp>
</collectionProp>
</HeaderManager>
<hashTree/>
</hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Android Device Management - GET Status" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Android Device Management - GET Status" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/> <collectionProp name="Arguments.arguments"/>
@ -6400,73 +6334,6 @@ GEL4ZNjZ+jnwSkzwBU5vh/QS&quot;,&#xd;
</HeaderManager> </HeaderManager>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Android Device Management - PUT Pending Operations" enabled="true">
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
<collectionProp name="Arguments.arguments">
<elementProp name="" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">[&#xd;
{&#xd;
&quot;code&quot;: &quot;aaa&quot;,&#xd;
&quot;properties&quot;: {},&#xd;
&quot;type&quot;: &quot;CONFIG&quot;,&#xd;
&quot;id&quot;: 0,&#xd;
&quot;status&quot;: &quot;IN_PROGRESS&quot;,&#xd;
&quot;control&quot;: &quot;REPEAT&quot;,&#xd;
&quot;receivedTimeStamp&quot;: &quot;string&quot;,&#xd;
&quot;createdTimeStamp&quot;: &quot;string&quot;,&#xd;
&quot;payLoad&quot;: {},&#xd;
&quot;operationResponse&quot;: &quot;string&quot;,&#xd;
&quot;activityId&quot;: &quot;string&quot;,&#xd;
&quot;responses&quot;: [&#xd;
{&#xd;
&quot;response&quot;: &quot;string&quot;,&#xd;
&quot;receivedTimeStamp&quot;: &quot;string&quot;&#xd;
}&#xd;
],&#xd;
&quot;enabled&quot;: false&#xd;
}&#xd;
]</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.domain">${host}</stringProp>
<stringProp name="HTTPSampler.port">${https_port}</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding">UTF-8</stringProp>
<stringProp name="HTTPSampler.path">/api/device-mgt/android/v1.0/devices/d24f870f390352a41000${DeviceID}/pending-operations</stringProp>
<stringProp name="HTTPSampler.method">PUT</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
<boolProp name="HTTPSampler.monitor">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
</HTTPSamplerProxy>
<hashTree>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
<collectionProp name="HeaderManager.headers">
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Authorization</stringProp>
<stringProp name="Header.value">Bearer ${access_token}</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Content-Type</stringProp>
<stringProp name="Header.value">application/json</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Accept</stringProp>
<stringProp name="Header.value">application/json</stringProp>
</elementProp>
</collectionProp>
</HeaderManager>
<hashTree/>
</hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Android Device Management - GET Status" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Android Device Management - GET Status" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/> <collectionProp name="Arguments.arguments"/>

@ -34,7 +34,7 @@
<class name="org.wso2.iot.integration.jmeter.AndroidDeviceManagementAPIJmeterTestCase"/> <class name="org.wso2.iot.integration.jmeter.AndroidDeviceManagementAPIJmeterTestCase"/>
<class name="org.wso2.iot.integration.mobileDevice.MobileDeviceManagement"/> <class name="org.wso2.iot.integration.mobileDevice.MobileDeviceManagement"/>
<class name="org.wso2.iot.integration.jmeter.PolicyManagementJMeterTestCase"/> <class name="org.wso2.iot.integration.jmeter.PolicyManagementJMeterTestCase"/>
<class name="org.wso2.iot.integration.samples.VirtualFireAlarmTestCase"/> <class name="org.wso2.iot.integration.jmeter.DeviceTypeManagementJMeterTestCase"/>
<class name="org.wso2.iot.integration.device.enrollment.AndroidEnrollment"/> <class name="org.wso2.iot.integration.device.enrollment.AndroidEnrollment"/>
<class name="org.wso2.iot.integration.device.operation.AndroidOperation"/> <class name="org.wso2.iot.integration.device.operation.AndroidOperation"/>
<class name="org.wso2.iot.integration.device.configuration.AndroidConfigurationManagement"/> <class name="org.wso2.iot.integration.device.configuration.AndroidConfigurationManagement"/>
@ -43,8 +43,9 @@
<class name="org.wso2.iot.integration.jmeter.DeviceManagementAPINegativeTestCase"/> <class name="org.wso2.iot.integration.jmeter.DeviceManagementAPINegativeTestCase"/>
<class name="org.wso2.iot.integration.jmeter.NotificationManagementAPIJMeterTestCase"/> <class name="org.wso2.iot.integration.jmeter.NotificationManagementAPIJMeterTestCase"/>
<class name="org.wso2.iot.integration.jmeter.AppManagerJmeterTestCase"/> <class name="org.wso2.iot.integration.jmeter.AppManagerJmeterTestCase"/>
<class name="org.wso2.iot.integration.device.enrollment.AndroidSenseEnrollment"/>
<class name="org.wso2.iot.integration.samples.MobileQSGTestCase"/> <class name="org.wso2.iot.integration.samples.MobileQSGTestCase"/>
<!--<class name="org.wso2.iot.integration.device.enrollment.AndroidSenseEnrollment"/>-->
<!--<class name="org.wso2.iot.integration.samples.VirtualFireAlarmTestCase"/>-->
<class name="org.wso2.iot.integration.user.UserManagement"/> <class name="org.wso2.iot.integration.user.UserManagement"/>
</classes> </classes>
</test> </test>

@ -190,8 +190,8 @@
<extentionClasses> <extentionClasses>
<class> <class>
<name>org.wso2.carbon.iot.integration.web.ui.test.extension.BrokerServerExtension</name> <name>org.wso2.carbon.iot.integration.web.ui.test.extension.BrokerServerExtension</name>
<name>org.wso2.carbon.iot.integration.web.ui.test.extension.IOTServerExtension</name>
<name>org.wso2.carbon.iot.integration.web.ui.test.extension.AnalyticsServerExtension</name> <name>org.wso2.carbon.iot.integration.web.ui.test.extension.AnalyticsServerExtension</name>
<name>org.wso2.carbon.iot.integration.web.ui.test.extension.IOTServerExtension</name>
<name>org.wso2.carbon.integration.common.extensions.usermgt.UserPopulateExtension</name> <name>org.wso2.carbon.integration.common.extensions.usermgt.UserPopulateExtension</name>
</class> </class>
</extentionClasses> </extentionClasses>

@ -13,7 +13,7 @@
</plugins> </plugins>
<features> <features>
<feature id="org.wso2.carbon.core.runtime" version="4.4.14"/> <feature id="org.wso2.carbon.core.runtime" version="4.4.16"/>
</features> </features>
<configurations> <configurations>

@ -13,7 +13,7 @@
</plugins> </plugins>
<features> <features>
<feature id="org.wso2.carbon.core.runtime" version="4.4.14"/> <feature id="org.wso2.carbon.core.runtime" version="4.4.16"/>
</features> </features>
<configurations> <configurations>

@ -334,8 +334,7 @@
<version>${analytics.shared.version}</version> <version>${analytics.shared.version}</version>
</feature> </feature>
<feature> <feature>
<id>org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature.group <id>org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature.group</id>
</id>
<version>${carbon.device.mgt.plugin.version}</version> <version>${carbon.device.mgt.plugin.version}</version>
</feature> </feature>

@ -14,7 +14,7 @@ version="4.4.14" useFeatures="true" includeLaunchers="true">
</plugins> </plugins>
<features> <features>
<feature id="org.wso2.carbon.core.runtime" version="4.4.14"/> <feature id="org.wso2.carbon.core.runtime" version="4.4.16"/>
</features> </features>
<configurations> <configurations>

@ -161,6 +161,9 @@
<featureArtifactDef> <featureArtifactDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature:${carbon.device.mgt.version} org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature:${carbon.device.mgt.version}
</featureArtifactDef> </featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature:${carbon.device.mgt.version}
</featureArtifactDef>
<featureArtifactDef> <featureArtifactDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature:${carbon.device.mgt.version} org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature:${carbon.device.mgt.version}
</featureArtifactDef> </featureArtifactDef>
@ -185,6 +188,9 @@
<featureArtifactDef> <featureArtifactDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.androidsense.backend.feature:${carbon.device.mgt.plugin.version} org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.androidsense.backend.feature:${carbon.device.mgt.plugin.version}
</featureArtifactDef> </featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.notification.listener.feature:${carbon.device.mgt.plugin.version}
</featureArtifactDef>
<!-- End of Device Management Plugin Features --> <!-- End of Device Management Plugin Features -->
<!-- IoT Device Management Features --> <!-- IoT Device Management Features -->
@ -997,15 +1003,15 @@
<version>${carbon.device.mgt.version}</version> <version>${carbon.device.mgt.version}</version>
</feature> </feature>
<feature> <feature>
<id>org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature.group</id> <id>org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature.group</id>
<version>${carbon.device.mgt.version}</version> <version>${carbon.device.mgt.version}</version>
</feature> </feature>
<feature> <feature>
<id>org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature.group</id> <id>org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature.group</id>
<version>${carbon.device.mgt.version}</version> <version>${carbon.device.mgt.version}</version>
</feature> </feature>
<feature> <feature>
<id>org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature.group</id> <id>org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature.group</id>
<version>${carbon.device.mgt.version}</version> <version>${carbon.device.mgt.version}</version>
</feature> </feature>
<feature> <feature>
@ -1028,6 +1034,10 @@
<id>org.wso2.carbon.device.mgt.iot.androidsense.backend.feature.group</id> <id>org.wso2.carbon.device.mgt.iot.androidsense.backend.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version> <version>${carbon.device.mgt.plugin.version}</version>
</feature> </feature>
<feature>
<id>org.wso2.carbon.device.mgt.notification.listener.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<!-- End of Device Management Features --> <!-- End of Device Management Features -->
<feature> <feature>
<id>org.wso2.carbon.device.mgt.adapter.feature.group</id> <id>org.wso2.carbon.device.mgt.adapter.feature.group</id>
@ -1148,6 +1158,10 @@
<id>org.wso2.carbon.databridge.datapublisher.feature.group</id> <id>org.wso2.carbon.databridge.datapublisher.feature.group</id>
<version>${carbon.analytics.common.version}</version> <version>${carbon.analytics.common.version}</version>
</feature> </feature>
<feature>
<id>org.wso2.carbon.event.input.adapter.server.feature.group</id>
<version>${carbon.analytics.common.version}</version>
</feature>
<!-- End of Carbon Analytics Common Features --> <!-- End of Carbon Analytics Common Features -->
<feature> <feature>
@ -2038,6 +2052,10 @@
<id>org.wso2.carbon.device.mgt.mobile.windows.feature.group</id> <id>org.wso2.carbon.device.mgt.mobile.windows.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version> <version>${carbon.device.mgt.plugin.version}</version>
</feature> </feature>
<feature>
<id>org.wso2.carbon.device.mgt.notification.listener.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<feature> <feature>
<id>org.wso2.carbon.device.mgt.analytics.dashboard.feature.group</id> <id>org.wso2.carbon.device.mgt.analytics.dashboard.feature.group</id>
<version>${carbon.device.mgt.version}</version> <version>${carbon.device.mgt.version}</version>
@ -2685,6 +2703,10 @@
<id>org.wso2.carbon.device.mgt.mobile.windows.feature.group</id> <id>org.wso2.carbon.device.mgt.mobile.windows.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version> <version>${carbon.device.mgt.plugin.version}</version>
</feature> </feature>
<feature>
<id>org.wso2.carbon.device.mgt.notification.listener.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<feature> <feature>
<id>org.wso2.carbon.device.mgt.analytics.dashboard.feature.group</id> <id>org.wso2.carbon.device.mgt.analytics.dashboard.feature.group</id>
<version>${carbon.device.mgt.version}</version> <version>${carbon.device.mgt.version}</version>

@ -1440,7 +1440,7 @@
<properties> <properties>
<!--Carbon kernel versions--> <!--Carbon kernel versions-->
<carbon.kernel.version>4.4.14</carbon.kernel.version> <carbon.kernel.version>4.4.16</carbon.kernel.version>
<carbon.kernel.version.range>[4.4.0, 4.5.0)</carbon.kernel.version.range> <carbon.kernel.version.range>[4.4.0, 4.5.0)</carbon.kernel.version.range>
<carbon.ui.menu.stratos.version>2.2.0</carbon.ui.menu.stratos.version> <carbon.ui.menu.stratos.version>2.2.0</carbon.ui.menu.stratos.version>
@ -1511,7 +1511,6 @@
<carbon.governance.version>4.7.0</carbon.governance.version> <carbon.governance.version>4.7.0</carbon.governance.version>
<!-- Carbon Device Management --> <!-- Carbon Device Management -->
<carbon.device.mgt.version>3.0.8</carbon.device.mgt.version> <carbon.device.mgt.version>3.0.8</carbon.device.mgt.version>
<carbon.device.mgt.version.range>[3.0.0, 4.0.0)</carbon.device.mgt.version.range> <carbon.device.mgt.version.range>[3.0.0, 4.0.0)</carbon.device.mgt.version.range>
@ -1519,8 +1518,7 @@
<product.iot.version>3.1.0-SNAPSHOT</product.iot.version> <product.iot.version>3.1.0-SNAPSHOT</product.iot.version>
<!-- Carbon Device Management Plugins--> <!-- Carbon Device Management Plugins-->
<carbon.device.mgt.plugin.version>4.0.6</carbon.device.mgt.plugin.version>
<carbon.device.mgt.plugin.version>4.0.5</carbon.device.mgt.plugin.version>
<!-- API Management --> <!-- API Management -->
<carbon.api.mgt.version>6.1.94</carbon.api.mgt.version> <carbon.api.mgt.version>6.1.94</carbon.api.mgt.version>
@ -1551,8 +1549,8 @@
<!-- IoT Broker Dependencies --> <!-- IoT Broker Dependencies -->
<product.iot.broker.version>${product.iot.version}</product.iot.broker.version> <product.iot.broker.version>${product.iot.version}</product.iot.broker.version>
<andes.version>3.1.15</andes.version> <andes.version>3.2.19</andes.version>
<carbon.messaging.version>3.1.17</carbon.messaging.version> <carbon.messaging.version>3.2.15</carbon.messaging.version>
<!-- Third Party Dependencies--> <!-- Third Party Dependencies-->
<spongycastle.version>1.51.0.0</spongycastle.version> <spongycastle.version>1.51.0.0</spongycastle.version>

Loading…
Cancel
Save