diff options
author | liamfallon <liam.fallon@ericsson.com> | 2018-11-20 15:59:50 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@ericsson.com> | 2018-11-20 16:56:18 +0000 |
commit | 1f7c861c65aa8689f11196581b8ca5e79d7e4e26 (patch) | |
tree | b48c3dc3bec93dd5e52c9a45cb84b88c61d1843f | |
parent | e8b197315437cac84872752e2ea090d8fb233941 (diff) |
Refactor Apex benchmark tests
Apex performance tests are refactored and reorganised
to be all in the one place and to be coherent.
A test REST server that can generate events in batches
is introduced and this can be configured to respond to REST
calls from Apex with various batch sizes that can be varied
for performance tests.
Actual performance tests are added for the various executors
in Apex.
Change-Id: I692b41e1e4451e821a618c64dead5cc8e9685d08
Issue-ID: POLICY-812
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
86 files changed, 4421 insertions, 7974 deletions
diff --git a/context/context-management/src/test/resources/logback-test.xml b/context/context-management/src/test/resources/logback-test.xml index 51398da38..3c12577eb 100644 --- a/context/context-management/src/test/resources/logback-test.xml +++ b/context/context-management/src/test/resources/logback-test.xml @@ -25,7 +25,7 @@ <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> <property name="LOG_DIR" value="${java.io.tmpdir}/apex_logging/" /> - <!-- USE FOR STD OUT ONLY --> + <!-- USE FOR STD OUT ONLY --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <Pattern>%d %contextName [%t] %level %logger{36} - %msg%n</Pattern> diff --git a/core/core-infrastructure/src/main/resources/logback.xml b/core/core-infrastructure/src/main/resources/logback.xml index b1d855419..ddcfb4531 100644 --- a/core/core-infrastructure/src/main/resources/logback.xml +++ b/core/core-infrastructure/src/main/resources/logback.xml @@ -25,7 +25,7 @@ <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> <property name="VAR_LOG" value="/var/log/ericsson/apex/" /> - <!-- USE FOR STD OUT ONLY --> + <!-- USE FOR STD OUT ONLY --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <Pattern>%d %contextName [%t] %level %logger{36} - %msg%n</Pattern> diff --git a/core/core-infrastructure/src/test/resources/logback-test.xml b/core/core-infrastructure/src/test/resources/logback-test.xml index 034511335..4ece82083 100644 --- a/core/core-infrastructure/src/test/resources/logback-test.xml +++ b/core/core-infrastructure/src/test/resources/logback-test.xml @@ -25,7 +25,7 @@ <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> <property name="LOG_DIR" value="${java.io.tmpdir}/apex_logging/" /> - <!-- USE FOR STD OUT ONLY --> + <!-- USE FOR STD OUT ONLY --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <Pattern>%d %contextName [%t] %level %logger{36} - %msg%n</Pattern> diff --git a/core/core-protocols/src/test/resources/logback-test.xml b/core/core-protocols/src/test/resources/logback-test.xml index 034511335..4ece82083 100644 --- a/core/core-protocols/src/test/resources/logback-test.xml +++ b/core/core-protocols/src/test/resources/logback-test.xml @@ -25,7 +25,7 @@ <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> <property name="LOG_DIR" value="${java.io.tmpdir}/apex_logging/" /> - <!-- USE FOR STD OUT ONLY --> + <!-- USE FOR STD OUT ONLY --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <Pattern>%d %contextName [%t] %level %logger{36} - %msg%n</Pattern> diff --git a/model/engine-model/src/test/resources/logback-test.xml b/model/engine-model/src/test/resources/logback-test.xml index 034511335..4ece82083 100644 --- a/model/engine-model/src/test/resources/logback-test.xml +++ b/model/engine-model/src/test/resources/logback-test.xml @@ -25,7 +25,7 @@ <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> <property name="LOG_DIR" value="${java.io.tmpdir}/apex_logging/" /> - <!-- USE FOR STD OUT ONLY --> + <!-- USE FOR STD OUT ONLY --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <Pattern>%d %contextName [%t] %level %logger{36} - %msg%n</Pattern> diff --git a/model/event-model/src/test/resources/logback-test.xml b/model/event-model/src/test/resources/logback-test.xml index dfafb04d9..96f8d2ba3 100644 --- a/model/event-model/src/test/resources/logback-test.xml +++ b/model/event-model/src/test/resources/logback-test.xml @@ -25,7 +25,7 @@ <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> <property name="LOG_DIR" value="${java.io.tmpdir}/apex_logging/" /> - <!-- USE FOR STD OUT ONLY --> + <!-- USE FOR STD OUT ONLY --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <Pattern>%d %contextName [%t] %level %logger{36} - %msg%n</Pattern> diff --git a/model/model-api/src/test/resources/logback-test.xml b/model/model-api/src/test/resources/logback-test.xml index 114b39c70..7c3609ee3 100644 --- a/model/model-api/src/test/resources/logback-test.xml +++ b/model/model-api/src/test/resources/logback-test.xml @@ -25,7 +25,7 @@ <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> <property name="LOG_DIR" value="${java.io.tmpdir}/apex_logging/" /> - <!-- USE FOR STD OUT ONLY --> + <!-- USE FOR STD OUT ONLY --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <Pattern>%d %contextName [%t] %level %logger{36} - %msg%n</Pattern> diff --git a/model/policy-model/src/test/resources/logback-test.xml b/model/policy-model/src/test/resources/logback-test.xml index 114b39c70..7c3609ee3 100644 --- a/model/policy-model/src/test/resources/logback-test.xml +++ b/model/policy-model/src/test/resources/logback-test.xml @@ -25,7 +25,7 @@ <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> <property name="LOG_DIR" value="${java.io.tmpdir}/apex_logging/" /> - <!-- USE FOR STD OUT ONLY --> + <!-- USE FOR STD OUT ONLY --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <Pattern>%d %contextName [%t] %level %logger{36} - %msg%n</Pattern> diff --git a/packages/apex-pdp-package-full/pom.xml b/packages/apex-pdp-package-full/pom.xml index e357290c3..a3ca91cc6 100644 --- a/packages/apex-pdp-package-full/pom.xml +++ b/packages/apex-pdp-package-full/pom.xml @@ -17,7 +17,8 @@ SPDX-License-Identifier: Apache-2.0 ============LICENSE_END========================================================= --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.policy.apex-pdp.packages</groupId> @@ -167,6 +168,13 @@ <artifactId>plugins-event-carrier-restrequestor</artifactId> <version>${project.version}</version> </dependency> + + <!-- Benchmark test event generator --> + <dependency> + <groupId>org.onap.policy.apex-pdp.testsuites.performance</groupId> + <artifactId>performance-benchmark-test</artifactId> + <version>${project.version}</version> + </dependency> <!-- Plugins for event protocols --> <dependency> @@ -289,6 +297,15 @@ <includes>etc/**/*,examples/**/*</includes> </artifactItem> <artifactItem> + <groupId>org.onap.policy.apex-pdp.testsuites.performance</groupId> + <artifactId>performance-benchmark-test</artifactId> + <version>${project.version}</version> + <type>jar</type> + <overWrite>false</overWrite> + <outputDirectory>${project.build.directory}</outputDirectory> + <includes>examples/**/*</includes> + </artifactItem> + <artifactItem> <groupId>org.onap.policy.apex-pdp.examples</groupId> <artifactId>examples-aadm</artifactId> <version>${project.version}</version> @@ -481,7 +498,9 @@ <phase>package</phase> <configuration> <tasks> - <untar src="${project.build.directory}/${project.artifactId}-${project.version}-tarball.tar.gz" dest="${project.build.directory}/install_hierarchy" compression="gzip" /> + <untar + src="${project.build.directory}/${project.artifactId}-${project.version}-tarball.tar.gz" + dest="${project.build.directory}/install_hierarchy" compression="gzip" /> </tasks> </configuration> <goals> diff --git a/packages/apex-pdp-package-full/src/main/package/scripts/apexApps.bat b/packages/apex-pdp-package-full/src/main/package/scripts/apexApps.bat index d5ac0532c..848498b1e 100644 --- a/packages/apex-pdp-package-full/src/main/package/scripts/apexApps.bat +++ b/packages/apex-pdp-package-full/src/main/package/scripts/apexApps.bat @@ -81,6 +81,7 @@ set APEX_APP_MAP[engine]=java -Dlogback.configurationFile=%APEX_HOME%\etc\logbac set APEX_APP_MAP[eng-deployment]=java -Dlogback.configurationFile=%APEX_HOME%\etc\logback.xml -jar %APEX_HOME%\lib\applications\client-deployment-%_VERSION%-deployment.jar set APEX_APP_MAP[eng-monitoring]=java -Dlogback.configurationFile=%APEX_HOME%\etc\logback.xml -jar %APEX_HOME%\lib\applications\client-monitoring-%_VERSION%-monitoring.jar set APEX_APP_MAP[full-client]=java -Dlogback.configurationFile=%APEX_HOME%\etc\logback.xml -jar %APEX_HOME%\lib\applications\client-full-%_VERSION%-full.jar +set APEX_APP_MAP[event-generator]=java -Dlogback.configurationFile=%APEX_HOME%\etc\logback.xml -cp %CLASSPATH% %_CONFIG% org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.EventGenerator :: array of applications with name=description :: declare -A APEX_APP_DESCR_MAP @@ -94,7 +95,7 @@ set APEX_APP_DESCR_MAP[engine]=starts the APEX engine set APEX_APP_DESCR_MAP[eng-deployment]=starts the APEX deployment client in a simple webserver set APEX_APP_DESCR_MAP[eng-monitoring]=starts the APEX engine monitoring client in a simple webserver set APEX_APP_DESCR_MAP[full-client]=starts the full APEX client (rest editor, deployment, monitoring) in a simple webserver - +set APEX_APP_DESCR_MAP["event-generator"]=starts the event generator in a simple webserver for performance testing :: no command line means help, -h means help if "%1" == "" goto Help diff --git a/packages/apex-pdp-package-full/src/main/package/scripts/apexApps.sh b/packages/apex-pdp-package-full/src/main/package/scripts/apexApps.sh index 3316e8e1c..c5569baaa 100755 --- a/packages/apex-pdp-package-full/src/main/package/scripts/apexApps.sh +++ b/packages/apex-pdp-package-full/src/main/package/scripts/apexApps.sh @@ -90,6 +90,7 @@ APEX_APP_MAP["engine"]="java -Dlogback.configurationFile=$APEX_HOME/etc/logback. APEX_APP_MAP["eng-deployment"]="java -Dlogback.configurationFile=$APEX_HOME/etc/logback.xml -jar $APEX_HOME/lib/applications/client-deployment-$_version-deployment.jar" APEX_APP_MAP["eng-monitoring"]="java -Dlogback.configurationFile=$APEX_HOME/etc/logback.xml -jar $APEX_HOME/lib/applications/client-monitoring-$_version-monitoring.jar" APEX_APP_MAP["full-client"]="java -Dlogback.configurationFile=$APEX_HOME/etc/logback.xml -jar $APEX_HOME/lib/applications/client-full-$_version-full.jar" +APEX_APP_MAP["event-gen"]="java -Dlogback.configurationFile=$APEX_HOME/etc/logback.xml -cp ${CLASSPATH} $_config org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.EventGenerator" ## array of applications with name=description declare -A APEX_APP_DESCR_MAP @@ -103,6 +104,7 @@ APEX_APP_DESCR_MAP["engine"]="starts the APEX engine" APEX_APP_DESCR_MAP["eng-deployment"]="starts the APEX deployment client in a simple webserver" APEX_APP_DESCR_MAP["eng-monitoring"]="starts the APEX engine monitoring client in a simple webserver" APEX_APP_DESCR_MAP["full-client"]="starts the full APEX client (rest editor, deployment, monitoring) in a simple webserver" +APEX_APP_DESCR_MAP["event-generator"]="starts the event generator in a simple webserver for performance testing" ## ## Help screen and exit condition (i.e. too few arguments) diff --git a/packages/apex-pdp-package-full/src/main/package/scripts/runBenchmark.sh b/packages/apex-pdp-package-full/src/main/package/scripts/runBenchmark.sh new file mode 100644 index 000000000..08c8d181f --- /dev/null +++ b/packages/apex-pdp-package-full/src/main/package/scripts/runBenchmark.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash + +#------------------------------------------------------------------------------- +# ============LICENSE_START======================================================= +# Copyright (C) 2018 Ericsson. All rights reserved. +# ================================================================================ +# Licensed 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= +#------------------------------------------------------------------------------- + +if [ -z $APEX_HOME ] +then + APEX_HOME="/opt/app/policy/apex-pdp" +fi + +if [ ! -d $APEX_HOME ] +then + echo + echo 'Apex directory "'$APEX_HOME'" not set or not a directory' + echo "Please set environment for 'APEX_HOME'" + exit +fi + +$APEX_HOME/bin/runOneBenchmark.sh Javascript 01 +$APEX_HOME/bin/runOneBenchmark.sh Javascript 02 +$APEX_HOME/bin/runOneBenchmark.sh Javascript 04 +$APEX_HOME/bin/runOneBenchmark.sh Javascript 08 +$APEX_HOME/bin/runOneBenchmark.sh Javascript 16 +$APEX_HOME/bin/runOneBenchmark.sh Javascript 32 +$APEX_HOME/bin/runOneBenchmark.sh Javascript 64 + +$APEX_HOME/bin/runOneBenchmark.sh Jython 01 +$APEX_HOME/bin/runOneBenchmark.sh Jython 02 +$APEX_HOME/bin/runOneBenchmark.sh Jython 04 +$APEX_HOME/bin/runOneBenchmark.sh Jython 08 +$APEX_HOME/bin/runOneBenchmark.sh Jython 16 +$APEX_HOME/bin/runOneBenchmark.sh Jython 32 +$APEX_HOME/bin/runOneBenchmark.sh Jython 64 + +$APEX_HOME/bin/runOneBenchmark.sh Mvel 01 +$APEX_HOME/bin/runOneBenchmark.sh Mvel 02 +$APEX_HOME/bin/runOneBenchmark.sh Mvel 04 +$APEX_HOME/bin/runOneBenchmark.sh Mvel 08 +$APEX_HOME/bin/runOneBenchmark.sh Mvel 16 +$APEX_HOME/bin/runOneBenchmark.sh Mvel 32 +$APEX_HOME/bin/runOneBenchmark.sh Mvel 64 + +$APEX_HOME/bin/runOneBenchmark.sh Java 01 +$APEX_HOME/bin/runOneBenchmark.sh Java 02 +$APEX_HOME/bin/runOneBenchmark.sh Java 04 +$APEX_HOME/bin/runOneBenchmark.sh Java 08 +$APEX_HOME/bin/runOneBenchmark.sh Java 16 +$APEX_HOME/bin/runOneBenchmark.sh Java 32 +$APEX_HOME/bin/runOneBenchmark.sh Java 64 + +#$APEX_HOME/bin/runOneBenchmark.sh JRuby 01 +#$APEX_HOME/bin/runOneBenchmark.sh JRuby 02 +#$APEX_HOME/bin/runOneBenchmark.sh JRuby 04 +#$APEX_HOME/bin/runOneBenchmark.sh JRuby 08 +#$APEX_HOME/bin/runOneBenchmark.sh JRuby 16 +#$APEX_HOME/bin/runOneBenchmark.sh JRuby 32 +#$APEX_HOME/bin/runOneBenchmark.sh JRuby 64 diff --git a/packages/apex-pdp-package-full/src/main/package/scripts/runOneBenchmark.sh b/packages/apex-pdp-package-full/src/main/package/scripts/runOneBenchmark.sh new file mode 100755 index 000000000..2e81bd29d --- /dev/null +++ b/packages/apex-pdp-package-full/src/main/package/scripts/runOneBenchmark.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash + +#------------------------------------------------------------------------------- +# ============LICENSE_START======================================================= +# Copyright (C) 2018 Ericsson. All rights reserved. +# ================================================================================ +# Licensed 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= +#------------------------------------------------------------------------------- + +if [ -z $APEX_HOME ] +then + APEX_HOME="/opt/app/policy/apex-pdp" +fi + +if [ ! -d $APEX_HOME ] +then + echo + echo 'Apex directory "'$APEX_HOME'" not set or not a directory' + echo "Please set environment for 'APEX_HOME'" + exit +fi + +if [ $# -ne 2 ] +then + echo "usage: $0 executor-type thread-count" + echo " executor-type [Javascript|Jython|JRuby|Mvel|Java]" + echo " thread-count [01|02|04|08|16|32|64]" + exit 1 +fi + +if [ "$1" != "Javascript" ] && [ "$1" != "Jython" ] && [ "$1" != "JRuby" ] && [ "$1" != "Mvel" ] && [ "$1" != "Java" ] +then + echo "executor-type must be a member of the set [Javascript|Jython|JRuby|Mvel|Java]" + exit 1 +fi + +if [ "$2" != "01" ] && [ "$2" != "02" ] && [ "$2" != "04" ] && [ "$2" != "08" ] && [ "$2" != "16" ] && [ "$2" != "32" ] && [ "$2" != "64" ] +then + echo "thread-count must be a member of the set [01|02|04|08|16|32|64]" + exit 1 +fi + +# Remove the old benchmark test result file if it exists +rm -fr examples/benchmark/Bm$1$2.json + +# Start the event generator +/bin/bash bin/apexApps.sh event-gen -c examples/benchmark/EventGeneratorConfig.json -o examples/benchmark/Bm$1$2.json > examples/benchmark/Bm$1$2_gen.log 2>&1 & + +# Start Apex +sleep 2 +/bin/bash bin/apexApps.sh engine -c examples/benchmark/$1$2.json > examples/benchmark/Bm$1$2_apex.log 2>&1 & +apex_pid=`ps -A -o pid,cmd | grep ApexMain | grep -v grep | head -n 1 | awk '{print $1}'` + +echo "running benchmark test for executor $1 with $2 threads" + +# Loop until result file exists +while [ ! -f examples/benchmark/Bm$1$2.json ] +do + echo -n . + sleep 1 +done + +# Loop until result file has 318 lines +while [ "$(wc -l examples/benchmark/Bm$1$2.json | cut -f1 -d' ')" -lt 318 ] +do + echo -n . + sleep 1 +done + +# Kill Apex +kill $apex_pid + +sleep 5 + +echo "" +echo "Finished" diff --git a/packages/apex-pdp-package-full/src/main/resources/hazelcast/hazelcast.xml b/packages/apex-pdp-package-full/src/main/resources/hazelcast/hazelcast.xml index f90c53c51..b0847f295 100644 --- a/packages/apex-pdp-package-full/src/main/resources/hazelcast/hazelcast.xml +++ b/packages/apex-pdp-package-full/src/main/resources/hazelcast/hazelcast.xml @@ -32,19 +32,19 @@ </multicast> <tcp-ip enabled="true"> <members>10.0.0.1</members> - <!-- members>192.168.219.141</members--> + <!-- members>192.168.219.141</members--> </tcp-ip> </join> <interfaces enabled="false"> - <!-- This value will allow hazelcast to run locally from the IDE --> + <!-- This value will allow hazelcast to run locally from the IDE --> <interface>127.0.0.*</interface> </interfaces> </network> <properties> <property name="hazelcast.icmp.enabled">true</property> <property name="hazelcast.logging.type">slf4j</property> - <!-- disable the hazelcast shutdown hook - prefer to control the shutdown - in code --> + <!-- disable the hazelcast shutdown hook - prefer to control the shutdown + in code --> <property name="hazelcast.shutdownhook.enabled">false</property> <property name="hazelcast.graceful.shutdown.max.wait">60</property> </properties> @@ -52,59 +52,59 @@ <pool-size>16</pool-size> </executor-service> <queue name="default"> - <!-- Maximum size of the queue. Any integer between 0 and Integer.MAX_VALUE. - 0 means Integer.MAX_VALUE. Default is 0. --> + <!-- Maximum size of the queue. Any integer between 0 and Integer.MAX_VALUE. + 0 means Integer.MAX_VALUE. Default is 0. --> <max-size>100000</max-size> - <!-- Maximum number of seconds for each item to stay in the queue. Items - that are not consumed in <time-to-live-seconds> will automatically get evicted - from the queue. Any integer between 0 and Integer.MAX_VALUE. 0 means infinite. - Default is 0. --> + <!-- Maximum number of seconds for each item to stay in the queue. Items + that are not consumed in <time-to-live-seconds> will automatically get evicted + from the queue. Any integer between 0 and Integer.MAX_VALUE. 0 means infinite. + Default is 0. --> </queue> <map name="default"> - <!-- Number of backups. If 1 is set as the backup-count for example, then - all entries of the map will be copied to another JVM for fail-safety. Valid - numbers are 0 (no backup), 1, 2, 3. --> + <!-- Number of backups. If 1 is set as the backup-count for example, then + all entries of the map will be copied to another JVM for fail-safety. Valid + numbers are 0 (no backup), 1, 2, 3. --> <backup-count>1</backup-count> - <!-- Valid values are: NONE (no eviction), LRU (Least Recently Used), LFU - (Least Frequiently Used). NONE is the default. --> + <!-- Valid values are: NONE (no eviction), LRU (Least Recently Used), LFU + (Least Frequiently Used). NONE is the default. --> <eviction-policy>NONE</eviction-policy> - <!-- Maximum size of the map. When max size is reached, map is evicted - based on the policy defined. Any integer between 0 and Integer.MAX_VALUE. - 0 means Integer.MAX_VALUE. Default is 0. --> + <!-- Maximum size of the map. When max size is reached, map is evicted + based on the policy defined. Any integer between 0 and Integer.MAX_VALUE. + 0 means Integer.MAX_VALUE. Default is 0. --> <max-size>0</max-size> - <!-- When max. size is reached, specified percentage of the map will be - evicted. Any integer between 0 and 100. If 25 is set for example, 25% of - the entries will get evicted. --> + <!-- When max. size is reached, specified percentage of the map will be + evicted. Any integer between 0 and 100. If 25 is set for example, 25% of + the entries will get evicted. --> <eviction-percentage>25</eviction-percentage> </map> <map name="CommonCache"> - <!-- Number of async-backups. If 1 is set as the backup-count for example, - then all entries of the map will be copied to another JVM for fail-safety. - Valid numbers are 0 (no backup), 1, 2, 3. --> + <!-- Number of async-backups. If 1 is set as the backup-count for example, + then all entries of the map will be copied to another JVM for fail-safety. + Valid numbers are 0 (no backup), 1, 2, 3. --> <async-backup-count>1</async-backup-count> - <!-- Can we read the local backup entries? Default value is false for strong - consistency. Being able to read backup data will give you greater performance. --> + <!-- Can we read the local backup entries? Default value is false for strong + consistency. Being able to read backup data will give you greater performance. --> <read-backup-data>true</read-backup-data> - <!-- Valid values are: NONE (no eviction), LRU (Least Recently Used), LFU - (Least Frequiently Used). NONE is the default. --> + <!-- Valid values are: NONE (no eviction), LRU (Least Recently Used), LFU + (Least Frequiently Used). NONE is the default. --> <eviction-policy>LRU</eviction-policy> - <!-- Maximum size of the map. When max size is reached, map is evicted - based on the policy defined. Any integer between 0 and Integer.MAX_VALUE. - 0 means Integer.MAX_VALUE. Default is 0. --> + <!-- Maximum size of the map. When max size is reached, map is evicted + based on the policy defined. Any integer between 0 and Integer.MAX_VALUE. + 0 means Integer.MAX_VALUE. Default is 0. --> <max-size>3000000</max-size> - <!-- When max. size is reached, specified percentage of the map will be - evicted. Any integer between 0 and 100. If 25 is set for example, 25% of - the entries will get evicted. --> + <!-- When max. size is reached, specified percentage of the map will be + evicted. Any integer between 0 and 100. If 25 is set for example, 25% of + the entries will get evicted. --> <eviction-percentage>5</eviction-percentage> - <!-- Maximum number of seconds for each entry to stay in the map. Entries - that are older than <time-to-live-seconds> and not updated for <time-to-live-seconds> - will get automatically evicted from the map. Any integer between 0 and Integer.MAX_VALUE. - 0 means infinite. Default is 0. --> + <!-- Maximum number of seconds for each entry to stay in the map. Entries + that are older than <time-to-live-seconds> and not updated for <time-to-live-seconds> + will get automatically evicted from the map. Any integer between 0 and Integer.MAX_VALUE. + 0 means infinite. Default is 0. --> <time-to-live-seconds>7200</time-to-live-seconds> @@ -113,45 +113,45 @@ <map name="CommonDataCache"> - <!-- Number of async-backups. If 1 is set as the backup-count for example, - then all entries of the map will be copied to another JVM for fail-safety. - Valid numbers are 0 (no backup), 1, 2, 3. --> + <!-- Number of async-backups. If 1 is set as the backup-count for example, + then all entries of the map will be copied to another JVM for fail-safety. + Valid numbers are 0 (no backup), 1, 2, 3. --> <async-backup-count>1</async-backup-count> - <!-- Can we read the local backup entries? Default value is false for strong - consistency. Being able to read backup data will give you greater performance. --> + <!-- Can we read the local backup entries? Default value is false for strong + consistency. Being able to read backup data will give you greater performance. --> <read-backup-data>true</read-backup-data> - <!-- Valid values are: NONE (no eviction), LRU (Least Recently Used), LFU - (Least Frequiently Used). NONE is the default. --> + <!-- Valid values are: NONE (no eviction), LRU (Least Recently Used), LFU + (Least Frequiently Used). NONE is the default. --> <eviction-policy>LRU</eviction-policy> - <!-- Maximum size of the map. When max size is reached, map is evicted - based on the policy defined. Any integer between 0 and Integer.MAX_VALUE. - 0 means Integer.MAX_VALUE. Default is 0. --> + <!-- Maximum size of the map. When max size is reached, map is evicted + based on the policy defined. Any integer between 0 and Integer.MAX_VALUE. + 0 means Integer.MAX_VALUE. Default is 0. --> <max-size>3000000</max-size> - <!-- When max. size is reached, specified percentage of the map will be - evicted. Any integer between 0 and 100. If 25 is set for example, 25% of - the entries will get evicted. --> + <!-- When max. size is reached, specified percentage of the map will be + evicted. Any integer between 0 and 100. If 25 is set for example, 25% of + the entries will get evicted. --> <eviction-percentage>5</eviction-percentage> - <!-- Maximum number of seconds for each entry to stay in the map. Entries - that are older than <time-to-live-seconds> and not updated for <time-to-live-seconds> - will get automatically evicted from the map. Any integer between 0 and Integer.MAX_VALUE. - 0 means infinite. Default is 0. --> + <!-- Maximum number of seconds for each entry to stay in the map. Entries + that are older than <time-to-live-seconds> and not updated for <time-to-live-seconds> + will get automatically evicted from the map. Any integer between 0 and Integer.MAX_VALUE. + 0 means infinite. Default is 0. --> <time-to-live-seconds>7200</time-to-live-seconds> </map> <queue name="raw-distributer-queue"> - <!-- Maximum size of the queue. Any integer between 0 and Integer.MAX_VALUE. - 0 means Integer.MAX_VALUE. Default is 0. --> + <!-- Maximum size of the queue. Any integer between 0 and Integer.MAX_VALUE. + 0 means Integer.MAX_VALUE. Default is 0. --> <max-size>100000</max-size> </queue> <map name="queue-map"> - <!-- Number of backups. If 1 is set as the backup-count for example, then - all entries of the map will be copied to another JVM for fail-safety. Valid - numbers are 0 (no backup), 1, 2, 3. --> + <!-- Number of backups. If 1 is set as the backup-count for example, then + all entries of the map will be copied to another JVM for fail-safety. Valid + numbers are 0 (no backup), 1, 2, 3. --> <backup-count>0</backup-count> </map> @@ -161,24 +161,24 @@ <async-backup-count>3</async-backup-count> <read-backup-data>true</read-backup-data> - <!-- Valid values are: NONE (no eviction), LRU (Least Recently Used), LFU - (Least Frequiently Used). NONE is the default. --> + <!-- Valid values are: NONE (no eviction), LRU (Least Recently Used), LFU + (Least Frequiently Used). NONE is the default. --> <eviction-policy>NONE</eviction-policy> - <!-- Maximum size of the map. When max size is reached, map is evicted - based on the policy defined. Any integer between 0 and Integer.MAX_VALUE. - 0 means Integer.MAX_VALUE. Default is 0. --> + <!-- Maximum size of the map. When max size is reached, map is evicted + based on the policy defined. Any integer between 0 and Integer.MAX_VALUE. + 0 means Integer.MAX_VALUE. Default is 0. --> <max-size>1000</max-size> - <!-- When max. size is reached, specified percentage of the map will be - evicted. Any integer between 0 and 100. If 25 is set for example, 25% of - the entries will get evicted. --> + <!-- When max. size is reached, specified percentage of the map will be + evicted. Any integer between 0 and 100. If 25 is set for example, 25% of + the entries will get evicted. --> <eviction-percentage>0</eviction-percentage> - <!-- Maximum number of seconds for each entry to stay in the map. Entries - that are older than <time-to-live-seconds> and not updated for <time-to-live-seconds> - will get automatically evicted from the map. Any integer between 0 and Integer.MAX_VALUE. - 0 means infinite. Default is 0. --> + <!-- Maximum number of seconds for each entry to stay in the map. Entries + that are older than <time-to-live-seconds> and not updated for <time-to-live-seconds> + will get automatically evicted from the map. Any integer between 0 and Integer.MAX_VALUE. + 0 means infinite. Default is 0. --> <time-to-live-seconds>0</time-to-live-seconds> </map> <map name="TOPIC-REGISTRY"> @@ -186,34 +186,34 @@ <async-backup-count>3</async-backup-count> <read-backup-data>true</read-backup-data> - <!-- Valid values are: NONE (no eviction), LRU (Least Recently Used), LFU - (Least Frequiently Used). NONE is the default. --> + <!-- Valid values are: NONE (no eviction), LRU (Least Recently Used), LFU + (Least Frequiently Used). NONE is the default. --> <eviction-policy>NONE</eviction-policy> - <!-- Maximum size of the map. When max size is reached, map is evicted - based on the policy defined. Any integer between 0 and Integer.MAX_VALUE. - 0 means Integer.MAX_VALUE. Default is 0. --> + <!-- Maximum size of the map. When max size is reached, map is evicted + based on the policy defined. Any integer between 0 and Integer.MAX_VALUE. + 0 means Integer.MAX_VALUE. Default is 0. --> <max-size>1000</max-size> - <!-- When max. size is reached, specified percentage of the map will be - evicted. Any integer between 0 and 100. If 25 is set for example, 25% of - the entries will get evicted. --> + <!-- When max. size is reached, specified percentage of the map will be + evicted. Any integer between 0 and 100. If 25 is set for example, 25% of + the entries will get evicted. --> <eviction-percentage>0</eviction-percentage> - <!-- Maximum number of seconds for each entry to stay in the map. Entries - that are older than <time-to-live-seconds> and not updated for <time-to-live-seconds> - will get automatically evicted from the map. Any integer between 0 and Integer.MAX_VALUE. - 0 means infinite. Default is 0. --> + <!-- Maximum number of seconds for each entry to stay in the map. Entries + that are older than <time-to-live-seconds> and not updated for <time-to-live-seconds> + will get automatically evicted from the map. Any integer between 0 and Integer.MAX_VALUE. + 0 means infinite. Default is 0. --> <time-to-live-seconds>0</time-to-live-seconds> </map> <queue name="Pooled-Topic-Request-Queue"> - <!-- Maximum size of the queue.Any integer between 0 and Integer.MAX_VALUE. - 0 means Integer.MAX_VALUE. Default is 0. --> + <!-- Maximum size of the queue.Any integer between 0 and Integer.MAX_VALUE. + 0 means Integer.MAX_VALUE. Default is 0. --> <max-size>100000</max-size> </queue> <map name="Pooled-Topic-Request-Queue-Backup-map"> - <!-- Number of backups. If 1 is set as the backup-count for example, then - all entries of the map will be copied to another JVM for fail-safety. Valid - numbers are 0 (no backup), 1, 2, 3. --> + <!-- Number of backups. If 1 is set as the backup-count for example, then + all entries of the map will be copied to another JVM for fail-safety. Valid + numbers are 0 (no backup), 1, 2, 3. --> <backup-count>1</backup-count> <eviction-policy>NONE</eviction-policy> <time-to-live-seconds>0</time-to-live-seconds> diff --git a/packages/apex-pdp-package-full/src/main/resources/logback.xml b/packages/apex-pdp-package-full/src/main/resources/logback.xml index 42502b1ab..b96a37686 100644 --- a/packages/apex-pdp-package-full/src/main/resources/logback.xml +++ b/packages/apex-pdp-package-full/src/main/resources/logback.xml @@ -25,7 +25,7 @@ <contextName>Apex</contextName> <property name="VAR_LOG" value="/var/log/onap/policy/apex-pdp/" /> - <!-- USE FOR STD OUT ONLY --> + <!-- USE FOR STD OUT ONLY --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <Pattern>%d %contextName [%t] %level %logger{36} - %msg%n</Pattern> diff --git a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/test/resources/logback-test.xml b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/test/resources/logback-test.xml index 3dd11e9cb..10cf3cc57 100644 --- a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/test/resources/logback-test.xml +++ b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/test/resources/logback-test.xml @@ -25,7 +25,7 @@ <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> <property name="LOG_DIR" value="${java.io.tmpdir}/apex_logging/" /> - <!-- USE FOR STD OUT ONLY --> + <!-- USE FOR STD OUT ONLY --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <Pattern>%d %contextName [%t] %level %logger{36} - %msg%n</Pattern> diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/test/resources/logback-test.xml b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/test/resources/logback-test.xml index dc591b1f1..b5c23f24c 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/test/resources/logback-test.xml +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/test/resources/logback-test.xml @@ -25,7 +25,7 @@ <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> <property name="LOG_DIR" value="${java.io.tmpdir}/apex_logging/" /> - <!-- USE FOR STD OUT ONLY --> + <!-- USE FOR STD OUT ONLY --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <Pattern>%d %contextName [%t] %level %logger{36} - %msg%n</Pattern> diff --git a/testsuites/integration/integration-context-test/src/test/resources/hazelcast/hazelcast.xml b/testsuites/integration/integration-context-test/src/test/resources/hazelcast/hazelcast.xml index 2918909c3..f6f010c1b 100644 --- a/testsuites/integration/integration-context-test/src/test/resources/hazelcast/hazelcast.xml +++ b/testsuites/integration/integration-context-test/src/test/resources/hazelcast/hazelcast.xml @@ -36,15 +36,15 @@ </tcp-ip> </join> <interfaces enabled="false"> - <!-- This value will allow hazelcast to run locally from the IDE --> + <!-- This value will allow hazelcast to run locally from the IDE --> <interface>127.0.0.*</interface> </interfaces> </network> <properties> <property name="hazelcast.icmp.enabled">false</property> <property name="hazelcast.logging.type">slf4j</property> - <!-- disable the hazelcast shutdown hook - prefer to control the shutdown - in code --> + <!-- disable the hazelcast shutdown hook - prefer to control the shutdown + in code --> <property name="hazelcast.shutdownhook.enabled">false</property> <property name="hazelcast.graceful.shutdown.max.wait">60</property> <property name="hazelcast.operation.generic.thread.count">1</property> diff --git a/testsuites/integration/integration-executor-test/src/test/resources/logback-test.xml b/testsuites/integration/integration-executor-test/src/test/resources/logback-test.xml index 549fb1912..021e55d2a 100644 --- a/testsuites/integration/integration-executor-test/src/test/resources/logback-test.xml +++ b/testsuites/integration/integration-executor-test/src/test/resources/logback-test.xml @@ -25,7 +25,7 @@ <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> <property name="LOG_DIR" value="${java.io.tmpdir}/apex_logging/" /> - <!-- USE FOR STD OUT ONLY --> + <!-- USE FOR STD OUT ONLY --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <Pattern>%d %contextName [%t] %level %logger{36} - %msg%n</Pattern> diff --git a/testsuites/performance/performance-benchmark-test/pom.xml b/testsuites/performance/performance-benchmark-test/pom.xml index 584b63898..6f6a978b1 100644 --- a/testsuites/performance/performance-benchmark-test/pom.xml +++ b/testsuites/performance/performance-benchmark-test/pom.xml @@ -36,6 +36,26 @@ <version>${project.version}</version> </dependency> <dependency> + <groupId>org.glassfish.jersey.core</groupId> + <artifactId>jersey-client</artifactId> + <version>${version.jersey}</version> + </dependency> + <dependency> + <groupId>org.glassfish.jersey.containers</groupId> + <artifactId>jersey-container-grizzly2-http</artifactId> + <version>${version.jersey}</version> + </dependency> + <dependency> + <groupId>org.glassfish.jersey.containers</groupId> + <artifactId>jersey-container-servlet-core</artifactId> + <version>${version.jersey}</version> + </dependency> + <dependency> + <groupId>org.glassfish.jersey.inject</groupId> + <artifactId>jersey-hk2</artifactId> + <version>2.27</version> + </dependency> + <dependency> <groupId>org.onap.policy.apex-pdp.testsuites.integration</groupId> <artifactId>integration-common</artifactId> <version>${project.version}</version> @@ -78,26 +98,105 @@ <scope>test</scope> </dependency> <dependency> + <groupId>org.onap.policy.apex-pdp.plugins.plugins-event.plugins-event-carrier</groupId> + <artifactId>plugins-event-carrier-restclient</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> <groupId>org.onap.policy.apex-pdp.context</groupId> <artifactId>context-test-utils</artifactId> <version>${project.version}</version> <scope>test</scope> </dependency> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-all</artifactId> + <scope>test</scope> + </dependency> </dependencies> <build> <plugins> + <!-- Copy required resources and examples --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>unpack-examples</id> + <phase>generate-test-resources</phase> + <goals> + <goal>unpack</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>org.onap.policy.apex-pdp.testsuites.integration</groupId> + <artifactId>integration-common</artifactId> + <version>${project.version}</version> + <type>jar</type> + <overWrite>false</overWrite> + <outputDirectory>${project.build.directory}</outputDirectory> + <includes>examples/**/*</includes> + </artifactItem> + </artifactItems> + <overWriteReleases>true</overWriteReleases> + <overWriteSnapshots>true</overWriteSnapshots> + </configuration> + </execution> + </executions> + </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> - <forkMode>always</forkMode> + <reuseForks>false</reuseForks> </configuration> </plugin> </plugins> </build> <profiles> + <profile> + <id>only-eclipse</id> + <activation> + <property> + <name>m2e.version</name> + </property> + </activation> + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.eclipse.m2e</groupId> + <artifactId>lifecycle-mapping</artifactId> + <version>1.0.0</version> + <configuration> + <lifecycleMappingMetadata> + <pluginExecutions> + <pluginExecution> + <pluginExecutionFilter> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <versionRange>[2.0,)</versionRange> + <goals> + <goal>unpack</goal> + </goals> + </pluginExecutionFilter> + <action> + <ignore /> + </action> + </pluginExecution> + </pluginExecutions> + </lifecycleMappingMetadata> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> + </profile> + <profile> <id>apexSite</id> <activation> @@ -113,4 +212,4 @@ </distributionManagement> </profile> </profiles> -</project>
\ No newline at end of file +</project> diff --git a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatch.java b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatch.java new file mode 100644 index 000000000..abf0c993f --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatch.java @@ -0,0 +1,151 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; + +import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events.InputEvent; +import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events.OutputEvent; + +/** + * This class keeps track of a batch of events sent to an Apex instance. + */ +public class EventBatch { + private static AtomicInteger nextBatchNumber = new AtomicInteger(); + + private final int batchNumber = nextBatchNumber.getAndIncrement(); + private final Map<Integer, InputEvent> inputEventMap = new ConcurrentHashMap<>(); + private final Map<Integer, OutputEvent> outputEventMap = new ConcurrentHashMap<>(); + + private final int batchSize; + private final String apexClient; + + /** + * Create an event batch. + * + * @param batchSize the size of the batch + * @param apexClient the apex client to which the event batch will be sent + */ + public EventBatch(final int batchSize, final String apexClient) { + this.batchSize = batchSize; + this.apexClient = apexClient; + + // Create the events for the batch of events + for (int eventNumber = 0; eventNumber < batchSize; eventNumber++) { + InputEvent inputEvent = new InputEvent(); + inputEvent.setTestSlogan(getEventSlogan(eventNumber)); + inputEventMap.put(eventNumber, inputEvent); + } + } + + /** + * Get the batch of events as a JSON string. + * + * @return the JSON string representation of the batch of events. + */ + public String getBatchAsJsonString() { + if (batchSize == 1) { + return inputEventMap.get(0).asJson(); + } + + StringBuilder jsonBuilder = new StringBuilder(); + jsonBuilder.append("[\n"); + boolean first = true; + for (InputEvent inputEvent : inputEventMap.values()) { + if (first) { + first = false; + } + else { + jsonBuilder.append(",\n"); + } + jsonBuilder.append(inputEvent.asJson()); + } + jsonBuilder.append("\n]\n"); + + return jsonBuilder.toString(); + } + + public int getBatchNumber() { + return batchNumber; + } + + public int getBatchSize() { + return batchSize; + } + + public String getApexClient() { + return apexClient; + } + + /** + * Get the event slogan. + * + * @param eventNumber the number of this event + * @return the event slogan + */ + private String getEventSlogan(final int eventNumber) { + StringBuilder testSloganBuilder = new StringBuilder(); + testSloganBuilder.append(batchNumber); + testSloganBuilder.append('-'); + testSloganBuilder.append(eventNumber); + testSloganBuilder.append(": "); + testSloganBuilder.append(apexClient); + + return testSloganBuilder.toString(); + } + + /** + * Handle a response event. + * + * @param responseEvent the response event + */ + public void handleResponse(OutputEvent responseEvent) { + outputEventMap.put(responseEvent.findEventNumber(), responseEvent); + } + + /** + * Get the statistics on this event batch. + * @return the event batch statistics + */ + public EventBatchStats getStats() { + return new EventBatchStats(this); + } + + /** + * Get an input event for an event number. + * @param eventNo the event number + * @return the event + */ + public InputEvent getInputEvent(int eventNo) { + return inputEventMap.get(eventNo); + } + + /** + * Get an output event for an event number. + * @param eventNo the event number + * @return the event + */ + public OutputEvent getOutputEvent(int eventNo) { + return outputEventMap.get(eventNo); + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatchStats.java b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatchStats.java new file mode 100644 index 000000000..321cd28e2 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatchStats.java @@ -0,0 +1,239 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator; + +import java.util.List; + +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; +import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events.OutputEvent; + +/** + * This POJO class returns statistics on a event batch execution in Apex. + */ +public class EventBatchStats { + private final int batchNumber; + private final int batchSize; + private final String apexClient; + + // @formatter:off + private long eventsNotSent = 0; + private long eventsSent = 0; + private long eventsNotReceived = 0; + private long eventsReceived = 0; + private long averageRoundTripNano = 0; + private long shortestRoundTripNano = Long.MAX_VALUE; + private long longestRoundTripNano = 0; + private long averageApexExecutionNano = 0; + private long shortestApexExecutionNano = Long.MAX_VALUE; + private long longestApexExecutionNano = 0; + // @formatter:on + + /** + * Create a statistics object for an event batch. + * + * @param eventBatch the event batch for these statistics + */ + public EventBatchStats(final EventBatch eventBatch) { + this.batchNumber = eventBatch.getBatchNumber(); + this.batchSize = eventBatch.getBatchSize(); + this.apexClient = eventBatch.getApexClient(); + + calcutateStats(eventBatch); + } + + /** + * Create a total statistics object for a list of event batches. + * + * @param eventBatchStatsList the event batch for these statistics + */ + public EventBatchStats(final List<EventBatchStats> eventBatchStatsList) { + this.batchNumber = -1; + this.apexClient = "TOTAL"; + + calcutateStats(eventBatchStatsList); + + this.batchSize = (int)(eventsNotSent + eventsSent); + } + + /** + * Compile the statistics. + * @param eventBatch the event batch for which statisticss should be calculated + */ + private void calcutateStats(final EventBatch eventBatch) { + long accumulatedRoundTripTime = 0; + long accumulatedApexExecutionTime = 0; + + for (int eventNo = 0; eventNo < batchSize; eventNo++) { + Pair<Long, Long> eventTimings = calculateEventTimings(eventBatch, eventNo); + if (eventTimings == null) { + // The event has not been sent yet or the response has not been received yet + continue; + } + + accumulatedRoundTripTime += eventTimings.getLeft(); + accumulatedApexExecutionTime += eventTimings.getRight(); + } + + if (eventsReceived != 0) { + averageRoundTripNano = accumulatedRoundTripTime / eventsReceived; + averageApexExecutionNano = accumulatedApexExecutionTime / eventsReceived; + } + } + + /** + * Compile the statistics. + * @param eventBatchStatsList the event batch list for which statistics should be calculated + */ + private void calcutateStats(final List<EventBatchStats> eventBatchStatsList) { + long accumulatedRoundTripTime = 0; + long accumulatedApexExecutionTime = 0; + + for (EventBatchStats eventBatchStats: eventBatchStatsList) { + // @formatter:off + eventsNotSent += eventBatchStats.getEventsNotSent(); + eventsSent += eventBatchStats.getEventsSent(); + eventsNotReceived += eventBatchStats.getEventsNotReceived(); + eventsReceived += eventBatchStats.getEventsReceived(); + // @formatter:on + + if (shortestRoundTripNano > eventBatchStats.getShortestRoundTripNano()) { + shortestRoundTripNano = eventBatchStats.getShortestRoundTripNano(); + } + + if (shortestApexExecutionNano > eventBatchStats.getShortestApexExecutionNano()) { + shortestApexExecutionNano = eventBatchStats.getShortestApexExecutionNano(); + } + + if (longestRoundTripNano < eventBatchStats.getLongestRoundTripNano()) { + longestRoundTripNano = eventBatchStats.getLongestRoundTripNano(); + } + + if (longestApexExecutionNano < eventBatchStats.getLongestApexExecutionNano()) { + longestApexExecutionNano = eventBatchStats.getLongestApexExecutionNano(); + } + + accumulatedRoundTripTime += eventBatchStats.getAverageRoundTripNano(); + accumulatedApexExecutionTime += eventBatchStats.getAverageApexExecutionNano(); + } + + if (!eventBatchStatsList.isEmpty()) { + averageRoundTripNano = accumulatedRoundTripTime / eventBatchStatsList.size(); + averageApexExecutionNano = accumulatedApexExecutionTime / eventBatchStatsList.size(); + } + } + + /** + * Calculate statistics for a single event. + * @param eventBatch the event batch for the event + * @param eventNo the event number of the event + * @return + */ + private Pair<Long, Long> calculateEventTimings(EventBatch eventBatch, int eventNo) { + // If an event is in a batch, it has been sent + eventsSent++; + + OutputEvent outputEvent = eventBatch.getOutputEvent(eventNo); + + if (outputEvent == null) { + eventsNotReceived++; + return null; + + } + else { + eventsReceived++; + } + + long roundTrip = outputEvent.getTestReceviedTimestamp() - outputEvent.getTestTimestamp(); + long apexExecution = outputEvent.getTestActStateTime() - outputEvent.getTestMatchStateTime(); + + + if (shortestRoundTripNano > roundTrip) { + shortestRoundTripNano = roundTrip; + } + + if (shortestApexExecutionNano > apexExecution) { + shortestApexExecutionNano = apexExecution; + } + + if (longestRoundTripNano < roundTrip) { + longestRoundTripNano = roundTrip; + } + + if (longestApexExecutionNano < apexExecution) { + longestApexExecutionNano = apexExecution; + } + + return new ImmutablePair<>(roundTrip, apexExecution); + } + + public int getBatchNumber() { + return batchNumber; + } + + public int getBatchSize() { + return batchSize; + } + + public String getApexClient() { + return apexClient; + } + + public long getEventsNotSent() { + return eventsNotSent; + } + + public long getEventsSent() { + return eventsSent; + } + + public long getEventsNotReceived() { + return eventsNotReceived; + } + + public long getEventsReceived() { + return eventsReceived; + } + + public long getAverageRoundTripNano() { + return averageRoundTripNano; + } + + public long getShortestRoundTripNano() { + return shortestRoundTripNano; + } + + public long getLongestRoundTripNano() { + return longestRoundTripNano; + } + + public long getAverageApexExecutionNano() { + return averageApexExecutionNano; + } + + public long getShortestApexExecutionNano() { + return shortestApexExecutionNano; + } + + public long getLongestApexExecutionNano() { + return longestApexExecutionNano; + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGenerator.java b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGenerator.java new file mode 100644 index 000000000..a5ed37803 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGenerator.java @@ -0,0 +1,185 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator; + +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; + +import org.apache.commons.cli.ParseException; +import org.glassfish.grizzly.http.server.HttpServer; +import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory; +import org.glassfish.jersey.server.ResourceConfig; +import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities; +import org.onap.policy.apex.model.utilities.TextFileUtils; +import org.slf4j.ext.XLogger; +import org.slf4j.ext.XLoggerFactory; + +/** + * This class is the main class of a REST server that generates sample events. + */ +public class EventGenerator { + // Get a reference to the logger + private static final XLogger LOGGER = XLoggerFactory.getXLogger(EventGenerator.class); + + // Parameters for event generation + private final EventGeneratorParameters parameters; + + // The HTTP server we are running + private final HttpServer eventGeneratorServer; + + /** + * Instantiates a new event generator with the given parameters. + * + * @param parameters the parameters for the event generator + */ + public EventGenerator(final EventGeneratorParameters parameters) { + this.parameters = parameters; + + // Set the parameters in the event generator endpoint + EventGeneratorEndpoint.clearEventGenerationStats(); + EventGeneratorEndpoint.setParameters(parameters); + + // Add a shutdown hook to shut down the rest services when the process is exiting + Runtime.getRuntime().addShutdownHook(new Thread(new EventGeneratorShutdownHook())); + + LOGGER.info("Event generator REST server starting"); + + final ResourceConfig rc = new ResourceConfig(EventGeneratorEndpoint.class); + eventGeneratorServer = GrizzlyHttpServerFactory.createHttpServer(getBaseUri(), rc); + + // Wait for the HTTP server to come up + while (!eventGeneratorServer.isStarted()) { + ThreadUtilities.sleep(50); + } + + LOGGER.info("Event generator REST server started"); + } + + /** + * Get the current event generation statistics. + * + * @return the statistics as a JSON string + */ + public String getEventGenerationStats() { + return EventGeneratorEndpoint.getEventGenerationStats(); + } + + /** + * Check if event generation is finished. + * + * @return true if event generation is finished + */ + public boolean isFinished() { + return EventGeneratorEndpoint.isFinished(); + } + + /** + * Tear down the event generator. + */ + public void tearDown() { + LOGGER.info("Event generator shutting down"); + + eventGeneratorServer.shutdown(); + + if (parameters.getOutFile() != null) { + try { + TextFileUtils.putStringAsTextFile(getEventGenerationStats(), parameters.getOutFile()); + } + catch (IOException ioe) { + LOGGER.warn("could not output statistics to file \"" + parameters.getOutFile() + "\"", ioe); + } + } + + LOGGER.info("Event generator shut down"); + } + + /** + * Get the base URI for the server. + * + * @return the base URI + */ + private URI getBaseUri() { + String baseUri = "http://" + parameters.getHost() + ':' + parameters.getPort() + '/' + "/EventGenerator"; + return URI.create(baseUri); + } + + /** + * This class is a shutdown hook for the Apex editor command. + */ + private class EventGeneratorShutdownHook implements Runnable { + /* + * (non-Javadoc) + * + * @see java.lang.Runnable#run() + */ + @Override + public void run() { + tearDown(); + } + } + + /** + * The main method. + * + * @param args the arguments + * @throws Exception the exception + */ + public static void main(final String[] args) { + LOGGER.info("Starting event generator with arguments: " + Arrays.toString(args)); + + EventGeneratorParameterHandler parameterHandler = new EventGeneratorParameterHandler(); + + EventGeneratorParameters parameters = null; + + try { + parameters = parameterHandler.parse(args); + } + catch (ParseException pe) { + LOGGER.trace("Event generator start exception", pe); + LOGGER.info("Start of event generator failed: {}", pe.getMessage()); + return; + } + + // Null parameters means we print help + if (parameters == null) { + LOGGER.info(parameterHandler.getHelp(EventGenerator.class.getName())); + return; + } + + // Start the event generator + EventGenerator eventGenerator = new EventGenerator(parameters); + LOGGER.info("Event generator started"); + + // Wait for event generation to finish + while (!eventGenerator.isFinished()) { + ThreadUtilities.sleep(200); + } + + + // Shut down the server + eventGenerator.tearDown(); + + LOGGER.info("Event generator statistics\n" + eventGenerator.getEventGenerationStats()); + + LOGGER.info("Event generator finished"); + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorEndpoint.java b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorEndpoint.java new file mode 100644 index 000000000..ed624fb83 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorEndpoint.java @@ -0,0 +1,177 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator; + +import com.google.gson.Gson; + +import java.util.concurrent.ConcurrentHashMap; + +import javax.inject.Inject; +import javax.inject.Provider; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.core.Response; + +import org.glassfish.grizzly.http.server.Request; +import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities; +import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events.OutputEvent; +import org.slf4j.ext.XLogger; +import org.slf4j.ext.XLoggerFactory; + +/** + * This class is the REST end point for event simulator REST calls. + */ +@Path("/") +public class EventGeneratorEndpoint { + // Get a reference to the logger + private static final XLogger LOGGER = XLoggerFactory.getXLogger(EventGeneratorEndpoint.class); + + // Parameters for event generation + private static EventGeneratorParameters parameters = new EventGeneratorParameters(); + + // The map of event batches sent in the test + private static ConcurrentHashMap<Integer, EventBatch> batchMap = new ConcurrentHashMap<>(); + + // Flag indicating that event processing has finished + private static boolean finished = false; + + // The current HTTP request + private final Provider<Request> httpRequest; + + /** + * Inject the HTTP request with a constructor. + * @param httpRequest the current request + */ + @Inject + public EventGeneratorEndpoint(final Provider<Request> httpRequest) { + this.httpRequest = httpRequest; + } + + /** + * Set the parameters for the end point. + * + * @param incomingParameters the new parameters + */ + public static void setParameters(EventGeneratorParameters incomingParameters) { + synchronized (parameters) { + parameters = incomingParameters; + } + } + + /** + * Get event generator statistics. + * + * @return the response + */ + @Path("/Stats") + @GET + public Response serviceGetStats() { + return Response.status(200).entity(new EventGeneratorStats(batchMap).getStatsAsJsonString()).build(); + } + + /** + * Generate a single event. + * + * @return the event + */ + @Path("/GetEvents") + @GET + public Response getEvents() { + ThreadUtilities.sleep(parameters.getDelayBetweenBatches()); + + // Check if event generation is finished + if (isFinished()) { + return Response.status(204).build(); + } + + // A batch count of 0 means to continue to handle events for ever + if (parameters.getBatchCount() > 0 && batchMap.size() >= parameters.getBatchCount()) { + setFinished(true); + return Response.status(204).build(); + } + + EventBatch batch = new EventBatch(parameters.getBatchSize(), getApexClient()); + batchMap.put(batch.getBatchNumber(), batch); + + return Response.status(200).entity(batch.getBatchAsJsonString()).build(); + } + + /** + * Get a single response to an event. + * + * @param jsonString the json string + * @return the response + */ + @Path("/PostEvent") + @POST + public Response postEventResponse(final String jsonString) { + final OutputEvent outputEvent = new Gson().fromJson(jsonString, OutputEvent.class); + + EventBatch batch = batchMap.get(outputEvent.findBatchNumber()); + + if (batch == null) { + String errorMessage = "no input event found for received output event " + outputEvent; + LOGGER.warn(errorMessage); + return Response.status(409).build(); + } + + batch.handleResponse(outputEvent); + return Response.status(200).build(); + } + + /** + * Get the name, address, and port of the Apex client getting the events. + * + * @return the Apex client + */ + private String getApexClient() { + return httpRequest.get().getRemoteHost() + '(' + httpRequest.get().getRemoteAddr() + "):" + + httpRequest.get().getRemotePort(); + } + + /** + * Get event generation statistics. + * @return the statistics on event generation + */ + protected static String getEventGenerationStats() { + return new EventGeneratorStats(batchMap).getStatsAsJsonString(); + } + + /** + * Clear event generation statistics. + */ + protected static void clearEventGenerationStats() { + batchMap.clear(); + } + + /** + * Check if event generation has finished. + * @return true if event generation has finished + */ + protected static boolean isFinished() { + return finished; + } + + protected static void setFinished(boolean finished) { + EventGeneratorEndpoint.finished = finished; + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParameterHandler.java b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParameterHandler.java new file mode 100644 index 000000000..4cc94712f --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParameterHandler.java @@ -0,0 +1,214 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator; + +import com.google.gson.Gson; + +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.Arrays; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.DefaultParser; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; +import org.onap.policy.apex.model.utilities.TextFileUtils; +import org.slf4j.ext.XLogger; +import org.slf4j.ext.XLoggerFactory; + +/** + * This class reads and handles command line parameters to the event generator. + */ +public class EventGeneratorParameterHandler { + // Get a reference to the logger + private static final XLogger LOGGER = XLoggerFactory.getXLogger(EventGeneratorParameterHandler.class); + + private static final String CONFIGURATION_FILE = "configuration-file"; + private static final String PORT = "port"; + private static final String HOST = "host"; + private static final String HELP = "help"; + private static final String BATCH_SIZE = "batch-size"; + private static final String BATCH_COUNT = "batch-count"; + private static final String BATCH_DELAY = "delay-between-batches"; + private static final String OUTPUT_FILE = "output-file"; + + private static final int MAX_HELP_LINE_LENGTH = 120; + + // Apache Commons CLI options + private final Options options; + + /** + * Construct the options for the CLI editor. + */ + public EventGeneratorParameterHandler() { + options = new Options(); + options.addOption(Option.builder("h").longOpt(HELP).desc("outputs the usage of this command").required(false) + .type(Boolean.class).build()); + options.addOption(Option.builder("H").longOpt(HOST) + .desc("the host name on which to start the event generation server, defaults to \"localhost\"") + .hasArg().argName(HOST).required(false).type(String.class).build()); + options.addOption(Option.builder("p").longOpt(PORT) + .desc("the port on which to start the event generation server, defaults to 42339").hasArg() + .argName(PORT).required(false).type(Number.class).build()); + options.addOption(Option.builder("c").longOpt(CONFIGURATION_FILE) + .desc("name of a file containing the parameters for the event generations server, " + + "this option must appear on its own") + .hasArg().argName(CONFIGURATION_FILE).required(false).type(String.class).build()); + options.addOption(Option.builder("o").longOpt(OUTPUT_FILE) + .desc("path and name of a file to which output will be written," + + " if not specified no output is written") + .hasArg().argName(OUTPUT_FILE).required(false).type(String.class).build()); + options.addOption(Option.builder("bc").longOpt(BATCH_COUNT) + .desc("the number of batches of events to send, must be 0 or more, " + + "0 means send event batches forever, defaults to 1") + .hasArg().argName(BATCH_COUNT).required(false).type(Number.class).build()); + options.addOption(Option.builder("bs").longOpt(BATCH_SIZE) + .desc("the number of events to send in an event batch, must be 1 or more, defaults to 1") + .hasArg().argName(BATCH_SIZE).required(false).type(Number.class).build()); + options.addOption(Option.builder("bd").longOpt(BATCH_DELAY) + .desc("the delay in milliseconds between event batches, must be zero or more, " + + "defaults to 10,000 (10 seconds)") + .hasArg().argName(BATCH_DELAY).required(false).type(Number.class).build()); + } + + /** + * Parse the command line options. + * + * @param args The arguments + * @return the CLI parameters + * @throws ParseException on parse errors + */ + public EventGeneratorParameters parse(final String[] args) throws ParseException { + CommandLine commandLine = new DefaultParser().parse(options, args); + final String[] remainingArgs = commandLine.getArgs(); + + if (remainingArgs.length > 0) { + throw new ParseException("too many command line arguments specified : " + Arrays.toString(remainingArgs)); + } + + if (commandLine.hasOption('h')) { + return null; + } + + EventGeneratorParameters parameters = new EventGeneratorParameters(); + + if (commandLine.hasOption('c')) { + parameters = getParametersFromJsonFile(commandLine.getOptionValue(CONFIGURATION_FILE)); + } + + parseFlags(commandLine, parameters); + + if (commandLine.hasOption('o')) { + parameters.setOutFile(commandLine.getOptionValue(OUTPUT_FILE)); + } + + if (!parameters.isValid()) { + throw new ParseException("specified parameters are not valid: " + parameters.validate().getResult()); + } + + return parameters; + } + + /** + * Parse the command flags. + * + * @param commandLine the command line to parse + * @param parameters the parameters we are parsing into + * @throws ParseException on parse errors + */ + private void parseFlags(CommandLine commandLine, EventGeneratorParameters parameters) throws ParseException { + if (commandLine.hasOption('H')) { + parameters.setHost(commandLine.getOptionValue(HOST)); + } + + if (commandLine.hasOption('p')) { + parameters.setPort(((Number) commandLine.getParsedOptionValue(PORT)).intValue()); + } + + if (commandLine.hasOption("bc")) { + parameters.setBatchCount(((Number) commandLine.getParsedOptionValue(BATCH_COUNT)).intValue()); + } + + if (commandLine.hasOption("bs")) { + parameters.setBatchSize(((Number) commandLine.getParsedOptionValue(BATCH_SIZE)).intValue()); + } + + if (commandLine.hasOption("bd")) { + parameters.setDelayBetweenBatches(((Number) commandLine.getParsedOptionValue(BATCH_DELAY)).longValue()); + } + } + + /** + * Get the parameters from a JSON file. + * + * @param configurationFile the location of the configuration file + * @return the parameters read from the JSON file + * @throws ParseException on errors reading the parameters + */ + private EventGeneratorParameters getParametersFromJsonFile(String configurationFile) throws ParseException { + String parameterJsonString = null; + + try { + parameterJsonString = TextFileUtils.getTextFileAsString(configurationFile); + } catch (IOException ioe) { + String errorMessage = "Could not read parameters from configuration file \"" + configurationFile + "\": " + + ioe.getMessage(); + LOGGER.warn(errorMessage, ioe); + throw new ParseException(errorMessage); + } + + if (parameterJsonString == null || parameterJsonString.trim().length() == 0) { + String errorMessage = "No parameters found in configuration file \"" + configurationFile + "\""; + LOGGER.warn(errorMessage); + throw new ParseException(errorMessage); + } + + try { + return new Gson().fromJson(parameterJsonString, EventGeneratorParameters.class); + } catch (Exception ge) { + String errorMessage = "Error parsing JSON parameters from configuration file \"" + configurationFile + + "\": " + ge.getMessage(); + LOGGER.warn(errorMessage, ge); + throw new ParseException(errorMessage); + } + } + + /** + * Get help information. + * + * @param mainClassName the main class name for the help output + * @return help string + */ + public String getHelp(final String mainClassName) { + final StringWriter stringWriter = new StringWriter(); + final PrintWriter stringPrintWriter = new PrintWriter(stringWriter); + + final HelpFormatter helpFormatter = new HelpFormatter(); + helpFormatter.printHelp(stringPrintWriter, MAX_HELP_LINE_LENGTH, mainClassName + " [options...] ", "", options, + 0, 0, ""); + + return stringWriter.toString(); + } + +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParameters.java b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParameters.java new file mode 100644 index 000000000..8eb41b4e3 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParameters.java @@ -0,0 +1,156 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator; + +import org.onap.policy.common.parameters.GroupValidationResult; +import org.onap.policy.common.parameters.ParameterGroup; +import org.onap.policy.common.parameters.ValidationStatus; + +/** + * This class defines the parameters for event generation. + */ +public class EventGeneratorParameters implements ParameterGroup { + // @formatter:off + private static final String DEFAULT_NAME = EventGeneratorParameters.class.getSimpleName(); + private static final String DEFAULT_HOST = "localhost"; + private static final int DEFAULT_PORT = 32801; + private static final int DEFAULT_BATCH_COUNT = 1; + private static final int DEFAULT_BATCH_SIZE = 1; + private static final long DEFAULT_DELAY_BETWEEN_BATCHES = 2000; + + private String name = DEFAULT_NAME; + private String host = DEFAULT_HOST; + private int port = DEFAULT_PORT; + private int batchCount = DEFAULT_BATCH_COUNT; + private int batchSize = DEFAULT_BATCH_SIZE; + private long delayBetweenBatches = DEFAULT_DELAY_BETWEEN_BATCHES; + private String outFile = null; + // @formatter:on + + /** + * Create default parameters. + */ + public EventGeneratorParameters() { + // Default parameters are generated + } + + @Override + public String getName() { + return name; + } + + @Override + public void setName(String name) { + this.name = name; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public int getPort() { + return port; + } + + public void setPort(int port) { + this.port = port; + } + + public int getBatchCount() { + return batchCount; + } + + public void setBatchCount(int batchCount) { + this.batchCount = batchCount; + } + + public int getBatchSize() { + return batchSize; + } + + public void setBatchSize(int batchSize) { + this.batchSize = batchSize; + } + + public long getDelayBetweenBatches() { + return delayBetweenBatches; + } + + public void setDelayBetweenBatches(long delayBetweenBatches) { + this.delayBetweenBatches = delayBetweenBatches; + } + + public String getOutFile() { + return outFile; + } + + public void setOutFile(String outFile) { + this.outFile = outFile; + } + + /** + * {@inheritDoc} + */ + @Override + public GroupValidationResult validate() { + GroupValidationResult validationResult = new GroupValidationResult(this); + + if (isNullOrBlank(name)) { + validationResult.setResult("name", ValidationStatus.INVALID, "name must be a non-blank string"); + } + + if (isNullOrBlank(host)) { + validationResult.setResult("host", ValidationStatus.INVALID, "host must be a non-blank string"); + } + + if (port < 1024 || port > 65535) { + validationResult.setResult("port", ValidationStatus.INVALID, + "port must be an integer between 1024 and 65535 inclusive"); + } + + if (batchCount < 0) { + validationResult.setResult("batchCount", ValidationStatus.INVALID, + "batchCount must be an integer with a value of zero or more, " + + "zero means generate batches forever"); + } + + if (batchSize < 1) { + validationResult.setResult("batchSize", ValidationStatus.INVALID, + "batchSize must be an integer greater than zero"); + } + + if (delayBetweenBatches < 0) { + validationResult.setResult("batchSize", ValidationStatus.INVALID, + "batchSize must be an integer with a value of zero or more"); + } + + return validationResult; + } + + private boolean isNullOrBlank(final String stringValue) { + return stringValue == null || stringValue.trim().length() == 0; + } + +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorStats.java b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorStats.java new file mode 100644 index 000000000..f3a5372bf --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorStats.java @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator; + +import com.google.gson.GsonBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * This class creates statistics for the event generator's current status. + */ +public class EventGeneratorStats { + private final EventBatchStats totalStats; + private final List<EventBatchStats> batchStatsList = new ArrayList<>(); + + /** + * Create the statistics using the current batch map. + * @param batchMap the batch map to use + */ + public EventGeneratorStats(final Map<Integer, EventBatch> batchMap) { + for (EventBatch eventBatch: batchMap.values()) { + batchStatsList.add(new EventBatchStats(eventBatch)); + } + + totalStats = new EventBatchStats(batchStatsList); + } + + /** + * Get the batch statistics as a JSON string. + * @return the statistics as a JSON string + */ + public String getStatsAsJsonString() { + return new GsonBuilder().setPrettyPrinting().create().toJson(this); + } + + public EventBatchStats getTotalStats() { + return totalStats; + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/events/InputEvent.java b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/events/InputEvent.java new file mode 100644 index 000000000..cf70ea2f1 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/events/InputEvent.java @@ -0,0 +1,142 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events; + +import com.google.gson.GsonBuilder; +import com.google.gson.annotations.SerializedName; + +import java.util.Random; + +/** + * This class is a POJO representing an input event for load testing. + */ +public class InputEvent { + private String nameSpace = "org.onap.policy.apex.sample.events"; + private String name; + private String version = "0.0.1"; + private String source = "EventGenerator"; + private String target = "Apex"; + + @SerializedName(value = "TestSlogan") + private String testSlogan; + + @SerializedName(value = "TestMatchCase") + private int testMatchCase; + + @SerializedName(value = "TestTimestamp") + private long testTimestamp = System.nanoTime(); + + @SerializedName(value = "TestTemperature") + private double testTemperature; + + /** + * Constructor, assign default values to fields. + */ + public InputEvent() { + final Random rand = new Random(); + testMatchCase = rand.nextInt(4); + name = "Event0" + rand.nextInt(2) + "00"; + testTemperature = rand.nextDouble() * 1000; + } + + public String getNameSpace() { + return nameSpace; + + } + + public void setNameSpace(String nameSpace) { + this.nameSpace = nameSpace; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public String getTarget() { + return target; + } + + + public void setTarget(String target) { + this.target = target; + } + + public String getTestSlogan() { + return testSlogan; + } + + public void setTestSlogan(String testSlogan) { + this.testSlogan = testSlogan; + } + + public int getTestMatchCase() { + return testMatchCase; + } + + public void setTestMatchCase(int testMatchCase) { + this.testMatchCase = testMatchCase; + } + + public long getTestTimestamp() { + return testTimestamp; + } + + public void setTestTimestamp(long testTimestamp) { + this.testTimestamp = testTimestamp; + } + + public double getTestTemperature() { + return testTemperature; + } + + public void setTestTemperature(double testTemperature) { + this.testTemperature = testTemperature; + } + + /** + * Get a JSON representation of the input event. + * + * @return the event in JSON format + */ + public String asJson() { + return new GsonBuilder().setPrettyPrinting().create().toJson(this); + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/events/OutputEvent.java b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/events/OutputEvent.java new file mode 100644 index 000000000..0350b3f2e --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/events/OutputEvent.java @@ -0,0 +1,135 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events; + +import com.google.gson.annotations.SerializedName; + +/** + * This class is a POJO representing an output event for load testing. + */ +public class OutputEvent extends InputEvent { + @SerializedName(value = "TestMatchCaseSelected") + private int testMatchCaseSelected; + + @SerializedName(value = "TestMatchStateTime") + private long testMatchStateTime; + + @SerializedName(value = "TestEstablishCaseSelected") + private int testEstablishCaseSelected; + + @SerializedName(value = "TestEstablishStateTime") + private long testEstablishStateTime; + + @SerializedName(value = "TestDecideCaseSelected") + private int testDecideCaseSelected; + + @SerializedName(value = "TestDecideStateTime") + private long testDecideStateTime; + + @SerializedName(value = "TestActCaseSelected") + private int testActCaseSelected; + + @SerializedName(value = "TestActStateTime") + private long testActStateTime; + + private long testReceviedTimestamp = System.nanoTime(); + + public int getTestMatchCaseSelected() { + return testMatchCaseSelected; + } + + public void setTestMatchCaseSelected(int testMatchCaseSelected) { + this.testMatchCaseSelected = testMatchCaseSelected; + } + + public long getTestMatchStateTime() { + return testMatchStateTime; + } + + public void setTestMatchStateTime(long testMatchStateTime) { + this.testMatchStateTime = testMatchStateTime; + } + + public int getTestEstablishCaseSelected() { + return testEstablishCaseSelected; + } + + public void setTestEstablishCaseSelected(int testEstablishCaseSelected) { + this.testEstablishCaseSelected = testEstablishCaseSelected; + } + + public long getTestEstablishStateTime() { + return testEstablishStateTime; + } + + public void setTestEstablishStateTime(long testEstablishStateTime) { + this.testEstablishStateTime = testEstablishStateTime; + } + + public int getTestDecideCaseSelected() { + return testDecideCaseSelected; + } + + public void setTestDecideCaseSelected(int testDecideCaseSelected) { + this.testDecideCaseSelected = testDecideCaseSelected; + } + + public long getTestDecideStateTime() { + return testDecideStateTime; + } + + public void setTestDecideStateTime(long testDecideStateTime) { + this.testDecideStateTime = testDecideStateTime; + } + + public int getTestActCaseSelected() { + return testActCaseSelected; + } + + public void setTestActCaseSelected(int testActCaseSelected) { + this.testActCaseSelected = testActCaseSelected; + } + + public long getTestActStateTime() { + return testActStateTime; + } + + public void setTestActStateTime(long testActStateTime) { + this.testActStateTime = testActStateTime; + } + + public long getTestReceviedTimestamp() { + return testReceviedTimestamp; + } + + public void setTestReceviedTimestamp(long testReceviedTimestamp) { + this.testReceviedTimestamp = testReceviedTimestamp; + } + + public int findBatchNumber() { + return Integer.valueOf(getTestSlogan().substring(0, getTestSlogan().indexOf('-'))); + } + + public int findEventNumber() { + return Integer.valueOf( + getTestSlogan().substring(getTestSlogan().indexOf('-') + 1, getTestSlogan().indexOf(':'))); + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/EventGeneratorConfig.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/EventGeneratorConfig.json new file mode 100644 index 000000000..ede72cc60 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/EventGeneratorConfig.json @@ -0,0 +1,9 @@ +{ + "name": "EventGenerator", + "host": "localhost", + "port": 32801, + "batchCount": 20, + "batchSize": 50, + "delayBetweenBatches": 2000, + "outFile": null +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby01.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby01.json new file mode 100644 index 000000000..117d3fbc5 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby01.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 1, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJRUBY.xml", + "engineParameters": { + "executorParameters": { + "JRUBY": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.jruby.JrubyExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby02.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby02.json new file mode 100644 index 000000000..0e154ddf7 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby02.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 2, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJRUBY.xml", + "engineParameters": { + "executorParameters": { + "JRUBY": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.jruby.JrubyExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby04.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby04.json new file mode 100644 index 000000000..9d1c891b7 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby04.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 4, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJRUBY.xml", + "engineParameters": { + "executorParameters": { + "JRUBY": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.jruby.JrubyExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby08.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby08.json new file mode 100644 index 000000000..d4fd87af7 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby08.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 8, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJRUBY.xml", + "engineParameters": { + "executorParameters": { + "JRUBY": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.jruby.JrubyExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby16.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby16.json new file mode 100644 index 000000000..24c26644c --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby16.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 16, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJRUBY.xml", + "engineParameters": { + "executorParameters": { + "JRUBY": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.jruby.JrubyExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby32.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby32.json new file mode 100644 index 000000000..88293b899 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby32.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 32, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJRUBY.xml", + "engineParameters": { + "executorParameters": { + "JRUBY": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.jruby.JrubyExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby64.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby64.json new file mode 100644 index 000000000..99a8b3f0f --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/JRuby64.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 64, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJRUBY.xml", + "engineParameters": { + "executorParameters": { + "JRUBY": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.jruby.JrubyExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java01.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java01.json new file mode 100644 index 000000000..674e3005e --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java01.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 1, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJAVA.xml", + "engineParameters": { + "executorParameters": { + "JAVA": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.java.JavaExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java02.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java02.json new file mode 100644 index 000000000..8c1702026 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java02.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 2, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJAVA.xml", + "engineParameters": { + "executorParameters": { + "JAVA": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.java.JavaExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java04.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java04.json new file mode 100644 index 000000000..2602390ae --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java04.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 4, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJAVA.xml", + "engineParameters": { + "executorParameters": { + "JAVA": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.java.JavaExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java08.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java08.json new file mode 100644 index 000000000..a9d990292 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java08.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 8, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJAVA.xml", + "engineParameters": { + "executorParameters": { + "JAVA": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.java.JavaExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java16.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java16.json new file mode 100644 index 000000000..dc1d9f699 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java16.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 16, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJAVA.xml", + "engineParameters": { + "executorParameters": { + "JAVA": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.java.JavaExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java32.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java32.json new file mode 100644 index 000000000..0bc52e336 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java32.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 32, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJAVA.xml", + "engineParameters": { + "executorParameters": { + "JAVA": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.java.JavaExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java64.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java64.json new file mode 100644 index 000000000..52d074089 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Java64.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 64, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJAVA.xml", + "engineParameters": { + "executorParameters": { + "JAVA": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.java.JavaExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript01.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript01.json new file mode 100644 index 000000000..afea5fe45 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript01.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 1, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJAVASCRIPT.xml", + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript02.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript02.json new file mode 100644 index 000000000..f28dc18b1 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript02.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 2, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJAVASCRIPT.xml", + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript04.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript04.json new file mode 100644 index 000000000..110996e6a --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript04.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 4, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJAVASCRIPT.xml", + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript08.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript08.json new file mode 100644 index 000000000..67bca6b8a --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript08.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 8, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJAVASCRIPT.xml", + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript16.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript16.json new file mode 100644 index 000000000..ceff6370c --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript16.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 16, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJAVASCRIPT.xml", + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript32.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript32.json new file mode 100644 index 000000000..eeb371e29 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript32.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 32, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJAVASCRIPT.xml", + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript64.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript64.json new file mode 100644 index 000000000..a724f668c --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Javascript64.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 64, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJAVASCRIPT.xml", + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython01.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython01.json new file mode 100644 index 000000000..25c4e426c --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython01.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 1, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJYTHON.xml", + "engineParameters": { + "executorParameters": { + "JYTHON": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.jython.JythonExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython02.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython02.json new file mode 100644 index 000000000..9f010775a --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython02.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 2, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJYTHON.xml", + "engineParameters": { + "executorParameters": { + "JYTHON": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.jython.JythonExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython04.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython04.json new file mode 100644 index 000000000..0bd8c35dd --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython04.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 4, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJYTHON.xml", + "engineParameters": { + "executorParameters": { + "JYTHON": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.jython.JythonExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython08.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython08.json new file mode 100644 index 000000000..8e7fd3f23 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython08.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 8, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJYTHON.xml", + "engineParameters": { + "executorParameters": { + "JYTHON": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.jython.JythonExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython16.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython16.json new file mode 100644 index 000000000..899a6b8ef --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython16.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 16, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJYTHON.xml", + "engineParameters": { + "executorParameters": { + "JYTHON": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.jython.JythonExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython32.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython32.json new file mode 100644 index 000000000..9919970d7 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython32.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 32, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJYTHON.xml", + "engineParameters": { + "executorParameters": { + "JYTHON": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.jython.JythonExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython64.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython64.json new file mode 100644 index 000000000..8952f45c7 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Jython64.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 64, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJYTHON.xml", + "engineParameters": { + "executorParameters": { + "JYTHON": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.jython.JythonExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel01.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel01.json new file mode 100644 index 000000000..3bf7749bd --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel01.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 1, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelMVEL.xml", + "engineParameters": { + "executorParameters": { + "MVEL": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel02.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel02.json new file mode 100644 index 000000000..eb203c872 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel02.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 2, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelMVEL.xml", + "engineParameters": { + "executorParameters": { + "MVEL": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel04.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel04.json new file mode 100644 index 000000000..b62b93e06 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel04.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 4, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelMVEL.xml", + "engineParameters": { + "executorParameters": { + "MVEL": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel08.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel08.json new file mode 100644 index 000000000..d81cf67fe --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel08.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 8, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelMVEL.xml", + "engineParameters": { + "executorParameters": { + "MVEL": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel16.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel16.json new file mode 100644 index 000000000..a211ac7f1 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel16.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 16, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelMVEL.xml", + "engineParameters": { + "executorParameters": { + "MVEL": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel32.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel32.json new file mode 100644 index 000000000..2ca767555 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel32.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 32, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelMVEL.xml", + "engineParameters": { + "executorParameters": { + "MVEL": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel64.json b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel64.json new file mode 100644 index 000000000..488f845b3 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/main/resources/examples/benchmark/Mvel64.json @@ -0,0 +1,45 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 64, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelMVEL.xml", + "engineParameters": { + "executorParameters": { + "MVEL": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters" + } + } + } + }, + "eventInputParameters": { + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/GetEvents" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/EventGenerator/PostEvent" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/ApexBaseBenchMarkTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/ApexBaseBenchMarkTest.java deleted file mode 100644 index fdefd5583..000000000 --- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/ApexBaseBenchMarkTest.java +++ /dev/null @@ -1,175 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2018 Ericsson. All rights reserved. - * ================================================================================ - * Licensed 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.apex.testsuites.performance.benchmark.engine.benchmark; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters; -import org.onap.policy.apex.context.parameters.ContextParameters; -import org.onap.policy.apex.context.parameters.SchemaParameters; -import org.onap.policy.apex.core.engine.EngineParameters; -import org.onap.policy.apex.core.engine.ExecutorParameters; -import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities; -import org.onap.policy.apex.model.basicmodel.concepts.ApexException; -import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; -import org.onap.policy.apex.plugins.context.schema.avro.AvroSchemaHelperParameters; -import org.onap.policy.apex.plugins.executor.java.JavaExecutorParameters; -import org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters; -import org.onap.policy.apex.plugins.executor.jruby.JrubyExecutorParameters; -import org.onap.policy.apex.plugins.executor.jython.JythonExecutorParameters; -import org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters; -import org.onap.policy.apex.service.engine.event.ApexEvent; -import org.onap.policy.apex.service.engine.runtime.ApexEventListener; -import org.onap.policy.apex.service.engine.runtime.EngineService; -import org.onap.policy.apex.service.engine.runtime.EngineServiceEventInterface; -import org.onap.policy.apex.service.engine.runtime.impl.EngineServiceImpl; -import org.onap.policy.apex.service.parameters.engineservice.EngineServiceParameters; -import org.onap.policy.apex.testsuites.performance.benchmark.engine.runtime.ApexServiceModelUpdateTest; -import org.slf4j.ext.XLogger; -import org.slf4j.ext.XLoggerFactory; - -/** - * The Class ApexBaseBenchMarkTest. - */ -public class ApexBaseBenchMarkTest { - private static final long STOP_TIME_OUT = TimeUnit.SECONDS.toMillis(30); - private static final XLogger LOGGER = XLoggerFactory.getXLogger(ApexServiceModelUpdateTest.class); - private static final long MAX_START_WAIT = TimeUnit.SECONDS.toMillis(10); - private final AxArtifactKey engineServiceKey = new AxArtifactKey("Machine-1_process-1_engine-1", "0.0.0"); - private final String model; - private final int threads; - private final ApexEventListener listener; - private EngineService service; - private EngineServiceEventInterface engineServiceEventInterface; - - - /** - * Instantiates a new apex base bench mark test. - * - * @param model the model - * @param threads the threads - * @param listener the listener - */ - public ApexBaseBenchMarkTest(final String model, final int threads, final ApexEventListener listener) { - this.model = model; - this.threads = threads; - this.listener = listener; - } - - /** - * Sets the up. - * - * @throws Exception the exception - */ - public void setUp() throws Exception { - final EngineServiceParameters parameters = new EngineServiceParameters(); - parameters.setInstanceCount(threads); - parameters.setName(engineServiceKey.getName()); - parameters.setVersion(engineServiceKey.getVersion()); - parameters.setId(100); - - final EngineParameters engineParameters = parameters.getEngineParameters(); - final Map<String, ExecutorParameters> executorParameterMap = engineParameters.getExecutorParameterMap(); - executorParameterMap.put("MVEL", new MvelExecutorParameters()); - executorParameterMap.put("JAVASCRIPT", new JavascriptExecutorParameters()); - executorParameterMap.put("JYTHON", new JythonExecutorParameters()); - executorParameterMap.put("JAVA", new JavaExecutorParameters()); - executorParameterMap.put("JRUBY", new JrubyExecutorParameters()); - - final ContextParameters contextParameters = engineParameters.getContextParameters(); - final SchemaParameters schemaParameters = contextParameters.getSchemaParameters(); - schemaParameters.getSchemaHelperParameterMap().put("Avro", new AvroSchemaHelperParameters()); - schemaParameters.getSchemaHelperParameterMap().put("Java", new JavaSchemaHelperParameters()); - service = EngineServiceImpl.create(parameters); - - service = EngineServiceImpl.create(parameters); - service.registerActionListener("listener", listener); - service.updateModel(parameters.getEngineKey(), model, true); - - LOGGER.info("Starting EngineService ... "); - service.startAll(); - - final long starttime = System.currentTimeMillis(); - while (!service.isStarted() && System.currentTimeMillis() - starttime < MAX_START_WAIT) { - ThreadUtilities.sleep(50); - } - if (!service.isStarted()) { - LOGGER.error("Apex Service {} failed to start after {} ms", service.getKey(), MAX_START_WAIT); - new ApexException("Unable to start engine service "); - } - - engineServiceEventInterface = service.getEngineServiceEventInterface(); - } - - /** - * Send events. - * - * @param events the events - */ - public void sendEvents(final List<ApexEvent> events) { - for (final ApexEvent event : events) { - engineServiceEventInterface.sendEvent(event); - } - } - - /** - * Send event. - * - * @param event the event - */ - public void sendEvent(final ApexEvent event) { - engineServiceEventInterface.sendEvent(event); - } - - - /** - * Gets the service. - * - * @return the service - */ - public EngineService getService() { - return service; - } - - /** - * Destroy. - * - * @throws Exception the exception - */ - public void destroy() throws Exception { - if (service != null) { - LOGGER.info("Stopping EngineService ... "); - service.stop(); - final long currentTimeInMillSec = System.currentTimeMillis(); - while (!service.isStopped()) { - if (System.currentTimeMillis() - currentTimeInMillSec > STOP_TIME_OUT) { - LOGGER.warn("Timed Out EngineService status: ", service.isStopped()); - break; - } - ThreadUtilities.sleep(500); - } - service = null; - } - } - -} diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/ApexEngineBenchmarkTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/ApexEngineBenchmarkTest.java deleted file mode 100644 index 99035f7bf..000000000 --- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/ApexEngineBenchmarkTest.java +++ /dev/null @@ -1,183 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * ================================================================================ - * Licensed 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.apex.testsuites.performance.benchmark.engine.benchmark; - -import static org.junit.Assert.assertEquals; - -import java.util.concurrent.TimeUnit; - -import org.junit.Before; -import org.junit.Test; -import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities; -import org.onap.policy.apex.service.engine.event.ApexEvent; -import org.onap.policy.apex.testsuites.integration.common.model.EvalDomainModelFactory; -import org.onap.policy.apex.testsuites.performance.benchmark.engine.utils.Utils; -import org.python.icu.impl.Assert; -import org.slf4j.ext.XLogger; -import org.slf4j.ext.XLoggerFactory; - -/** - * The Class ApexEngineBenchmark. - */ -public class ApexEngineBenchmarkTest { - // Logger for this class - private static final XLogger LOGGER = XLoggerFactory.getXLogger(ApexEngineBenchmarkTest.class); - - private static final String TARGET = "apex"; - private static final String SOURCE = "test"; - private static final String NAME = "Event0000"; - private static final String VERSION = "0.0.1"; - private static final String PACKAGE = "org.onap.policy.apex.domains.sample.events"; - - private static final long TIME_OUT_IN_MILLISEC = TimeUnit.MINUTES.toMillis(1); - - private String apexEcaModelString; - private String apexOodaModelString; - - /** - * Sets the up. - * - * @throws Exception the exception - */ - @Before - public void setUp() throws Exception { - apexEcaModelString = Utils.getModelString(new EvalDomainModelFactory().getEcaPolicyModel()); - apexOodaModelString = Utils.getModelString(new EvalDomainModelFactory().getOodaPolicyModel()); - } - - /** - * Test benchmark singleton worker. - * - * @throws Exception the exception - */ - @Test - public void testBenchmark_SingletonWorker() throws Exception { - executeTest(apexEcaModelString, 100, 1, 20); - executeTest(apexOodaModelString, 100, 1, 20); - } - - /** - * Test benchmark 3 thread worker. - * - * @throws Exception the exception - */ - @Test - public void testBenchmark_3ThreadWorker() throws Exception { - executeTest(apexEcaModelString, 1000, 3, 10); - executeTest(apexOodaModelString, 100, 3, 10); - } - - /** - * Test benchmark 10 thread worker. - * - * @throws Exception the exception - */ - @Test - public void testBenchmark_10ThreadWorker() throws Exception { - executeTest(apexEcaModelString, 2000, 10, 10); - executeTest(apexOodaModelString, 2000, 10, 10); - } - - /** - * Test benchmark 50 thread worker. - * - * @throws Exception the exception - */ - @Test - public void testBenchmark_50ThreadWorker() throws Exception { - executeTest(apexEcaModelString, 3000, 50, 10); - executeTest(apexOodaModelString, 3000, 50, 10); - } - - /** - * Test available processors thread worker. - * - * @throws Exception the exception - */ - @Test - public void testAvailableProcessorsThreadWorker() throws Exception { - final int cores = Runtime.getRuntime().availableProcessors(); - executeTest(apexEcaModelString, 3000, cores, 10); - executeTest(apexOodaModelString, 3000, cores, 10); - } - - /** - * Execute test. - * - * @param policyModel the policy model - * @param eventsCount the events count - * @param threads the threads - * @param loop the loop - * @throws Exception the exception - */ - private void executeTest(final String policyModel, final int eventsCount, final int threads, final int loop) - throws Exception { - - LOGGER.info("Running Test with Event count: {}, Instance count: {} and loop: {}", eventsCount, threads, loop); - final ApexEventListenerTest apexEventListener = new ApexEventListenerTest(); - - final ApexBaseBenchMarkTest apexBaseBenchMarkTest = - new ApexBaseBenchMarkTest(policyModel, threads, apexEventListener); - - try { - apexBaseBenchMarkTest.setUp(); - for (int i = 0; i < loop; i++) { - sendEvents(apexBaseBenchMarkTest, eventsCount); - final long currentTimeInMillSec = System.currentTimeMillis(); - while (apexEventListener.getEventReceived() < eventsCount) { - if (System.currentTimeMillis() - currentTimeInMillSec > TIME_OUT_IN_MILLISEC) { - LOGGER.warn("Wait timed out ... "); - break; - } - ThreadUtilities.sleep(500); - } - assertEquals(eventsCount, apexEventListener.getEventReceived()); - apexEventListener.printResult(); - apexEventListener.reset(); - } - } catch (final Exception exception) { - Assert.fail(exception); - } finally { - apexBaseBenchMarkTest.destroy(); - LOGGER.info("Finished Running Test with Event count: {}, Instance count: {} and loop: {}", eventsCount, - threads, loop); - } - } - - /** - * Send events. - * - * @param apexBaseBenchMarkTest the apex base bench mark test - * @param eventsCount the events count - * @throws Exception the exception - */ - public void sendEvents(final ApexBaseBenchMarkTest apexBaseBenchMarkTest, final int eventsCount) throws Exception { - for (int eventNum = 0; eventNum < eventsCount; eventNum++) { - final long currentTimeMillis = System.currentTimeMillis(); - final ApexEvent event = new ApexEvent(NAME, VERSION, PACKAGE, SOURCE, TARGET); - event.put("TestTemperature", eventNum); - event.put("FirstEventTimestamp", currentTimeMillis); - event.put("SentTimestamp", currentTimeMillis); - event.put("EventNumber", eventNum); - apexBaseBenchMarkTest.sendEvent(event); - } - } -} diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/ApexEventListenerTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/ApexEventListenerTest.java deleted file mode 100644 index a5950df97..000000000 --- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/ApexEventListenerTest.java +++ /dev/null @@ -1,126 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2018 Ericsson. All rights reserved. - * ================================================================================ - * Licensed 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.apex.testsuites.performance.benchmark.engine.benchmark; - -import static org.junit.Assert.assertNull; - -import java.util.Queue; -import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.atomic.AtomicLong; - -import org.onap.policy.apex.service.engine.event.ApexEvent; -import org.onap.policy.apex.service.engine.runtime.ApexEventListener; -import org.slf4j.ext.XLogger; -import org.slf4j.ext.XLoggerFactory; - -/** - * The listener interface for receiving testApexEvent events. - * The class that is interested in processing a testApexEvent - * event implements this interface, and the object created - * with that class is registered with a component using the - * component's <code>addTestApexEventListener</code> method. When - * the testApexEvent event occurs, that object's appropriate - * method is invoked. - * - * @see TestApexEventEvent - */ -public class ApexEventListenerTest implements ApexEventListener { - - private static final String SENT_TIMESTAMP = "SentTimestamp"; - private static final XLogger LOGGER = XLoggerFactory.getXLogger(ApexEventListenerTest.class); - private static final String RECVD_TIMESTAMP = "RecvdTimestamp"; - private Queue<ApexEvent> queue; - - private final AtomicLong eventReceived = new AtomicLong(); - - /** - * Instantiates a new test apex event listener. - */ - public ApexEventListenerTest() { - this.queue = new ConcurrentLinkedQueue<ApexEvent>(); - } - - /* (non-Javadoc) - * @see org.onap.policy.apex.service.engine.runtime.ApexEventListener#onApexEventApexEvent) - */ - @Override - public void onApexEvent(final ApexEvent apexEvent) { - apexEvent.put(RECVD_TIMESTAMP, System.currentTimeMillis()); - eventReceived.incrementAndGet(); - queue.add(apexEvent); - } - - /** - * Prints the result. - */ - public void printResult() { - if (!queue.isEmpty()) { - long maxTimeInMilliSeconds = 0; - long minTimeInMilliSeconds = Long.MAX_VALUE; - final long numEvents = queue.size(); - long totalTimeInMilliSeconds = 0; - for (final ApexEvent apexEvent : queue) { - assertNull(apexEvent.getExceptionMessage()); - final Long endTimeInMilliSeconds = (Long) apexEvent.get(RECVD_TIMESTAMP); - final Long startTimeInMilliSeconds = (Long) apexEvent.get(SENT_TIMESTAMP); - final long timeTaken = endTimeInMilliSeconds - startTimeInMilliSeconds; - totalTimeInMilliSeconds += timeTaken; - if (timeTaken > maxTimeInMilliSeconds) { - maxTimeInMilliSeconds = timeTaken; - } - if (timeTaken < minTimeInMilliSeconds) { - minTimeInMilliSeconds = timeTaken; - } - } - LOGGER.info("Average Time Taken to process {} events: {} ms", numEvents, - (totalTimeInMilliSeconds / numEvents)); - LOGGER.info("Max Time Taken: {} ms", maxTimeInMilliSeconds); - LOGGER.info("Min Time Taken: {} ms", minTimeInMilliSeconds); - } - } - - /** - * Reset. - */ - public void reset() { - this.queue = new ConcurrentLinkedQueue<ApexEvent>(); - eventReceived.set(0);; - } - - /** - * Gets the queue. - * - * @return the queue - */ - public Queue<ApexEvent> getQueue() { - return queue; - } - - /** - * Gets the event received. - * - * @return the event received - */ - public long getEventReceived() { - return eventReceived.get(); - } - -} diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatchStatsTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatchStatsTest.java new file mode 100644 index 000000000..b53eb7ace --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatchStatsTest.java @@ -0,0 +1,57 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Test; + +/** + * Test the EventBatchStats class. + * + */ +public class EventBatchStatsTest { + + @Test + public void test() { + EventBatchStats stats = new EventBatchStats(new EventBatch(1, "Label")); + assertNotNull(stats); + + assertTrue(stats.getBatchNumber() >= 0); + assertEquals(1, stats.getBatchSize()); + assertEquals("Label", stats.getApexClient()); + + List<EventBatchStats> statsList = new ArrayList<>(); + statsList.add(stats); + + EventBatchStats totalStats = new EventBatchStats(statsList); + assertEquals(stats.getBatchSize(), totalStats.getBatchSize()); + + List<EventBatchStats> emptyStatsList = new ArrayList<>(); + EventBatchStats emptyStats = new EventBatchStats(emptyStatsList); + assertEquals(0, emptyStats.getBatchSize()); + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatchTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatchTest.java new file mode 100644 index 000000000..f315f6402 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventBatchTest.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import org.junit.Test; +import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events.InputEvent; + +/** + * Test the EventBatch class. + * + */ +public class EventBatchTest { + + @Test + public void testEventBatch() { + EventBatch batch = new EventBatch(1, "TheApexClient"); + assertNotNull(batch); + + assertEquals("\"nameSpace\": \"org.onap.policy.apex.sample.events\"", batch.getBatchAsJsonString().substring(4, 53)); + + EventBatchStats stats = batch.getStats(); + assertEquals(1, stats.getBatchSize()); + + InputEvent ie = batch.getInputEvent(0); + assertEquals("org.onap.policy.apex.sample.events",ie.getNameSpace()); + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorEndpointTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorEndpointTest.java new file mode 100644 index 000000000..2add69857 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorEndpointTest.java @@ -0,0 +1,115 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import javax.inject.Provider; +import javax.ws.rs.core.Response; + +import org.glassfish.grizzly.http.server.Request; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.onap.policy.apex.model.basicmodel.concepts.ApexException; +import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events.OutputEvent; + +/** + * Test the EventGeneratorEndpoint class. + * + */ +public class EventGeneratorEndpointTest { + @Mock + private Provider<Request> httpRequestProviderMock; + + @Mock + private Request httpRequestMock; + + /** + * Set up mocking of the engine service facade. + * + * @throws ApexException on engine service facade setup errors + */ + @Before + public void initializeMocking() throws ApexException { + MockitoAnnotations.initMocks(this); + + Mockito.doReturn(httpRequestMock).when(httpRequestProviderMock).get(); + + Mockito.doReturn("zooby").when(httpRequestMock).getRemoteHost(); + Mockito.doReturn(12345).when(httpRequestMock).getRemotePort(); + + } + + @Test + public void testEventGeneratorEndpointGetStats() { + EventGeneratorEndpoint.clearEventGenerationStats(); + EventGeneratorEndpoint.setFinished(false); + + EventGeneratorEndpoint egep = new EventGeneratorEndpoint(null); + assertNotNull(egep); + + Response stats = egep.serviceGetStats(); + assertEquals(200, stats.getStatus()); + } + + @Test + public void testEventGeneratorEndpointGetEventsZeroBatchCount() { + EventGeneratorParameters incomingParameters = new EventGeneratorParameters(); + incomingParameters.setBatchCount(1); + + EventGeneratorEndpoint.setParameters(incomingParameters); + EventGeneratorEndpoint.clearEventGenerationStats(); + EventGeneratorEndpoint.setFinished(false); + + EventGeneratorEndpoint egep = new EventGeneratorEndpoint(httpRequestProviderMock); + assertNotNull(egep); + + Response events = egep.getEvents(); + assertEquals(200, events.getStatus()); + + incomingParameters.setBatchCount(1); + events = egep.getEvents(); + assertEquals(204, events.getStatus()); + } + + @Test + public void testEventGeneratorEndpointPostBadEvent() { + EventGeneratorParameters incomingParameters = new EventGeneratorParameters(); + incomingParameters.setBatchCount(1); + + EventGeneratorEndpoint.setParameters(incomingParameters); + EventGeneratorEndpoint.clearEventGenerationStats(); + EventGeneratorEndpoint.setFinished(false); + + EventGeneratorEndpoint egep = new EventGeneratorEndpoint(httpRequestProviderMock); + assertNotNull(egep); + + OutputEvent oe = new OutputEvent(); + oe.setTestSlogan("99-99: Whatever"); + + Response events = egep.postEventResponse(oe.asJson()); + assertEquals(409, events.getStatus()); + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParametersHandlerTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParametersHandlerTest.java new file mode 100644 index 000000000..dd8766dc3 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParametersHandlerTest.java @@ -0,0 +1,325 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; + +import org.apache.commons.cli.ParseException; +import org.junit.Test; +import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.EventGenerator; +import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.EventGeneratorParameterHandler; +import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.EventGeneratorParameters; + +/** + * Test event generator parameters. + */ +public class EventGeneratorParametersHandlerTest { + + @Test + public void testEventGeneratorParameterhandler() { + EventGeneratorParameterHandler handler = new EventGeneratorParameterHandler(); + assertNotNull(handler); + + try { + String[] args = + { "-h" }; + EventGeneratorParameters parameters = handler.parse(args); + assertNull(parameters); + assertEquals("usage: EventGenerator [options...]", + handler.getHelp(EventGenerator.class.getSimpleName()).substring(0, 34)); + } catch (ParseException pe) { + fail("test should not throw an exception"); + } + + try { + String[] args = + {}; + EventGeneratorParameters parameters = handler.parse(args); + assertEquals("localhost", parameters.getHost()); + assertEquals(32801, parameters.getPort()); + } catch (ParseException pe) { + fail("test should not throw an exception"); + } + + try { + String[] args = + { "-H", "MyHost" }; + EventGeneratorParameters parameters = handler.parse(args); + assertEquals("MyHost", parameters.getHost()); + } catch (ParseException pe) { + fail("test should not throw an exception"); + } + + try { + String[] args = + { "-p", "12345" }; + EventGeneratorParameters parameters = handler.parse(args); + assertEquals(12345, parameters.getPort()); + } catch (ParseException pe) { + fail("test should not throw an exception"); + } + + try { + String[] args = + { "-H", "MyHost", "-p", "12345" }; + EventGeneratorParameters parameters = handler.parse(args); + assertEquals("MyHost", parameters.getHost()); + assertEquals(12345, parameters.getPort()); + } catch (ParseException pe) { + fail("test should not throw an exception"); + } + + try { + String[] args = + { "-c", "src/test/resources/parameters/unit/Valid.json" }; + EventGeneratorParameters parameters = handler.parse(args); + assertEquals("ValidPars", parameters.getName()); + assertEquals("FileHost", parameters.getHost()); + assertEquals(54321, parameters.getPort()); + } catch (ParseException pe) { + fail("test should not throw an exception"); + } + + try { + String[] args = + { "-c", "src/test/resources/parameters/unit/Default.json" }; + EventGeneratorParameters parameters = handler.parse(args); + assertEquals("localhost", parameters.getHost()); + assertEquals(32801, parameters.getPort()); + } catch (ParseException pe) { + fail("test should not throw an exception"); + } + + try { + String[] args = + { "-c", "src/test/resources/parameters/unit/Default.json", "-bc", "100" }; + EventGeneratorParameters parameters = handler.parse(args); + assertEquals(100, parameters.getBatchCount()); + } catch (ParseException pe) { + fail("test should not throw an exception"); + } + + try { + String[] args = + { "-c", "src/test/resources/parameters/unit/Default.json", "-bc", "-1" }; + handler.parse(args); + fail("test should throw an exception"); + } catch (ParseException pe) { + assertEquals("specified parameters are not valid: parameter group \"EventGeneratorParameters\" " + + "type \"org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator." + + "EventGeneratorParameters\" INVALID, parameter group has status INVALID\n" + + " field \"batchCount\" type \"int\" value \"-1\" INVALID, " + + "batchCount must be an integer with a value of zero or more, " + + "zero means generate batches forever\n", pe.getMessage()); + } + + try { + String[] args = + { "-c", "src/test/resources/parameters/unit/Default.json", "-bs", "12345" }; + EventGeneratorParameters parameters = handler.parse(args); + assertEquals(12345, parameters.getBatchSize()); + } catch (ParseException pe) { + fail("test should not throw an exception"); + } + + try { + String[] args = + { "-c", "src/test/resources/parameters/unit/Default.json", "-bs", "0" }; + handler.parse(args); + fail("test should throw an exception"); + } catch (ParseException pe) { + assertEquals("specified parameters are not valid: parameter group \"EventGeneratorParameters\" " + + "type \"org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator." + + "EventGeneratorParameters\" INVALID, parameter group has status INVALID\n" + + " field \"batchSize\" type \"int\" value \"0\" INVALID, " + + "batchSize must be an integer greater than zero\n", pe.getMessage()); + } + + try { + String[] args = + { "-c", "src/test/resources/parameters/unit/Default.json", "-bd", "1000" }; + EventGeneratorParameters parameters = handler.parse(args); + assertEquals(1000, parameters.getDelayBetweenBatches()); + } catch (ParseException pe) { + fail("test should not throw an exception"); + } + + try { + String[] args = + { "-c", "src/test/resources/parameters/unit/Default.json", "-bd", "-1" }; + handler.parse(args); + fail("test should throw an exception"); + } catch (ParseException pe) { + assertEquals("specified parameters are not valid: parameter group \"EventGeneratorParameters\" " + + "type \"org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator." + + "EventGeneratorParameters\" INVALID, parameter group has status INVALID\n" + + " field \"batchSize\" type \"int\" value \"1\" INVALID, " + + "batchSize must be an integer with a value of zero or more\n", pe.getMessage()); + } + + try { + String[] args = + { "-c", "src/test/resources/parameters/unit/Default.json", "-o", "Zooby" }; + EventGeneratorParameters parameters = handler.parse(args); + assertEquals("Zooby", parameters.getOutFile()); + } catch (ParseException pe) { + fail("test should not throw an exception"); + } + + try { + String[] args = + { "-z" }; + handler.parse(args); + fail("test should throw an exception"); + } catch (ParseException pe) { + assertEquals("Unrecognized option: -z", pe.getMessage()); + } + + try { + String[] args = + { "-H" }; + handler.parse(args); + fail("test should throw an exception"); + } catch (ParseException pe) { + assertEquals("Missing argument for option: H", pe.getMessage()); + } + + try { + String[] args = + { "-p" }; + handler.parse(args); + fail("test should throw an exception"); + } catch (ParseException pe) { + assertEquals("Missing argument for option: p", pe.getMessage()); + } + + try { + String[] args = + { "-p", "12345", "-z" }; + handler.parse(args); + fail("test should throw an exception"); + } catch (ParseException pe) { + assertEquals("Unrecognized option: -z", pe.getMessage()); + } + + try { + String[] args = + { "-p", "12345", "somethingElse" }; + handler.parse(args); + fail("test should throw an exception"); + } catch (ParseException pe) { + assertEquals("too many command line arguments specified : [somethingElse]", pe.getMessage()); + } + + try { + String[] args = + { "-c" }; + handler.parse(args); + fail("test should throw an exception"); + } catch (ParseException pe) { + assertEquals("Missing argument for option: c", pe.getMessage()); + } + + try { + String[] args = + { "-H", "MyHost", "-c", "src/test/resources/parameters/unit/Valid.json" }; + EventGeneratorParameters pars = handler.parse(args); + assertEquals("MyHost", pars.getHost()); + + } catch (ParseException pe) { + fail("test should not throw an exception"); + } + + try { + String[] args = + { "-c", "src/test/resources/parameters/unit/NonExistant.json" }; + handler.parse(args); + fail("test should throw an exception"); + } catch (ParseException pe) { + assertEquals("Could not read parameters from configuration file " + + "\"src/test/resources/parameters/unit/NonExistant.json\": " + + "src/test/resources/parameters/unit/NonExistant.json", pe.getMessage()); + } + + try { + String[] args = + { "-c", "src/test/resources/parameters/unit/BadHost.json" }; + handler.parse(args); + fail("test should throw an exception"); + } catch (ParseException pe) { + assertEquals("Error parsing JSON parameters from configuration file " + + "\"src/test/resources/parameters/unit/BadHost.json\": " + + "com.google.gson.stream.MalformedJsonException: " + + "Unexpected value at line 3 column 14 path $.host", pe.getMessage()); + } + + try { + String[] args = + { "-c", "src/test/resources/parameters/unit/BadPort.json" }; + handler.parse(args); + fail("test should throw an exception"); + } catch (ParseException pe) { + assertEquals("Error parsing JSON parameters from configuration file " + + "\"src/test/resources/parameters/unit/BadPort.json\": " + + "java.lang.IllegalStateException: Expected an int " + + "but was BOOLEAN at line 4 column 18 path $.port", pe.getMessage()); + } + + try { + String[] args = + { "-c", "src/test/resources/parameters/unit/Empty.json" }; + handler.parse(args); + fail("test should throw an exception"); + } catch (ParseException pe) { + assertEquals("No parameters found in configuration file " + + "\"src/test/resources/parameters/unit/Empty.json\"", pe.getMessage()); + } + + try { + String[] args = + { "-c", "src/test/resources/parameters/unit/NullHost.json" }; + handler.parse(args); + fail("test should throw an exception"); + } catch (ParseException pe) { + assertEquals("specified parameters are not valid: parameter group \"ValidPars\" " + + "type \"org.onap.policy.apex.testsuites.performance." + + "benchmark.eventgenerator.EventGeneratorParameters\" INVALID, " + + "parameter group has status INVALID\n" + " field \"host\" type \"java.lang.String\" " + + "value \"null\" INVALID, host must be a non-blank string\n", pe.getMessage()); + } + + try { + String[] args = + { "-p", "1023" }; + handler.parse(args); + fail("test should throw an exception"); + } catch (ParseException pe) { + assertEquals("specified parameters are not valid: parameter group \"" + + "EventGeneratorParameters\" type \"org.onap.policy.apex.testsuites.performance.benchmark." + + "eventgenerator.EventGeneratorParameters\" INVALID, parameter group has status INVALID\n" + + " field \"port\" type \"int\" value \"1023\" INVALID, " + + "port must be an integer between 1024 and 65535 inclusive\n" + "", pe.getMessage()); + } + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParametersTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParametersTest.java new file mode 100644 index 000000000..1071c2f8e --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParametersTest.java @@ -0,0 +1,71 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; +import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.EventGeneratorParameters; + +/** + * Test event generator parameters. + */ +public class EventGeneratorParametersTest { + + @Test + public void testEventGeneratorParameters() { + EventGeneratorParameters parameters = new EventGeneratorParameters(); + + parameters.setName("TheName"); + assertEquals("TheName", parameters.getName()); + + parameters.setHost("TheHost"); + assertEquals("TheHost", parameters.getHost()); + + parameters.setPort(12345); + assertEquals(12345, parameters.getPort()); + + assertTrue(parameters.isValid()); + + parameters.setName(null); + assertFalse(parameters.isValid()); + parameters.setName(" "); + assertFalse(parameters.isValid()); + parameters.setName("TheName"); + assertTrue(parameters.isValid()); + + parameters.setHost(null); + assertFalse(parameters.isValid()); + parameters.setHost(" "); + assertFalse(parameters.isValid()); + parameters.setHost("TheHost"); + assertTrue(parameters.isValid()); + + parameters.setPort(1023); + assertFalse(parameters.isValid()); + parameters.setPort(65536); + assertFalse(parameters.isValid()); + parameters.setPort(12345); + assertTrue(parameters.isValid()); + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorStatsTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorStatsTest.java new file mode 100644 index 000000000..a40bcb5f1 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorStatsTest.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import java.util.LinkedHashMap; +import java.util.Map; + +import org.junit.Test; + +/** + * Test the EventGeneratorStats class. + * + */ +public class EventGeneratorStatsTest { + @Test + public void testEventGeneratorStats() { + Map<Integer, EventBatch> batchMap = new LinkedHashMap<>(); + EventGeneratorStats egs = new EventGeneratorStats(batchMap ); + assertNotNull(egs); + + assertEquals(-1, egs.getTotalStats().getBatchNumber()); + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorTest.java new file mode 100644 index 000000000..e37ea963c --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorTest.java @@ -0,0 +1,160 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.PrintStream; + +import org.junit.Test; +import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities; +import org.onap.policy.apex.model.basicmodel.concepts.ApexException; +import org.onap.policy.apex.service.engine.main.ApexMain; +import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.EventGenerator; +import org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.EventGeneratorParameters; + +/** + * This class tests the event generator. + */ +public class EventGeneratorTest { + private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); + + private final PrintStream stdout = System.out; + + /** + * Test event generation. + * + * @throws ApexException on Apex exceptions + */ + @Test + public void testEventGeneration() throws ApexException { + EventGeneratorParameters pars = new EventGeneratorParameters(); + pars.setBatchCount(1); + pars.setBatchSize(10); + + EventGenerator eventGenerator = new EventGenerator(pars); + + final String[] args = + { "-rfr", "target", "-c", "target/examples/config/SampleDomain/REST2RESTJsonEventJavascript.json" }; + + final ApexMain apexMain = new ApexMain(args); + + while (!eventGenerator.isFinished()) { + ThreadUtilities.sleep(200); + } + + apexMain.shutdown(); + + ThreadUtilities.sleep(5000); + eventGenerator.tearDown(); + + assertTrue(eventGenerator.getEventGenerationStats().contains("\"apexClient\": \"TOTAL\"")); + } + + @Test + public void testEventGeneratorBadParams() { + System.setOut(new PrintStream(outContent)); + + final String[] args = + { "-zzz" }; + + EventGenerator.main(args); + + final String outString = outContent.toString(); + + System.setOut(stdout); + + assertTrue(outString.contains("Start of event generator failed: Unrecognized option: -zzz")); + } + + @Test + public void testEventGeneratorHelp() { + System.setOut(new PrintStream(outContent)); + + final String[] args = { + "-h" + }; + + EventGenerator.main(args); + + final String outString = outContent.toString(); + + System.setOut(stdout); + + assertTrue(outString.contains("outputs the usage of this command")); + } + + @Test + public void testEventGeneratorStart() { + + System.setOut(new PrintStream(outContent)); + + (new Thread() { + public void run() { + EventGenerator.main(null); + } + }).start(); + + ThreadUtilities.sleep(1000); + final String outString = outContent.toString(); + + System.setOut(stdout); + + assertTrue(outString.contains("Event generator started")); + assertTrue(outString.contains("Event generator shut down")); + } + + @Test + public void testEventGeneratorOutfileGood() { + EventGeneratorParameters pars =new EventGeneratorParameters(); + pars.setOutFile("target/statsOutFile.json"); + + EventGenerator generator = new EventGenerator(pars); + assertNotNull(generator); + + generator.tearDown(); + + File outFile = new File("target/statsOutFile.json"); + assertTrue(outFile.exists()); + outFile.delete(); + } + + @Test + public void testEventGeneratorOutfileBad() { + EventGeneratorParameters pars = new EventGeneratorParameters(); + pars.setOutFile("/I/Dont/Exist"); + + EventGenerator generator = new EventGenerator(pars); + assertNotNull(generator); + + System.setOut(new PrintStream(outContent)); + + generator.tearDown(); + + final String outString = outContent.toString(); + System.setOut(stdout); + + assertTrue(outString.contains("could not output statistics to file \"/I/Dont/Exist\"")); + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/events/InputEventTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/events/InputEventTest.java new file mode 100644 index 000000000..82b4cca88 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/events/InputEventTest.java @@ -0,0 +1,68 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import org.junit.Test; + +/** + * Test the InputEvent class. + * + */ +public class InputEventTest { + + @Test + public void testInputEvent() { + InputEvent ie = new InputEvent(); + assertNotNull(ie); + + ie.setName("EventName"); + assertEquals("EventName", ie.getName()); + + ie.setNameSpace("a.b.c.d"); + assertEquals("a.b.c.d", ie.getNameSpace()); + + ie.setSource("Source"); + assertEquals("Source", ie.getSource()); + + ie.setTarget("Target"); + assertEquals("Target", ie.getTarget()); + + ie.setTestMatchCase(123); + assertEquals(123, ie.getTestMatchCase()); + + ie.setTestSlogan("A Slogan"); + assertEquals("A Slogan", ie.getTestSlogan()); + + ie.setTestTemperature(123.45); + assertEquals((Double)123.45, (Double)ie.getTestTemperature()); + + ie.setTestTimestamp(1234567879); + assertEquals(1234567879, ie.getTestTimestamp()); + + ie.setVersion("1.2.3"); + assertEquals("1.2.3", ie.getVersion()); + + assertEquals("\"nameSpace\": \"a.b.c.d\",", ie.asJson().substring(4, 27)); + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/events/OutputEventTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/events/OutputEventTest.java new file mode 100644 index 000000000..8af87ddbd --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/events/OutputEventTest.java @@ -0,0 +1,70 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator.events; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import org.junit.Test; + +/** + * Test the OutputEvent class. + * + */ +public class OutputEventTest { + + @Test + public void test() { + OutputEvent oe = new OutputEvent(); + assertNotNull(oe); + + oe.setTestMatchCaseSelected(32112); + assertEquals(32112, oe.getTestMatchCaseSelected()); + + oe.setTestMatchStateTime(34455778822L); + assertEquals(34455778822L, oe.getTestMatchStateTime()); + + oe.setTestEstablishCaseSelected(1321); + assertEquals(1321, oe.getTestEstablishCaseSelected()); + + oe.setTestEstablishStateTime(13445566778822L); + assertEquals(13445566778822L, oe.getTestEstablishStateTime()); + + oe.setTestDecideCaseSelected(321); + assertEquals(321, oe.getTestDecideCaseSelected()); + + oe.setTestDecideStateTime(3445566778822L); + assertEquals(3445566778822L, oe.getTestDecideStateTime()); + + oe.setTestActCaseSelected(332); + assertEquals(332, oe.getTestActCaseSelected()); + + oe.setTestActStateTime(34455667788L); + assertEquals(34455667788L, oe.getTestActStateTime()); + + oe.setTestReceviedTimestamp(134455667788222L); + assertEquals(134455667788222L, oe.getTestReceviedTimestamp()); + + oe.setTestSlogan("0-0: Whatever"); + assertEquals(0, oe.findBatchNumber()); + assertEquals(0, oe.findEventNumber()); + } +} diff --git a/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/BadHost.json b/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/BadHost.json new file mode 100644 index 000000000..473bbd28e --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/BadHost.json @@ -0,0 +1,5 @@ +{ + "name": "ValidPars", + "host": , + "port": 54321 +}
\ No newline at end of file diff --git a/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/BadPort.json b/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/BadPort.json new file mode 100644 index 000000000..a2a6607ec --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/BadPort.json @@ -0,0 +1,5 @@ +{ + "name": "ValidPars", + "host": "FileHost", + "port": false +}
\ No newline at end of file diff --git a/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/Default.json b/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/Default.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/Default.json @@ -0,0 +1 @@ +{}
\ No newline at end of file diff --git a/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/Empty.json b/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/Empty.json new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/Empty.json diff --git a/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/NullHost.json b/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/NullHost.json new file mode 100644 index 000000000..34ac4ca0a --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/NullHost.json @@ -0,0 +1,5 @@ +{ + "name": "ValidPars", + "host": null, + "port": 54321 +}
\ No newline at end of file diff --git a/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/Valid.json b/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/Valid.json new file mode 100644 index 000000000..c52d859f8 --- /dev/null +++ b/testsuites/performance/performance-benchmark-test/src/test/resources/parameters/unit/Valid.json @@ -0,0 +1,5 @@ +{ + "name": "ValidPars", + "host": "FileHost", + "port": 54321 +}
\ No newline at end of file diff --git a/testsuites/performance/performance-benchmark-test/src/test/resources/policymodels/SamplePolicyModelMVEL.json b/testsuites/performance/performance-benchmark-test/src/test/resources/policymodels/SamplePolicyModelMVEL.json deleted file mode 100644 index 95ea511b1..000000000 --- a/testsuites/performance/performance-benchmark-test/src/test/resources/policymodels/SamplePolicyModelMVEL.json +++ /dev/null @@ -1,7372 +0,0 @@ -{ - "apexPolicyModel": { - "key": { - "name": "SamplePolicyModelMVEL", - "version": "0.0.1" - }, - "keyInformation": { - "key": { - "name": "KeyInformation", - "version": "0.0.1" - }, - "keyInfoMap": { - "entry": [ - { - "key": { - "name": "Context", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Context", - "version": "0.0.1" - }, - "UUID": "ca36bfd8-6042-3633-8c85-89c66507c3bf", - "description": "Generated description for concept referred to by key \"Context:0.0.1\"" - } - }, - { - "key": { - "name": "Event0000", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0000", - "version": "0.0.1" - }, - "UUID": "465a81cc-885f-3a4d-bc4e-1508da92b236", - "description": "Generated description for concept referred to by key \"Event0000:0.0.1\"" - } - }, - { - "key": { - "name": "Event0001", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0001", - "version": "0.0.1" - }, - "UUID": "36b2d570-fff7-3a4b-bab2-6bf492f5129a", - "description": "Generated description for concept referred to by key \"Event0001:0.0.1\"" - } - }, - { - "key": { - "name": "Event0002", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0002", - "version": "0.0.1" - }, - "UUID": "ff6160a7-fb5e-379c-a6d2-2cd28053eacf", - "description": "Generated description for concept referred to by key \"Event0002:0.0.1\"" - } - }, - { - "key": { - "name": "Event0003", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0003", - "version": "0.0.1" - }, - "UUID": "5899e216-2abf-3781-abc4-2c257b92721e", - "description": "Generated description for concept referred to by key \"Event0003:0.0.1\"" - } - }, - { - "key": { - "name": "Event0004", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0004", - "version": "0.0.1" - }, - "UUID": "7c2692a7-4587-3d09-abf9-d96b339a316f", - "description": "Generated description for concept referred to by key \"Event0004:0.0.1\"" - } - }, - { - "key": { - "name": "Event0100", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0100", - "version": "0.0.1" - }, - "UUID": "b696048c-c0b0-34c1-8dbe-32ab6c8bc0c7", - "description": "Generated description for concept referred to by key \"Event0100:0.0.1\"" - } - }, - { - "key": { - "name": "Event0101", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0101", - "version": "0.0.1" - }, - "UUID": "edbfa868-2ab2-30fd-8078-4c7f67ca6122", - "description": "Generated description for concept referred to by key \"Event0101:0.0.1\"" - } - }, - { - "key": { - "name": "Event0102", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0102", - "version": "0.0.1" - }, - "UUID": "6b6ad2ff-ef63-3f7b-aabb-fba44f8de9d4", - "description": "Generated description for concept referred to by key \"Event0102:0.0.1\"" - } - }, - { - "key": { - "name": "Event0103", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0103", - "version": "0.0.1" - }, - "UUID": "c2550912-10d9-3000-8826-377288cd6cb1", - "description": "Generated description for concept referred to by key \"Event0103:0.0.1\"" - } - }, - { - "key": { - "name": "Event0104", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0104", - "version": "0.0.1" - }, - "UUID": "f6d75b71-c8a7-3337-a121-88d68c389f5a", - "description": "Generated description for concept referred to by key \"Event0104:0.0.1\"" - } - }, - { - "key": { - "name": "Events", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Events", - "version": "0.0.1" - }, - "UUID": "0215644c-4531-375c-8335-d558b4de8c03", - "description": "Generated description for concept referred to by key \"Events:0.0.1\"" - } - }, - { - "key": { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - "UUID": "976a79e7-5c80-3c03-9503-da3f41fec395", - "description": "Generated description for concept referred to by key \"ExternalContextAlbum:0.0.1\"" - } - }, - { - "key": { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - "UUID": "c95e9e5f-d2c7-3ac7-a205-ea3574530cb7", - "description": "Generated description for concept referred to by key \"GlobalContextAlbum:0.0.1\"" - } - }, - { - "key": { - "name": "KeyInformation", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "KeyInformation", - "version": "0.0.1" - }, - "UUID": "1ff2f905-685c-3caf-95bc-0bbc90345888", - "description": "Generated description for concept referred to by key \"KeyInformation:0.0.1\"" - } - }, - { - "key": { - "name": "Policies", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Policies", - "version": "0.0.1" - }, - "UUID": "f54c3b2b-be76-31c4-adfc-87c494c06808", - "description": "Generated description for concept referred to by key \"Policies:0.0.1\"" - } - }, - { - "key": { - "name": "Policy0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Policy0", - "version": "0.0.1" - }, - "UUID": "3410e939-30ca-32c4-a2d8-c30b6fee6eec", - "description": "Generated description for concept referred to by key \"Policy0:0.0.1\"" - } - }, - { - "key": { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - }, - "UUID": "e27564c4-3cbf-3db2-9bf3-83ae80a2f907", - "description": "Generated description for concept referred to by key \"Policy0ContextAlbum:0.0.1\"" - } - }, - { - "key": { - "name": "Policy1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Policy1", - "version": "0.0.1" - }, - "UUID": "d0b2b585-f344-33b8-af9e-250e7f4cfbce", - "description": "Generated description for concept referred to by key \"Policy1:0.0.1\"" - } - }, - { - "key": { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - }, - "UUID": "815d74ae-6fc0-3221-87b9-2bb1dfdfa7f0", - "description": "Generated description for concept referred to by key \"Policy1ContextAlbum:0.0.1\"" - } - }, - { - "key": { - "name": "SamplePolicyModelMVEL", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "SamplePolicyModelMVEL", - "version": "0.0.1" - }, - "UUID": "a4cc4860-0bbc-389c-b270-e1bf7daffbe2", - "description": "Generated description for concept referred to by key \"SamplePolicyModelMVEL:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Act0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Act0", - "version": "0.0.1" - }, - "UUID": "0589ff20-adcc-3ce5-95fe-8d7978ed54ed", - "description": "Generated description for concept referred to by key \"Task_Act0:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Act1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Act1", - "version": "0.0.1" - }, - "UUID": "095b126d-ca8b-32c9-ad52-d744e817a79c", - "description": "Generated description for concept referred to by key \"Task_Act1:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Act2", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Act2", - "version": "0.0.1" - }, - "UUID": "3d786b4c-d9ee-3367-ab71-c67271a4ea2f", - "description": "Generated description for concept referred to by key \"Task_Act2:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Act3", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Act3", - "version": "0.0.1" - }, - "UUID": "9231753e-20c5-3436-982f-9100340cc570", - "description": "Generated description for concept referred to by key \"Task_Act3:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Decide0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Decide0", - "version": "0.0.1" - }, - "UUID": "502383d3-483f-3a56-a426-2f0406674c8d", - "description": "Generated description for concept referred to by key \"Task_Decide0:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Decide1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Decide1", - "version": "0.0.1" - }, - "UUID": "16598106-41c8-3b5a-99c6-5fcf6d1a5ddf", - "description": "Generated description for concept referred to by key \"Task_Decide1:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Decide2", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Decide2", - "version": "0.0.1" - }, - "UUID": "ad3a89f5-e369-3c66-b22c-669f7b3653b8", - "description": "Generated description for concept referred to by key \"Task_Decide2:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Decide3", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Decide3", - "version": "0.0.1" - }, - "UUID": "56815939-1164-3867-9ed1-0a27ff8aafb3", - "description": "Generated description for concept referred to by key \"Task_Decide3:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Establish0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Establish0", - "version": "0.0.1" - }, - "UUID": "0db0c566-ecd7-3e27-9865-4b82c893abdb", - "description": "Generated description for concept referred to by key \"Task_Establish0:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Establish1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Establish1", - "version": "0.0.1" - }, - "UUID": "6944a4c1-6201-317c-8d7e-eaa7f2ee0ea0", - "description": "Generated description for concept referred to by key \"Task_Establish1:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Establish2", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Establish2", - "version": "0.0.1" - }, - "UUID": "0f766ea9-11cd-3e7d-a8c8-28c8dee6a85a", - "description": "Generated description for concept referred to by key \"Task_Establish2:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Establish3", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Establish3", - "version": "0.0.1" - }, - "UUID": "c3237a38-cc6d-3418-b1e1-0dc8b4bdcc66", - "description": "Generated description for concept referred to by key \"Task_Establish3:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Match0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Match0", - "version": "0.0.1" - }, - "UUID": "051bcfd5-cf73-3c89-8ee7-ea6e005ec059", - "description": "Generated description for concept referred to by key \"Task_Match0:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Match1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Match1", - "version": "0.0.1" - }, - "UUID": "3754fe19-98f2-34a1-9f45-db31052208d8", - "description": "Generated description for concept referred to by key \"Task_Match1:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Match2", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Match2", - "version": "0.0.1" - }, - "UUID": "8c200709-a180-3c8b-916f-275ff49ce194", - "description": "Generated description for concept referred to by key \"Task_Match2:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Match3", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Match3", - "version": "0.0.1" - }, - "UUID": "a1a879c6-4510-33b0-bbd0-ad6256189a37", - "description": "Generated description for concept referred to by key \"Task_Match3:0.0.1\"" - } - }, - { - "key": { - "name": "Tasks", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Tasks", - "version": "0.0.1" - }, - "UUID": "a7fab96b-ce1c-37ce-bbb2-556b6db524a5", - "description": "Generated description for concept referred to by key \"Tasks:0.0.1\"" - } - }, - { - "key": { - "name": "TestCase", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestCase", - "version": "0.0.1" - }, - "UUID": "0a652886-c88d-3f8c-8994-ae9161e7c963", - "description": "Generated description for concept referred to by key \"TestCase:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem000", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem000", - "version": "0.0.1" - }, - "UUID": "8efba9fa-371e-33df-a7d6-88b0284e7fd0", - "description": "Generated description for concept referred to by key \"TestContextItem000:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem001", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem001", - "version": "0.0.1" - }, - "UUID": "3740077c-a2b3-356b-81dc-5ded2118a951", - "description": "Generated description for concept referred to by key \"TestContextItem001:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem002", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem002", - "version": "0.0.1" - }, - "UUID": "b5c7df95-9af5-322f-9ea8-eb440a2bf926", - "description": "Generated description for concept referred to by key \"TestContextItem002:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem003", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem003", - "version": "0.0.1" - }, - "UUID": "b36f0aa5-0fb9-3e2c-8fa2-fddb7fd05f4b", - "description": "Generated description for concept referred to by key \"TestContextItem003:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem004", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem004", - "version": "0.0.1" - }, - "UUID": "093cda11-eaeb-3a46-a5b6-d5e30c00935b", - "description": "Generated description for concept referred to by key \"TestContextItem004:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem005", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem005", - "version": "0.0.1" - }, - "UUID": "569a758d-ba40-37c0-aebb-7ad138df25ac", - "description": "Generated description for concept referred to by key \"TestContextItem005:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem006", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem006", - "version": "0.0.1" - }, - "UUID": "252818d9-b61f-3962-a905-8865fb00fb04", - "description": "Generated description for concept referred to by key \"TestContextItem006:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem007", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem007", - "version": "0.0.1" - }, - "UUID": "fe1a5f7c-c083-377b-a797-752b01fc6c73", - "description": "Generated description for concept referred to by key \"TestContextItem007:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem008", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem008", - "version": "0.0.1" - }, - "UUID": "aa87d007-d07e-3f67-8c6d-0ebc3d85479d", - "description": "Generated description for concept referred to by key \"TestContextItem008:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem009", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem009", - "version": "0.0.1" - }, - "UUID": "126e7a3a-11b6-3f88-9397-c21d8819f859", - "description": "Generated description for concept referred to by key \"TestContextItem009:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem00A", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem00A", - "version": "0.0.1" - }, - "UUID": "0e0e3dec-e03d-3379-a87b-1ecd4aa3d8cc", - "description": "Generated description for concept referred to by key \"TestContextItem00A:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem00B", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem00B", - "version": "0.0.1" - }, - "UUID": "dbdc98df-3ff4-360c-b8d3-a7a836ac3de6", - "description": "Generated description for concept referred to by key \"TestContextItem00B:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem00C", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem00C", - "version": "0.0.1" - }, - "UUID": "32a2f355-77f3-3b25-ace6-7a9c5763a5ad", - "description": "Generated description for concept referred to by key \"TestContextItem00C:0.0.1\"" - } - }, - { - "key": { - "name": "TestDatatypes", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestDatatypes", - "version": "0.0.1" - }, - "UUID": "3f95472c-973e-30e2-95f1-bf00cbef909a", - "description": "Generated description for concept referred to by key \"TestDatatypes:0.0.1\"" - } - }, - { - "key": { - "name": "TestExternalContextItem", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestExternalContextItem", - "version": "0.0.1" - }, - "UUID": "610dbbd4-9149-3b3c-9af4-819056f0e169", - "description": "Generated description for concept referred to by key \"TestExternalContextItem:0.0.1\"" - } - }, - { - "key": { - "name": "TestGlobalContextItem", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestGlobalContextItem", - "version": "0.0.1" - }, - "UUID": "07fa8f68-55f1-3fd0-81c1-749a379753a7", - "description": "Generated description for concept referred to by key \"TestGlobalContextItem:0.0.1\"" - } - }, - { - "key": { - "name": "TestPolicyContextItem", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestPolicyContextItem", - "version": "0.0.1" - }, - "UUID": "d9c93cd1-539e-35c5-aaec-bb711ceb1251", - "description": "Generated description for concept referred to by key \"TestPolicyContextItem:0.0.1\"" - } - }, - { - "key": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "UUID": "683fe492-7eae-3ac7-9924-bb7850208d05", - "description": "Generated description for concept referred to by key \"TestSlogan:0.0.1\"" - } - }, - { - "key": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "UUID": "bba25b6f-e3cd-3060-9022-4ef3a79f8eb0", - "description": "Generated description for concept referred to by key \"TestTemperature:0.0.1\"" - } - }, - { - "key": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "UUID": "97b73937-c344-33c0-924c-4d26b6449564", - "description": "Generated description for concept referred to by key \"TestTimestamp:0.0.1\"" - } - } - ] - } - }, - "policies": { - "key": { - "name": "Policies", - "version": "0.0.1" - }, - "policyMap": { - "entry": [ - { - "key": { - "name": "Policy0", - "version": "0.0.1" - }, - "value": { - "policyKey": { - "name": "Policy0", - "version": "0.0.1" - }, - "template": "MEDA", - "state": { - "entry": [ - { - "key": "Act", - "value": { - "stateKey": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Act" - }, - "trigger": { - "name": "Event0003", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "Act_NULL", - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - }, - "outgoingEvent": { - "name": "Event0004", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "NULL", - "parentKeyVersion": "0.0.0", - "parentLocalName": "NULL", - "localName": "NULL" - } - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - } - ], - "taskSelectionLogic": { - "key": "TaskSelectionLigic", - "logicFlavour": "MVEL", - "logic": "logger.debug(subject.id + \":\" + subject.stateName);\nsubject.defaultTaskKey.copyTo(selectedTask);\nreturn true;" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "Task_Act1", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "Task_Act0", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Task_Act0_DIRECT_Act_NULL" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - } - } - }, - { - "key": { - "name": "Task_Act1", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Task_Act1_DIRECT_Act_NULL" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - } - } - }, - { - "key": { - "name": "Task_Act2", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Task_Act2_DIRECT_Act_NULL" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - } - } - }, - { - "key": { - "name": "Task_Act3", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Task_Act3_DIRECT_Act_NULL" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - } - } - } - ] - } - } - }, - { - "key": "Decide", - "value": { - "stateKey": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Decide" - }, - "trigger": { - "name": "Event0002", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "Decide_Act", - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - }, - "outgoingEvent": { - "name": "Event0003", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Act" - } - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - } - ], - "taskSelectionLogic": { - "key": "TaskSelectionLigic", - "logicFlavour": "MVEL", - "logic": "logger.debug(subject.id + \":\" + subject.stateName);\nsubject.defaultTaskKey.copyTo(selectedTask);\nreturn true;" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "Task_Decide3", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "Task_Decide0", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Task_Decide0_DIRECT_Decide_Act" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - } - } - }, - { - "key": { - "name": "Task_Decide1", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Task_Decide1_DIRECT_Decide_Act" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - } - } - }, - { - "key": { - "name": "Task_Decide2", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Task_Decide2_DIRECT_Decide_Act" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - } - } - }, - { - "key": { - "name": "Task_Decide3", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Task_Decide3_DIRECT_Decide_Act" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - } - } - } - ] - } - } - }, - { - "key": "Establish", - "value": { - "stateKey": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Establish" - }, - "trigger": { - "name": "Event0001", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "Establish_Decide", - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - }, - "outgoingEvent": { - "name": "Event0002", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Decide" - } - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskSelectionLogic": { - "key": "TaskSelectionLigic", - "logicFlavour": "MVEL", - "logic": "logger.debug(subject.id + \":\" + subject.stateName);\nsubject.defaultTaskKey.copyTo(selectedTask);\nreturn true;" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "Task_Establish2", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "Task_Establish0", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Task_Establish0_DIRECT_Establish_Decide" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - } - } - }, - { - "key": { - "name": "Task_Establish1", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Task_Establish1_DIRECT_Establish_Decide" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - } - } - }, - { - "key": { - "name": "Task_Establish2", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Task_Establish2_DIRECT_Establish_Decide" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - } - } - }, - { - "key": { - "name": "Task_Establish3", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Task_Establish3_DIRECT_Establish_Decide" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - } - } - } - ] - } - } - }, - { - "key": "Match", - "value": { - "stateKey": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Match" - }, - "trigger": { - "name": "Event0000", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "Match_Establish", - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - }, - "outgoingEvent": { - "name": "Event0001", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Establish" - } - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - } - ], - "taskSelectionLogic": { - "key": "TaskSelectionLigic", - "logicFlavour": "MVEL", - "logic": "logger.debug(subject.id + \":\" + subject.stateName);\nsubject.defaultTaskKey.copyTo(selectedTask);\nreturn true;" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "Task_Match0", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "Task_Match0", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Task_Match0_DIRECT_Match_Establish" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - } - } - }, - { - "key": { - "name": "Task_Match1", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Task_Match1_DIRECT_Match_Establish" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - } - } - }, - { - "key": { - "name": "Task_Match2", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Task_Match2_DIRECT_Match_Establish" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - } - } - }, - { - "key": { - "name": "Task_Match3", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Task_Match3_DIRECT_Match_Establish" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - } - } - } - ] - } - } - } - ] - }, - "firstState": "Match" - } - }, - { - "key": { - "name": "Policy1", - "version": "0.0.1" - }, - "value": { - "policyKey": { - "name": "Policy1", - "version": "0.0.1" - }, - "template": "MEDA", - "state": { - "entry": [ - { - "key": "Act", - "value": { - "stateKey": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Act" - }, - "trigger": { - "name": "Event0103", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "Act_NULL", - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - }, - "outgoingEvent": { - "name": "Event0104", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "NULL", - "parentKeyVersion": "0.0.0", - "parentLocalName": "NULL", - "localName": "NULL" - } - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - } - ], - "taskSelectionLogic": { - "key": "TaskSelectionLigic", - "logicFlavour": "MVEL", - "logic": "logger.debug(subject.id + \":\" + subject.stateName);\nsubject.defaultTaskKey.copyTo(selectedTask);\nreturn true;" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "Task_Act0", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "Task_Act0", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Task_Act0_DIRECT_Act_NULL" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - } - } - }, - { - "key": { - "name": "Task_Act1", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Task_Act1_DIRECT_Act_NULL" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - } - } - }, - { - "key": { - "name": "Task_Act2", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Task_Act2_DIRECT_Act_NULL" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - } - } - }, - { - "key": { - "name": "Task_Act3", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Task_Act3_DIRECT_Act_NULL" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - } - } - } - ] - } - } - }, - { - "key": "Decide", - "value": { - "stateKey": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Decide" - }, - "trigger": { - "name": "Event0102", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "Decide_Act", - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - }, - "outgoingEvent": { - "name": "Event0103", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Act" - } - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskSelectionLogic": { - "key": "TaskSelectionLigic", - "logicFlavour": "MVEL", - "logic": "logger.debug(subject.id + \":\" + subject.stateName);\nsubject.defaultTaskKey.copyTo(selectedTask);\nreturn true;" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "Task_Decide3", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "Task_Decide0", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Task_Decide0_DIRECT_Decide_Act" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - } - } - }, - { - "key": { - "name": "Task_Decide1", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Task_Decide1_DIRECT_Decide_Act" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - } - } - }, - { - "key": { - "name": "Task_Decide2", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Task_Decide2_DIRECT_Decide_Act" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - } - } - }, - { - "key": { - "name": "Task_Decide3", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Task_Decide3_DIRECT_Decide_Act" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - } - } - } - ] - } - } - }, - { - "key": "Establish", - "value": { - "stateKey": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Establish" - }, - "trigger": { - "name": "Event0101", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "Establish_Decide", - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - }, - "outgoingEvent": { - "name": "Event0102", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Decide" - } - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskSelectionLogic": { - "key": "TaskSelectionLigic", - "logicFlavour": "MVEL", - "logic": "logger.debug(subject.id + \":\" + subject.stateName);\nsubject.defaultTaskKey.copyTo(selectedTask);\nreturn true;" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "Task_Establish1", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "Task_Establish0", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Task_Establish0_DIRECT_Establish_Decide" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - } - } - }, - { - "key": { - "name": "Task_Establish1", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Task_Establish1_DIRECT_Establish_Decide" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - } - } - }, - { - "key": { - "name": "Task_Establish2", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Task_Establish2_DIRECT_Establish_Decide" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - } - } - }, - { - "key": { - "name": "Task_Establish3", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Task_Establish3_DIRECT_Establish_Decide" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - } - } - } - ] - } - } - }, - { - "key": "Match", - "value": { - "stateKey": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Match" - }, - "trigger": { - "name": "Event0100", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "Match_Establish", - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - }, - "outgoingEvent": { - "name": "Event0101", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Establish" - } - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskSelectionLogic": { - "key": "TaskSelectionLigic", - "logicFlavour": "MVEL", - "logic": "logger.debug(subject.id + \":\" + subject.stateName);\nsubject.defaultTaskKey.copyTo(selectedTask);\nreturn true;" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "Task_Match3", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "Task_Match0", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Task_Match0_DIRECT_Match_Establish" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - } - } - }, - { - "key": { - "name": "Task_Match1", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Task_Match1_DIRECT_Match_Establish" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - } - } - }, - { - "key": { - "name": "Task_Match2", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Task_Match2_DIRECT_Match_Establish" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - } - } - }, - { - "key": { - "name": "Task_Match3", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Task_Match3_DIRECT_Match_Establish" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - } - } - } - ] - } - } - } - ] - }, - "firstState": "Match" - } - } - ] - } - }, - "tasks": { - "key": { - "name": "Tasks", - "version": "0.0.1" - }, - "taskMap": { - "entry": [ - { - "key": { - "name": "Task_Act0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Act0", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestActCaseSelected", - "value": { - "key": "TestActCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestActStateTime", - "value": { - "key": "TestActStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Act0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - }, - { - "key": "Parameter1", - "value": { - "key": { - "parentKeyName": "Task_Act0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter1" - }, - "defaultValue": "DefaultValue1" - } - }, - { - "key": "Parameter2", - "value": { - "key": { - "parentKeyName": "Task_Act0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter2" - }, - "defaultValue": "DefaultValue2" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "MVEL", - "logic": "import java.util.Date;\nlogger.debug(subject.id);\ngc = getContextAlbum(\"GlobalContextAlbum\");\nlogger.debug(gc);\nlogger.debug(inFields);\noutFields[\"TestActCaseSelected\"] = (byte)2;\ntimeNow = new Date();\noutFields[\"TestActStateTime\"] = timeNow.getTime();\nlogger.debug(outFields);\nreturn true;" - } - } - }, - { - "key": { - "name": "Task_Act1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Act1", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestActCaseSelected", - "value": { - "key": "TestActCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestActStateTime", - "value": { - "key": "TestActStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Act1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - }, - { - "key": "Parameter1", - "value": { - "key": { - "parentKeyName": "Task_Act1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter1" - }, - "defaultValue": "DefaultValue1" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "MVEL", - "logic": "import java.util.Date;\nlogger.debug(subject.id);\ngc = getContextAlbum(\"GlobalContextAlbum\");\nlogger.debug(gc);\nlogger.debug(inFields);\noutFields[\"TestActCaseSelected\"] = (byte)3;\ntimeNow = new Date();\noutFields[\"TestActStateTime\"] = timeNow.getTime();\nlogger.debug(outFields);\nreturn true;" - } - } - }, - { - "key": { - "name": "Task_Act2", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Act2", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestActCaseSelected", - "value": { - "key": "TestActCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestActStateTime", - "value": { - "key": "TestActStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Act2", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "MVEL", - "logic": "import java.util.Date;\nlogger.debug(subject.id);\ngc = getContextAlbum(\"GlobalContextAlbum\");\nlogger.debug(gc);\nlogger.debug(inFields);\noutFields[\"TestActCaseSelected\"] = (byte)0;\ntimeNow = new Date();\noutFields[\"TestActStateTime\"] = timeNow.getTime();\nlogger.debug(outFields);\nreturn true;" - } - } - }, - { - "key": { - "name": "Task_Act3", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Act3", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestActCaseSelected", - "value": { - "key": "TestActCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestActStateTime", - "value": { - "key": "TestActStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Act3", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "MVEL", - "logic": "import java.util.Date;\nlogger.debug(subject.id);\ngc = getContextAlbum(\"GlobalContextAlbum\");\nlogger.debug(gc);\nlogger.debug(inFields);\noutFields[\"TestActCaseSelected\"] = (byte)1;\ntimeNow = new Date();\noutFields[\"TestActStateTime\"] = timeNow.getTime();\nlogger.debug(outFields);\nreturn true;" - } - } - }, - { - "key": { - "name": "Task_Decide0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Decide0", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Decide0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - }, - { - "key": "Parameter1", - "value": { - "key": { - "parentKeyName": "Task_Decide0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter1" - }, - "defaultValue": "DefaultValue1" - } - }, - { - "key": "Parameter2", - "value": { - "key": { - "parentKeyName": "Task_Decide0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter2" - }, - "defaultValue": "DefaultValue2" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "MVEL", - "logic": "import java.util.Date;\nlogger.debug(subject.id);\ngc = getContextAlbum(\"GlobalContextAlbum\");\nlogger.debug(gc);\nlogger.debug(inFields);\noutFields[\"TestDecideCaseSelected\"] = (byte)2;\ntimeNow = new Date();\noutFields[\"TestDecideStateTime\"] = timeNow.getTime();\nlogger.debug(outFields);\nreturn true;" - } - } - }, - { - "key": { - "name": "Task_Decide1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Decide1", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Decide1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - }, - { - "key": "Parameter1", - "value": { - "key": { - "parentKeyName": "Task_Decide1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter1" - }, - "defaultValue": "DefaultValue1" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "MVEL", - "logic": "import java.util.Date;\nlogger.debug(subject.id);\ngc = getContextAlbum(\"GlobalContextAlbum\");\nlogger.debug(gc);\nlogger.debug(inFields);\noutFields[\"TestDecideCaseSelected\"] = (byte)3;\ntimeNow = new Date();\noutFields[\"TestDecideStateTime\"] = timeNow.getTime();\nlogger.debug(outFields);\nreturn true;" - } - } - }, - { - "key": { - "name": "Task_Decide2", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Decide2", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Decide2", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "MVEL", - "logic": "import java.util.Date;\nlogger.debug(subject.id);\ngc = getContextAlbum(\"GlobalContextAlbum\");\nlogger.debug(gc);\nlogger.debug(inFields);\noutFields[\"TestDecideCaseSelected\"] = (byte)0;\ntimeNow = new Date();\noutFields[\"TestDecideStateTime\"] = timeNow.getTime();\nlogger.debug(outFields);\nreturn true;" - } - } - }, - { - "key": { - "name": "Task_Decide3", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Decide3", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Decide3", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "MVEL", - "logic": "import java.util.Date;\nlogger.debug(subject.id);\ngc = getContextAlbum(\"GlobalContextAlbum\");\nlogger.debug(gc);\nlogger.debug(inFields);\noutFields[\"TestDecideCaseSelected\"] = (byte)1;\ntimeNow = new Date();\noutFields[\"TestDecideStateTime\"] = timeNow.getTime();\nlogger.debug(outFields);\nreturn true;" - } - } - }, - { - "key": { - "name": "Task_Establish0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Establish0", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Establish0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - }, - { - "key": "Parameter1", - "value": { - "key": { - "parentKeyName": "Task_Establish0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter1" - }, - "defaultValue": "DefaultValue1" - } - }, - { - "key": "Parameter2", - "value": { - "key": { - "parentKeyName": "Task_Establish0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter2" - }, - "defaultValue": "DefaultValue2" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "MVEL", - "logic": "import java.util.Date;\nlogger.debug(subject.id);\ngc = getContextAlbum(\"GlobalContextAlbum\");\nlogger.debug(gc);\nlogger.debug(inFields);\noutFields[\"TestEstablishCaseSelected\"] = (byte)2;\ntimeNow = new Date();\noutFields[\"TestEstablishStateTime\"] = timeNow.getTime();\nlogger.debug(outFields);\nreturn true;" - } - } - }, - { - "key": { - "name": "Task_Establish1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Establish1", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Establish1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - }, - { - "key": "Parameter1", - "value": { - "key": { - "parentKeyName": "Task_Establish1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter1" - }, - "defaultValue": "DefaultValue1" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "MVEL", - "logic": "import java.util.Date;\nlogger.debug(subject.id);\ngc = getContextAlbum(\"GlobalContextAlbum\");\nlogger.debug(gc);\nlogger.debug(inFields);\noutFields[\"TestEstablishCaseSelected\"] = (byte)3;\ntimeNow = new Date();\noutFields[\"TestEstablishStateTime\"] = timeNow.getTime();\nlogger.debug(outFields);\nreturn true;" - } - } - }, - { - "key": { - "name": "Task_Establish2", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Establish2", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Establish2", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "MVEL", - "logic": "import java.util.Date;\nlogger.debug(subject.id);\ngc = getContextAlbum(\"GlobalContextAlbum\");\nlogger.debug(gc);\nlogger.debug(inFields);\noutFields[\"TestEstablishCaseSelected\"] = (byte)0;\ntimeNow = new Date();\noutFields[\"TestEstablishStateTime\"] = timeNow.getTime();\nlogger.debug(outFields);\nreturn true;" - } - } - }, - { - "key": { - "name": "Task_Establish3", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Establish3", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Establish3", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "MVEL", - "logic": "import java.util.Date;\nlogger.debug(subject.id);\ngc = getContextAlbum(\"GlobalContextAlbum\");\nlogger.debug(gc);\nlogger.debug(inFields);\noutFields[\"TestEstablishCaseSelected\"] = (byte)1;\ntimeNow = new Date();\noutFields[\"TestEstablishStateTime\"] = timeNow.getTime();\nlogger.debug(outFields);\nreturn true;" - } - } - }, - { - "key": { - "name": "Task_Match0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Match0", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Match0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - }, - { - "key": "Parameter1", - "value": { - "key": { - "parentKeyName": "Task_Match0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter1" - }, - "defaultValue": "DefaultValue1" - } - }, - { - "key": "Parameter2", - "value": { - "key": { - "parentKeyName": "Task_Match0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter2" - }, - "defaultValue": "DefaultValue2" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "MVEL", - "logic": "import java.util.Date;\nlogger.debug(subject.id);\ngc = getContextAlbum(\"GlobalContextAlbum\");\nlogger.debug(gc);\nlogger.debug(inFields);\noutFields[\"TestMatchCaseSelected\"] = (byte)2;\ntimeNow = new Date();\noutFields[\"TestMatchStateTime\"] = timeNow.getTime();\nlogger.debug(outFields);\nreturn true;" - } - } - }, - { - "key": { - "name": "Task_Match1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Match1", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Match1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - }, - { - "key": "Parameter1", - "value": { - "key": { - "parentKeyName": "Task_Match1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter1" - }, - "defaultValue": "DefaultValue1" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "MVEL", - "logic": "import java.util.Date;\nlogger.debug(subject.id);\ngc = getContextAlbum(\"GlobalContextAlbum\");\nlogger.debug(gc);\nlogger.debug(inFields);\noutFields[\"TestMatchCaseSelected\"] = (byte)3;\ntimeNow = new Date();\noutFields[\"TestMatchStateTime\"] = timeNow.getTime();\nlogger.debug(outFields);\nreturn true;" - } - } - }, - { - "key": { - "name": "Task_Match2", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Match2", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Match2", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "MVEL", - "logic": "import java.util.Date;\nlogger.debug(subject.id);\ngc = getContextAlbum(\"GlobalContextAlbum\");\nlogger.debug(gc);\nlogger.debug(inFields);\noutFields[\"TestMatchCaseSelected\"] = (byte)0;\ntimeNow = new Date();\noutFields[\"TestMatchStateTime\"] = timeNow.getTime();\nlogger.debug(outFields);\nreturn true;" - } - } - }, - { - "key": { - "name": "Task_Match3", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Match3", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Match3", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "MVEL", - "logic": "import java.util.Date;\nlogger.debug(subject.id);\ngc = getContextAlbum(\"GlobalContextAlbum\");\nlogger.debug(gc);\nlogger.debug(inFields);\noutFields[\"TestMatchCaseSelected\"] = (byte)1;\ntimeNow = new Date();\noutFields[\"TestMatchStateTime\"] = timeNow.getTime();\nlogger.debug(outFields);\nreturn true;" - } - } - } - ] - } - }, - "events": { - "key": { - "name": "Events", - "version": "0.0.1" - }, - "eventMap": { - "entry": [ - { - "key": { - "name": "Event0000", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0000", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Outside", - "target": "Match", - "parameter": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0001", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0001", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Match", - "target": "Establish", - "parameter": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0002", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0002", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Establish", - "target": "Decide", - "parameter": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0003", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0003", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Decide", - "target": "Act", - "parameter": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0004", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0004", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Act", - "target": "Outside", - "parameter": { - "entry": [ - { - "key": "TestActCaseSelected", - "value": { - "key": "TestActCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestActStateTime", - "value": { - "key": "TestActStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0100", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0100", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Outside", - "target": "Match", - "parameter": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0101", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0101", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Match", - "target": "Establish", - "parameter": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0102", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0102", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Establish", - "target": "Decide", - "parameter": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0103", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0103", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Decide", - "target": "Act", - "parameter": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0104", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0104", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Act", - "target": "Outside", - "parameter": { - "entry": [ - { - "key": "TestActCaseSelected", - "value": { - "key": "TestActCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestActStateTime", - "value": { - "key": "TestActStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - } - ] - } - }, - "albums": { - "key": { - "name": "Context", - "version": "0.0.1" - }, - "albums": { - "entry": [ - { - "key": { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - "scope": "EXTERNAL", - "isWritable": false, - "itemSchema": { - "name": "TestExternalContextItem", - "version": "0.0.1" - } - } - }, - { - "key": { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - "scope": "GLOBAL", - "isWritable": true, - "itemSchema": { - "name": "TestGlobalContextItem", - "version": "0.0.1" - } - } - }, - { - "key": { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - }, - "scope": "APPLICATION", - "isWritable": true, - "itemSchema": { - "name": "TestPolicyContextItem", - "version": "0.0.1" - } - } - }, - { - "key": { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - }, - "scope": "APPLICATION", - "isWritable": true, - "itemSchema": { - "name": "TestPolicyContextItem", - "version": "0.0.1" - } - } - } - ] - } - }, - "schemas": { - "key": { - "name": "TestDatatypes", - "version": "0.0.1" - }, - "schemas": { - "entry": [ - { - "key": { - "name": "TestCase", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestCase", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "java.lang.Byte" - } - }, - { - "key": { - "name": "TestContextItem000", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem000", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem000" - } - }, - { - "key": { - "name": "TestContextItem001", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem001", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem001" - } - }, - { - "key": { - "name": "TestContextItem002", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem002", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem002" - } - }, - { - "key": { - "name": "TestContextItem003", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem003", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem003" - } - }, - { - "key": { - "name": "TestContextItem004", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem004", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem004" - } - }, - { - "key": { - "name": "TestContextItem005", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem005", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem005" - } - }, - { - "key": { - "name": "TestContextItem006", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem006", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem006" - } - }, - { - "key": { - "name": "TestContextItem007", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem007", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem007" - } - }, - { - "key": { - "name": "TestContextItem008", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem008", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem008" - } - }, - { - "key": { - "name": "TestContextItem009", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem009", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem009" - } - }, - { - "key": { - "name": "TestContextItem00A", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem00A", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem00A" - } - }, - { - "key": { - "name": "TestContextItem00B", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem00B", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem00B" - } - }, - { - "key": { - "name": "TestContextItem00C", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem00C", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem00C" - } - }, - { - "key": { - "name": "TestExternalContextItem", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestExternalContextItem", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestExternalContextItem" - } - }, - { - "key": { - "name": "TestGlobalContextItem", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestGlobalContextItem", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestGlobalContextItem" - } - }, - { - "key": { - "name": "TestPolicyContextItem", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestPolicyContextItem", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestPolicyContextItem" - } - }, - { - "key": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "java.lang.String" - } - }, - { - "key": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "java.lang.Double" - } - }, - { - "key": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "java.lang.Long" - } - } - ] - } - } - } -} diff --git a/testsuites/performance/performance-context-metrics/src/test/resources/hazelcast/hazelcast.xml b/testsuites/performance/performance-context-metrics/src/test/resources/hazelcast/hazelcast.xml index b70bdc36e..932b33cc9 100644 --- a/testsuites/performance/performance-context-metrics/src/test/resources/hazelcast/hazelcast.xml +++ b/testsuites/performance/performance-context-metrics/src/test/resources/hazelcast/hazelcast.xml @@ -36,15 +36,15 @@ </tcp-ip> </join> <interfaces enabled="false"> - <!-- This value will allow hazelcast to run locally from the IDE --> + <!-- This value will allow hazelcast to run locally from the IDE --> <interface>127.0.0.*</interface> </interfaces> </network> <properties> <property name="hazelcast.icmp.enabled">false</property> <property name="hazelcast.logging.type">slf4j</property> - <!-- disable the hazelcast shutdown hook - prefer to control the shutdown - in code --> + <!-- disable the hazelcast shutdown hook - prefer to control the shutdown + in code --> <property name="hazelcast.shutdownhook.enabled">false</property> <property name="hazelcast.graceful.shutdown.max.wait">60</property> <property name="hazelcast.operation.generic.thread.count">1</property> diff --git a/testsuites/performance/pom.xml b/testsuites/performance/pom.xml index 95e8747ae..8682871cd 100644 --- a/testsuites/performance/pom.xml +++ b/testsuites/performance/pom.xml @@ -17,7 +17,8 @@ SPDX-License-Identifier: Apache-2.0 ============LICENSE_END========================================================= --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.policy.apex-pdp.testsuites</groupId> @@ -31,14 +32,11 @@ <profiles> <profile> - <id>apexMetrics</id> + <id>apexDefault</id> <activation> - <property> - <name>apexMetrics</name> - </property> + <activeByDefault>true</activeByDefault> </activation> <modules> - <module>performance-context-metrics</module> <module>performance-benchmark-test</module> </modules> </profile> |