diff options
author | liamfallon <liam.fallon@est.tech> | 2020-03-05 10:50:48 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2020-03-09 18:30:13 +0000 |
commit | 6bda5d7e4e80d1aefb4f19203361b7199448e70f (patch) | |
tree | b28a68625cec91c57f0383d185f73fdf165ab558 /testsuites/integration/integration-common/src/test | |
parent | f876b34ec297495df20394c248b899d610e1bcce (diff) |
Use Rhino javascript executor in apex-pdp
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>
Diffstat (limited to 'testsuites/integration/integration-common/src/test')
-rw-r--r-- | testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/testclasses/TestPingClassTest.java | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/testclasses/TestPingClassTest.java b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/testclasses/TestPingClassTest.java index 6ca7ed9d7..82f46c04a 100644 --- a/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/testclasses/TestPingClassTest.java +++ b/testsuites/integration/integration-common/src/test/java/org/onap/policy/apex/testsuites/integration/common/testclasses/TestPingClassTest.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 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. * 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========================================================= */ @@ -106,15 +107,15 @@ public class TestPingClassTest { ptc.verify(); fail("test should throw an exception"); } catch (ApexException ae) { - assertEquals("TestPing is not valid, pong time is not greater than ping time", ae.getMessage()); + assertEquals("TestPing is not valid, pong time -1 is less than ping time 0", ae.getMessage()); } - ptc.setPongTime(0); + ptc.setPongTime(-2); try { ptc.verify(); fail("test should throw an exception"); } catch (ApexException ae) { - assertEquals("TestPing is not valid, pong time is not greater than ping time", ae.getMessage()); + assertEquals("TestPing is not valid, pong time -2 is less than ping time 0", ae.getMessage()); } ptc.setPongTime(1); @@ -124,7 +125,9 @@ public class TestPingClassTest { fail("test should not throw an exception"); } - assertEquals("TestPing [name=Rose, description=A rose by any other name would smell as sweet, " - + "pingTime=0, pongTime=1]", ptc.toString()); + assertEquals( + "PingTestClass(id=0, name=Rose, " + + "description=A rose by any other name would smell as sweet, pingTime=0, pongTime=1)", + ptc.toString()); } } |