diff options
author | liamfallon <liam.fallon@est.tech> | 2020-03-02 17:08:47 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2020-03-04 08:33:25 +0000 |
commit | 9e5c4b882728ebf3330568d068f109965d599410 (patch) | |
tree | 8ad948a28268b50b97946168b7a8ceab54872dc5 /testsuites/integration/integration-uservice-test/src/test/resources | |
parent | 5922128637471bfa1897b8808561000988da733d (diff) |
Preparing integration tests for Graal Javascript
Graal enforces Javascript more strictly than Nashorn does. This review
changes the tests in apex-pdp to comply with the stricter -Javascript
checking, re-enabling the integration test module.
- All log calls must be passed as strings, using toString()
- Byte/Float/Long Java types not supported in Javascript
Disable integration tests so that other changes can be brought in.
JMS integration test is disabled for now, it will be re-enabled in a
review shortly.
Issue-ID: POLICY-2106
Change-Id: I14bdb930eff735e862b51802cf72e4793cec3699
Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'testsuites/integration/integration-uservice-test/src/test/resources')
14 files changed, 43 insertions, 70 deletions
diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/events/Context_AvroEventAlbum_EventOutCompare.json b/testsuites/integration/integration-uservice-test/src/test/resources/events/Context_AvroEventAlbum_EventOutCompare.json index 1c30984e7..9b3481890 100644 --- a/testsuites/integration/integration-uservice-test/src/test/resources/events/Context_AvroEventAlbum_EventOutCompare.json +++ b/testsuites/integration/integration-uservice-test/src/test/resources/events/Context_AvroEventAlbum_EventOutCompare.json @@ -15,7 +15,7 @@ "AvroBoolean": true, "AvroByte": -127.0, "AvroDouble": 1.2345E67, - "AvroFloat": 1.9999999999999998E23, + "AvroFloat": 1.9999999556392617E23, "AvroInteger": 1234568.0, "AvroLong": 1.234567890124E12, "AvroMap": { @@ -80,7 +80,7 @@ "doubleValue": 6.71000001E8 }, "CustomFloat": { - "floatValue": 3000001.0 + "floatValue": 3000000.0 }, "CustomInteger": { "intValue": -9876542.0 diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/events/Context_JavaEventAlbum_EventOutCompare.json b/testsuites/integration/integration-uservice-test/src/test/resources/events/Context_JavaEventAlbum_EventOutCompare.json index fc7b04a12..a0f8549e6 100644 --- a/testsuites/integration/integration-uservice-test/src/test/resources/events/Context_JavaEventAlbum_EventOutCompare.json +++ b/testsuites/integration/integration-uservice-test/src/test/resources/events/Context_JavaEventAlbum_EventOutCompare.json @@ -31,7 +31,7 @@ "second": 48, "milliSecond": 391 }, - "timeZoneString": "Greenwich Mean Time", + "tzValue": "Greenwich Mean Time", "dst": true }, "CustomDate2": { @@ -45,7 +45,7 @@ "second": 48, "milliSecond": 391 }, - "timeZoneString": "Greenwich Mean Time", + "tzValue": "Greenwich Mean Time", "dst": false, "utcOffset": 0, "locale": "en" @@ -60,10 +60,10 @@ "intValue": -9876542 }, "CustomJLong": { - "longValue": 9223372036854775807 + "longValue": -9223372036854775808 }, "CustomLong": { - "longValue": 9223372036854775807 + "longValue": -9223372036854775808 }, "CustomMap": { "mapValue": { diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/AddPropertyTask.js b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/AddPropertyTask.js index af0db4e3e..54826ce7a 100644 --- a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/AddPropertyTask.js +++ b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/AddPropertyTask.js @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,7 @@ * ============LICENSE_END========================================================= */ -executor.logger.info(executor.subject.id); -executor.logger.info(executor.inFields); - -executor.logger.info(executor.outFields); +executor.logger.info(executor.getSubject().getId()); executor.logger.info("executionProperties in:" + executor.getExecutionProperties()); diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/DefinedToEmptyTask.js b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/DefinedToEmptyTask.js index dce37cc3e..4596dd4b4 100644 --- a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/DefinedToEmptyTask.js +++ b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/DefinedToEmptyTask.js @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,7 @@ * ============LICENSE_END========================================================= */ -executor.logger.info(executor.subject.id); -executor.logger.info(executor.inFields); - -executor.logger.info(executor.outFields); +executor.logger.info(executor.getSubject().getId()); executor.logger.info("executionProperties in:" + executor.getExecutionProperties()); diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/EmptyToDefinedTask.js b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/EmptyToDefinedTask.js index 090b7a00c..ba807cf73 100644 --- a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/EmptyToDefinedTask.js +++ b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/EmptyToDefinedTask.js @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,7 @@ * ============LICENSE_END========================================================= */ -executor.logger.info(executor.subject.id); -executor.logger.info(executor.inFields); - -executor.logger.info(executor.outFields); +executor.logger.info(executor.getSubject().getId()); executor.logger.info("executionProperties in:" + executor.getExecutionProperties()); diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/EmptyToEmptyTask.js b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/EmptyToEmptyTask.js index 62af4e97b..6cae0ceb1 100644 --- a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/EmptyToEmptyTask.js +++ b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/EmptyToEmptyTask.js @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,7 @@ * ============LICENSE_END========================================================= */ -executor.logger.info(executor.subject.id); -executor.logger.info(executor.inFields); - -executor.logger.info(executor.outFields); +executor.logger.info(executor.getSubject().getId()); executor.logger.info("executionProperties:" + executor.getExecutionProperties()); diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/ReadOnlyTask.js b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/ReadOnlyTask.js index 62af4e97b..6cae0ceb1 100644 --- a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/ReadOnlyTask.js +++ b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/ReadOnlyTask.js @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,7 @@ * ============LICENSE_END========================================================= */ -executor.logger.info(executor.subject.id); -executor.logger.info(executor.inFields); - -executor.logger.info(executor.outFields); +executor.logger.info(executor.getSubject().getId()); executor.logger.info("executionProperties:" + executor.getExecutionProperties()); diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/RemovePropertyTask.js b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/RemovePropertyTask.js index f08b718e4..2d934636a 100644 --- a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/RemovePropertyTask.js +++ b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/RemovePropertyTask.js @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,7 @@ * ============LICENSE_END========================================================= */ -executor.logger.info(executor.subject.id); -executor.logger.info(executor.inFields); - -executor.logger.info(executor.outFields); +executor.logger.info(executor.getSubject().getId()); executor.logger.info("executionProperties in:" + executor.getExecutionProperties()); diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/RunTestStateTSL.js b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/RunTestStateTSL.js index b527fc1f1..f41c7c02a 100644 --- a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/RunTestStateTSL.js +++ b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/RunTestStateTSL.js @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,8 +18,7 @@ * ============LICENSE_END========================================================= */ -executor.logger.info(executor.subject.id); -executor.logger.info(executor.inFields); +executor.logger.info(executor.getSubject().getId()); var returnValue = executor.isTrue; diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/TaskFetchHttpCode.js b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/TaskFetchHttpCode.js index 5916a23b2..3bf129bf8 100644 --- a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/TaskFetchHttpCode.js +++ b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/TaskFetchHttpCode.js @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,16 +18,15 @@ * ============LICENSE_END========================================================= */ -executor.logger.info(executor.subject.id); -executor.logger.info(executor.inFields); +executor.logger.info(executor.getSubject().getId()); -executor.logger.info(executor.outFields); +executor.logger.info("executionProperties: " + executor.getExecutionProperties()); -executor.logger.info("executionProperties:" + executor.getExecutionProperties()); - -if (executor.getExecutionProperties() == "{HTTP_CODE_STATUS=500}" ) +if (executor.getExecutionProperties().get("HTTP_CODE_STATUS") == "500") executor.outFields.put("testToRun", "CodeFilterSet"); else executor.outFields.put("testToRun", "CodeFilterDefault"); +executor.logger.info("testToRun: " + executor.outFields.get("testToRun")); + var returnValue = executor.isTrue;
\ No newline at end of file diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/TaskTagUrl.js b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/TaskTagUrl.js index 4a8ff30f1..b584ec464 100644 --- a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/TaskTagUrl.js +++ b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic/TaskTagUrl.js @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,7 @@ * ============LICENSE_END========================================================= */ -executor.logger.info(executor.subject.id); -executor.logger.info(executor.inFields); - -executor.logger.info(executor.outFields); +executor.logger.info(executor.getSubject().getId()); executor.logger.info("executionProperties in:" + executor.getExecutionProperties()); diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/policy/ExecutionPropertiesRestTestPolicyModel.apex b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/policy/ExecutionPropertiesRestTestPolicyModel.apex index 053e05349..6e0f4f2f8 100644 --- a/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/policy/ExecutionPropertiesRestTestPolicyModel.apex +++ b/testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/policy/ExecutionPropertiesRestTestPolicyModel.apex @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------- # ============LICENSE_START======================================================= -# Copyright (C) 2019 Nordix Foundation. +# Copyright (C) 2019-2020 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,7 +47,6 @@ task logic create name=TaskTagUrl logicFlavour=JAVASCRIPT logic=LS #MACROFILE:"src/test/resources/policies/executionproperties/logic/TaskTagUrl.js" LE - policy create name=Policy2 template=freestyle firstState=Junit policy state create name=Policy2 stateName=Decide triggerName=Event0201 defaultTaskName=TaskTagUrl @@ -58,7 +57,4 @@ policy state create name=Policy2 stateName=Junit triggerName=Event0200 defaultTa policy state output create name=Policy2 stateName=Junit outputName=HttpCodeOut eventName=Event0201 nextState=Decide policy state taskref create name=Policy2 stateName=Junit taskLocalName=check taskName=TaskFetchHttpCode outputType=DIRECT outputName=HttpCodeOut - - validate - diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/policies/taskparameters/SetControlLoopNameForTest.js b/testsuites/integration/integration-uservice-test/src/test/resources/policies/taskparameters/SetControlLoopNameForTest.js index a4ab0360f..9d02b0228 100644 --- a/testsuites/integration/integration-uservice-test/src/test/resources/policies/taskparameters/SetControlLoopNameForTest.js +++ b/testsuites/integration/integration-uservice-test/src/test/resources/policies/taskparameters/SetControlLoopNameForTest.js @@ -18,20 +18,20 @@ * ============LICENSE_END========================================================= */ -executor.logger.info(executor.subject.id); -executor.logger.info(executor.inFields); -executor.logger.info(executor.outFields); -executor.logger.info(executor.parameters); +executor.logger.info(executor.getSubject().getId()); +executor.logger.info(executor.getInFields().toString()); +executor.logger.info(executor.getOutFields().toString()); +executor.logger.info(executor.getParameters().toString()); -executor.logger.info("executionProperties in: {}", executor.getExecutionProperties()); +executor.logger.info("executionProperties in: {}", executor.getExecutionProperties().toString()); executor.getExecutionProperties().setProperty("tagId", "doActionForCL"); -var closedLoopId = executor.parameters.get("closedLoopId") +var closedLoopId = executor.getParameters().get("closedLoopId") if (null == closedLoopId) { closedLoopId = "INVALID - closedLoopId not available in TaskParameters" } executor.getExecutionProperties().setProperty("value", closedLoopId); -executor.logger.info("executionProperties out: {}", executor.getExecutionProperties()); +executor.logger.info("executionProperties out: {}", executor.getExecutionProperties().toString()); var returnValue = executor.isTrue;
\ No newline at end of file diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/policies/taskparameters/SetServiceIdForTest.js b/testsuites/integration/integration-uservice-test/src/test/resources/policies/taskparameters/SetServiceIdForTest.js index 6d56616d8..814e30217 100644 --- a/testsuites/integration/integration-uservice-test/src/test/resources/policies/taskparameters/SetServiceIdForTest.js +++ b/testsuites/integration/integration-uservice-test/src/test/resources/policies/taskparameters/SetServiceIdForTest.js @@ -18,19 +18,19 @@ * ============LICENSE_END========================================================= */ -executor.logger.info(executor.subject.id); -executor.logger.info(executor.inFields); -executor.logger.info(executor.outFields); -executor.logger.info(executor.parameters); +executor.logger.info(executor.getSubject().getId()); +executor.logger.info(executor.getInFields().toString()); +executor.logger.info(executor.getOutFields().toString()); +executor.logger.info(executor.getParameters().toString()); -executor.logger.info("executionProperties in: {}", executor.getExecutionProperties()); +executor.logger.info("executionProperties in: {}", executor.getExecutionProperties().toString()); executor.getExecutionProperties().setProperty("tagId", "getInfoForServiceId"); -var svcId = executor.parameters.get("serviceId") +var svcId = executor.getParameters().get("serviceId") if (null == svcId) { svcId = "INVALID - serviceId not available in TaskParameters" } executor.getExecutionProperties().setProperty("value", svcId); -executor.logger.info("executionProperties out: {}", executor.getExecutionProperties()); +executor.logger.info("executionProperties out: {}", executor.getExecutionProperties().toString()); var returnValue = executor.isTrue;
\ No newline at end of file |