aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/plugins-executor/plugins-executor-javascript/src/test/java
AgeCommit message (Collapse)AuthorFilesLines
2020-09-03Merge "Sonar Bug fixes"Pamela Dragosh1-1/+1
2020-09-03Sonar Bug fixeswaynedunican1-1/+1
Removal of remaining bugs in apex-pdp Issue-ID: POLICY-2774 Change-Id: I370796e7c8a41c116155155c33176512e9e0cd91 Signed-off-by: waynedunican <wayne.dunican@est.tech>
2020-09-03Clean up warnings and SONAR issuesliamfallon2-13/+6
Issue-ID: POLICY-2654 Change-Id: Ifd391ea9141d37cfd3ca4110d66c667962230ae1 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-06-23Remove thread in JavascriptExecutorhuaxing5-416/+53
This change is basically a rollback of https://gerrit.onap.org/r/c/policy/apex-pdp/+/104230, with minor refactoring. The problem that 104230 tried to address was supposed to be caused by https://jira.onap.org/browse/POLICY-2463. With this rollback, apex-pdp increases performance and reduces memory usage. Issue-ID: POLICY-2572 Signed-off-by: huaxing <huaxing.jin@est.tech> Change-Id: I3a52d0ead0c1e530d218f9e3aba8b3eb5558abaf
2020-06-19Changes for checkstyle 8.32liamfallon5-5/+0
Issue-ID: POLICY-2188 Change-Id: I56bbf3aa3bd9e1ef433cc93ad2be0c54d141a2a5 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-04-03Fix failing Kafka testsliamfallon1-2/+8
All the Kafka components need something near 10 seconds to come up completely. This review tweaks the timing to allow the test Kafka server to come up and to allow the consumers to connect to it. Issue-ID: POLICY-2106 Change-Id: I6dd8ace0848bdc2549e658ef8908b4d85d5ea789 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-04-02Fix hanging timeout on Executor testliamfallon1-3/+8
Issue-ID: POLICY-2106 Change-Id: I7bd44f8dfe349d73a4c8c4f978a30b455c45b2c7 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-30Fix hanging tests in JavascritExecutorliamfallon5-17/+350
Added tests to check threads start, execute, and stop correctly and fixed JavescriptExecutor class to handle startup and shutdown correctly without hanging. Issue-ID: POLICY-2106 Change-Id: I9ab41023aae2ab1cbcaea53fdf5d48eccd90a2f1 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-25Ignore JUnit tests that hang on awaitliamfallon4-2/+11
This change ignores the tests that are hanging in Jenkins until the Apex images are released. Once the images are released we'll fix these tests. Issue-ID: POLICY-2106 Change-Id: I6a733896da044d3f24443ac202d6122a341db135 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-24Launch separate threads for Javascript task executionliamfallon3-37/+94
When a policy is loaded, a separate thread is spawned for each Javascript script executor. This allows us to precompile the Javascript scripts and also to have a larger stack available for script execution. Issue-ID: POLICY-2106 Change-Id: I97323aafb623ba537ac1889b3c9504b345b4f67e Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-09Use Rhino javascript executor in apex-pdpliamfallon3-34/+35
Integation unit tests resultd in StackOverflowException errors in the Graal Javascript interpreter. Following extensive testing and trouobleshooting, it proved very difficult to fix these issues in Graal as the stck overflow errors were occurring in native class instantiation methods being invoked by Grall on the JVM. The alternative Rhino Javascript engine is developed by mozilla, and was incorporated into the Java 6 JVM and evolved into Nashorn in the Java 8 JVM. Oracle dropped Nashorn in Java 11. However, in parallel, Rhino development has continued. This review brings in the Rhino javascript engine into apex-pdp as the replacement for Nashorn and instead of Graal. Graal seems to be pretty unstable as yet so we may bring it in in future releases but for now Rhino is a more stable and reliable alternative. Issue-ID: POLICY-2106 Change-Id: I0edeff3b0bee404b38e3ebe22001a6e3375a44dc Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-01Switch apex to Graal javascript engineliamfallon4-190/+235
This is the main review to switch out the Nashorn Javascript interpreter and switch in the Graal javascript interpreter for apex Javascript tasks. The Graal Javascript dialect differs slightly from Nashorn in the way it accesses information passed over from the Java world so Javascript tasks need to be converted. Subsequent reviews will convert the JUnit tests marked @Ignore in previous reviews to this one and will convert the Javascript tasks into a format Graal can handle. Subsequent reviews will also convert the examples over to Graal format. Issue-ID: POLICY-2106 Change-Id: Ief582a36539e8a87724c17fb7e56864d5e471c07 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-07-10Add integration tests for executor propertiesliamfallon3-13/+19
Added integration test that sets properties in a dummy plugin and amends them in tasks in a policy. Variosu tests added to check combinations of where properties are set in plugins or in tasks or both. Implementaiton changed to: - Always pass in a Properies object, the properties object coming into the policy cannot be null because the task/TSL/SFL may wish to set it - Fix a bug where the properties were not passed from the ApexEvent to the engine event in the ApexEventUnmarshaller class Issue-ID: POLICY-1743 Change-Id: I6aa152b28d46cf3cc6fa56a1a95b76a8e55f5a49 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-06-26Add passthrough properties for APEX engineliamfallon3-13/+13
APEX event receiver and sender plugins sometimes need to exchange information with tasks, especially in the case of REST communication. This change enables passthrough of Properties from the event carrier technology plugins to APEX task, task selection, and state finalizer logics. Apologies for the size of the review but this change involves passinng the properties through all the APEX components, hence the large number of small changes. Issue-ID: POLICY-1742 Change-Id: I219fd69550f06702ef64adbb165fe7baac422e96 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-03-19Fix checkstyle/Sonar issues on juint/sonar fixesliamfallon4-4/+8
Recent changes to increase code coverage and fox Sonar bugs have introduced checkstyle and further Sonar issues. This review cleans those up. Issue-ID: POLICY-1523 Change-Id: I829217ef77d52e57f9713cfeee5b122e1f25efbc Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-03-06Increase test coverage for plugins-executor-jsHengye4-0/+503
Add junit test cases into apex-pdp/plugins/plugins-executor-javascript Issue-ID: POLICY-1523 Change-Id: Ie8017be2f7507fdb641a4020e13152c656cadf04 Signed-off-by: Hengye <yehui.wang@est.tech>