From 9e5c4b882728ebf3330568d068f109965d599410 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Mon, 2 Mar 2020 17:08:47 +0000 Subject: 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 --- .../policies/executionproperties/logic/AddPropertyTask.js | 7 ++----- .../executionproperties/logic/DefinedToEmptyTask.js | 7 ++----- .../executionproperties/logic/EmptyToDefinedTask.js | 7 ++----- .../policies/executionproperties/logic/EmptyToEmptyTask.js | 7 ++----- .../policies/executionproperties/logic/ReadOnlyTask.js | 7 ++----- .../executionproperties/logic/RemovePropertyTask.js | 7 ++----- .../policies/executionproperties/logic/RunTestStateTSL.js | 5 ++--- .../policies/executionproperties/logic/TaskFetchHttpCode.js | 13 ++++++------- .../policies/executionproperties/logic/TaskTagUrl.js | 7 ++----- 9 files changed, 22 insertions(+), 45 deletions(-) (limited to 'testsuites/integration/integration-uservice-test/src/test/resources/policies/executionproperties/logic') 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()); -- cgit 1.2.3-korg