From cd68fc9bae7d6258f77ff59c1431e4f925f61a4c Mon Sep 17 00:00:00 2001 From: liamfallon Date: Thu, 13 Sep 2018 23:48:50 +0100 Subject: Address sonar/Checkstyle Issues Sweep through Apex codebase to fix most ceheckstyle and straightforward sonar issues. Issue-ID: POLICY-1034 Change-Id: I149d9a94ad893affc93573e8de5e3304b6bdde2d Signed-off-by: liamfallon --- .../model/javascript/DefaultState_Logic.javascript | 27 ----------------- .../model/javascript/DefaultTask_Logic.javascript | 34 --------------------- .../model/javascript/EvalState_Logic.javascript | 25 ---------------- .../model/javascript/EvalTask_Logic.javascript | 29 ------------------ .../common/model/jruby/DefaultState_Logic.jruby | 24 --------------- .../common/model/jruby/DefaultTask_Logic.jruby | 33 -------------------- .../test/common/model/jruby/EvalState_Logic.jruby | 23 -------------- .../test/common/model/jruby/EvalTask_Logic.jruby | 32 -------------------- .../common/model/jython/DefaultState_Logic.jython | 27 ----------------- .../common/model/jython/DefaultTask_Logic.jython | 35 ---------------------- .../common/model/jython/EvalState_Logic.jython | 25 ---------------- .../test/common/model/jython/EvalTask_Logic.jython | 32 -------------------- .../test/common/model/mvel/DefaultState_Logic.mvel | 23 -------------- .../test/common/model/mvel/DefaultTask_Logic.mvel | 30 ------------------- .../test/common/model/mvel/EvalState_Logic.mvel | 23 -------------- .../test/common/model/mvel/EvalTask_Logic.mvel | 26 ---------------- .../model/javascript/DefaultStateLogic.javascript | 27 +++++++++++++++++ .../model/javascript/DefaultTaskLogic.javascript | 34 +++++++++++++++++++++ .../model/javascript/EvalStateLogic.javascript | 25 ++++++++++++++++ .../model/javascript/EvalTaskLogic.javascript | 29 ++++++++++++++++++ .../common/model/jruby/DefaultStateLogic.jruby | 24 +++++++++++++++ .../common/model/jruby/DefaultTaskLogic.jruby | 33 ++++++++++++++++++++ .../common/model/jruby/EvalStateLogic.jruby | 23 ++++++++++++++ .../common/model/jruby/EvalTaskLogic.jruby | 32 ++++++++++++++++++++ .../common/model/jython/DefaultStateLogic.jython | 27 +++++++++++++++++ .../common/model/jython/DefaultTaskLogic.jython | 35 ++++++++++++++++++++++ .../common/model/jython/EvalStateLogic.jython | 25 ++++++++++++++++ .../common/model/jython/EvalTaskLogic.jython | 32 ++++++++++++++++++++ .../common/model/mvel/DefaultStateLogic.mvel | 23 ++++++++++++++ .../common/model/mvel/DefaultTaskLogic.mvel | 30 +++++++++++++++++++ .../common/model/mvel/EvalStateLogic.mvel | 23 ++++++++++++++ .../common/model/mvel/EvalTaskLogic.mvel | 26 ++++++++++++++++ 32 files changed, 448 insertions(+), 448 deletions(-) delete mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/javascript/DefaultState_Logic.javascript delete mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/javascript/DefaultTask_Logic.javascript delete mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/javascript/EvalState_Logic.javascript delete mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/javascript/EvalTask_Logic.javascript delete mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jruby/DefaultState_Logic.jruby delete mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jruby/DefaultTask_Logic.jruby delete mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jruby/EvalState_Logic.jruby delete mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jruby/EvalTask_Logic.jruby delete mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/DefaultState_Logic.jython delete mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/DefaultTask_Logic.jython delete mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/EvalState_Logic.jython delete mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/EvalTask_Logic.jython delete mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/mvel/DefaultState_Logic.mvel delete mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/mvel/DefaultTask_Logic.mvel delete mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/mvel/EvalState_Logic.mvel delete mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/mvel/EvalTask_Logic.mvel create mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/javascript/DefaultStateLogic.javascript create mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/javascript/DefaultTaskLogic.javascript create mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/javascript/EvalStateLogic.javascript create mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/javascript/EvalTaskLogic.javascript create mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jruby/DefaultStateLogic.jruby create mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jruby/DefaultTaskLogic.jruby create mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jruby/EvalStateLogic.jruby create mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jruby/EvalTaskLogic.jruby create mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jython/DefaultStateLogic.jython create mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jython/DefaultTaskLogic.jython create mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jython/EvalStateLogic.jython create mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jython/EvalTaskLogic.jython create mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/mvel/DefaultStateLogic.mvel create mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/mvel/DefaultTaskLogic.mvel create mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/mvel/EvalStateLogic.mvel create mode 100644 testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/mvel/EvalTaskLogic.mvel (limited to 'testsuites/integration/integration-common/src/main/resources') diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/javascript/DefaultState_Logic.javascript b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/javascript/DefaultState_Logic.javascript deleted file mode 100644 index e25cb9c6e..000000000 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/javascript/DefaultState_Logic.javascript +++ /dev/null @@ -1,27 +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========================================================= - */ - -executor.logger.debug(executor.subject.id); -var gc = executor.getContextAlbum("GlobalContextAlbum"); -executor.logger.debug(gc.name); -executor.subject.defaultTaskKey.copyTo(executor.selectedTask) - -var returnValue = executor.isTrue; - diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/javascript/DefaultTask_Logic.javascript b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/javascript/DefaultTask_Logic.javascript deleted file mode 100644 index f98e16555..000000000 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/javascript/DefaultTask_Logic.javascript +++ /dev/null @@ -1,34 +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========================================================= - */ - -executor.logger.debug(executor.subject.id); -var gc = executor.getContextAlbum("GlobalContextAlbum"); -executor.logger.debug(gc.name); -executor.logger.debug(executor.inFields); - -var caseSelectedType = Java.type("java.lang.Byte"); -executor.outFields.put("TestCaseSelected", new caseSelectedType()); - -var JavaDate = Java.type("java.util.Date"); -timeNow = new JavaDate(); -executor.outFields.put("TestStateTime", timeNow.getTime()); -executor.logger.debug(executor.eo); - -var returnValue = executor.isTrue; diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/javascript/EvalState_Logic.javascript b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/javascript/EvalState_Logic.javascript deleted file mode 100644 index 535cad595..000000000 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/javascript/EvalState_Logic.javascript +++ /dev/null @@ -1,25 +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========================================================= - */ - -executor.logger.debug(executor.subject.id); -executor.subject.defaultTaskKey.copyTo(executor.selectedTask); - -var returnValue = executor.isTrue; - diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/javascript/EvalTask_Logic.javascript b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/javascript/EvalTask_Logic.javascript deleted file mode 100644 index b0756504c..000000000 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/javascript/EvalTask_Logic.javascript +++ /dev/null @@ -1,29 +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========================================================= - */ - -executor.logger.debug(executor.subject.id); -executor.logger.debug(executor.inFields); - -var JavaDate = Java.type("java.util.Date"); -timeNow = new JavaDate(); -executor.outFields.put("StateTimestamp", timeNow.getTime()); -executor.logger.debug(executor.outFields); - -var returnValue = executor.isTrue; diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jruby/DefaultState_Logic.jruby b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jruby/DefaultState_Logic.jruby deleted file mode 100644 index 2965476a8..000000000 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jruby/DefaultState_Logic.jruby +++ /dev/null @@ -1,24 +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========================================================= -#------------------------------------------------------------------------------- - -executor.logger.debug("id: " + executor.subject.id) -executor.logger.debug("ctxt name: " + executor.getContextAlbum("GlobalContextAlbum").name) -executor.subject.defaultTaskKey.copyTo(executor.selectedTask) -return true diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jruby/DefaultTask_Logic.jruby b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jruby/DefaultTask_Logic.jruby deleted file mode 100644 index 4ad39f57e..000000000 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jruby/DefaultTask_Logic.jruby +++ /dev/null @@ -1,33 +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========================================================= -#------------------------------------------------------------------------------- - -require 'java' - -executor.logger.debug("id: " + executor.subject.id) -executor.logger.debug("ctxt name: " + executor.getContextAlbum("GlobalContextAlbum").name) -executor.logger.debug("inFields: " + executor.inFields.toString()) - -executor.outFields.put("TestCaseSelected", .to_java(:byte)) - -timeNow = java.util.Date.new() -executor.outFields.put("TestStateTime", timeNow.getTime()) -executor.logger.debug("outFields: " + executor.outFields.toString()) - -return true diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jruby/EvalState_Logic.jruby b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jruby/EvalState_Logic.jruby deleted file mode 100644 index e57a62c8b..000000000 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jruby/EvalState_Logic.jruby +++ /dev/null @@ -1,23 +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========================================================= -#------------------------------------------------------------------------------- - -executor.logger.debug("id: " + executor.subject.id); -executor.subject.defaultTaskKey.copyTo(executor.selectedTask); -return true; diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jruby/EvalTask_Logic.jruby b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jruby/EvalTask_Logic.jruby deleted file mode 100644 index 72a4ee607..000000000 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jruby/EvalTask_Logic.jruby +++ /dev/null @@ -1,32 +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========================================================= -#------------------------------------------------------------------------------- - -require 'java'; - -executor.logger.debug("id: " + executor.subject.id); -executor.logger.debug("inFields: " + executor.inFields.toString()); - -executor.outFields.putAll(executor.inFields); - -timeNow = java.util.Date.new(); -executor.outFields.put("StateTimestamp", timeNow.getTime()); -executor.logger.debug("outFields: " + executor.outFields.toString()); - -return true; diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/DefaultState_Logic.jython b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/DefaultState_Logic.jython deleted file mode 100644 index 9752f057d..000000000 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/DefaultState_Logic.jython +++ /dev/null @@ -1,27 +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========================================================= -#------------------------------------------------------------------------------- - -from java.lang import Boolean -executor.logger.debug('id: ' + executor.subject.id) - -executor.logger.debug('ctxt name: ' + executor.getContextAlbum("GlobalContextAlbum").name) -executor.subject.defaultTaskKey.copyTo(executor.selectedTask) - -returnValue = executor.isTrue diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/DefaultTask_Logic.jython b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/DefaultTask_Logic.jython deleted file mode 100644 index f57ce3f0a..000000000 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/DefaultTask_Logic.jython +++ /dev/null @@ -1,35 +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========================================================= -#------------------------------------------------------------------------------- - -from java.lang import Byte -from java.lang import Long -from java.util import Date - -executor.logger.debug('id: ' + executor.subject.id) - -executor.logger.debug('ctxt name: ' + executor.getContextAlbum("GlobalContextAlbum").name) -executor.logger.debug('inFields: ' + executor.inFields.toString()) - -executor.outFields["TestCaseSelected"] = Byte("") - -timeValue = Long(Date().getTime()); -executor.outFields["TestStateTime"] = timeValue -executor.logger.debug('outFields: ' + executor.outFields.toString()) -returnValue = executor.isTrue diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/EvalState_Logic.jython b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/EvalState_Logic.jython deleted file mode 100644 index 94f90b258..000000000 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/EvalState_Logic.jython +++ /dev/null @@ -1,25 +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========================================================= -#------------------------------------------------------------------------------- - -executor.logger.debug('id: ' + executor.subject.id); - -executor.subject.defaultTaskKey.copyTo(executor.selectedTask); - -returnValue = executor.isTrue; diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/EvalTask_Logic.jython b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/EvalTask_Logic.jython deleted file mode 100644 index aa6525673..000000000 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/EvalTask_Logic.jython +++ /dev/null @@ -1,32 +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========================================================= -#------------------------------------------------------------------------------- - -from java.lang import Boolean -from java.lang import Long -from java.util import Date - -executor.logger.debug('id: ' + executor.subject.id) - -executor.logger.debug('inFields: ' + executor.inFields.toString()) -executor.outFields.putAll(executor.inFields) - -executor.outFields["StateTimestamp"] = Long(Date().getTime()) -executor.logger.debug('outFields: ' + executor.outFields.toString()) -returnValue = Boolean.TRUE diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/mvel/DefaultState_Logic.mvel b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/mvel/DefaultState_Logic.mvel deleted file mode 100644 index 1620c6cd5..000000000 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/mvel/DefaultState_Logic.mvel +++ /dev/null @@ -1,23 +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========================================================= - */ - -logger.debug(subject.id + ":" + subject.stateName); -subject.defaultTaskKey.copyTo(selectedTask); -return true; diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/mvel/DefaultTask_Logic.mvel b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/mvel/DefaultTask_Logic.mvel deleted file mode 100644 index 9a1a4bad1..000000000 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/mvel/DefaultTask_Logic.mvel +++ /dev/null @@ -1,30 +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========================================================= - */ - -import java.util.Date; -logger.debug(subject.id); -gc = getContextAlbum("GlobalContextAlbum"); -logger.debug(gc); -logger.debug(inFields); -outFields["TestCaseSelected"] = (byte); -timeNow = new Date(); -outFields["TestStateTime"] = timeNow.getTime(); -logger.debug(outFields); -return true; \ No newline at end of file diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/mvel/EvalState_Logic.mvel b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/mvel/EvalState_Logic.mvel deleted file mode 100644 index 1620c6cd5..000000000 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/mvel/EvalState_Logic.mvel +++ /dev/null @@ -1,23 +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========================================================= - */ - -logger.debug(subject.id + ":" + subject.stateName); -subject.defaultTaskKey.copyTo(selectedTask); -return true; diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/mvel/EvalTask_Logic.mvel b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/mvel/EvalTask_Logic.mvel deleted file mode 100644 index e15a4beec..000000000 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/mvel/EvalTask_Logic.mvel +++ /dev/null @@ -1,26 +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========================================================= - */ - -import java.util.Date; -logger.debug(subject.id); -logger.debug(inFields); -timeNow = new Date(); -outFields["StateTimestamp"] = timeNow.getTime(); -return true; \ No newline at end of file diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/javascript/DefaultStateLogic.javascript b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/javascript/DefaultStateLogic.javascript new file mode 100644 index 000000000..e25cb9c6e --- /dev/null +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/javascript/DefaultStateLogic.javascript @@ -0,0 +1,27 @@ +/* + * ============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========================================================= + */ + +executor.logger.debug(executor.subject.id); +var gc = executor.getContextAlbum("GlobalContextAlbum"); +executor.logger.debug(gc.name); +executor.subject.defaultTaskKey.copyTo(executor.selectedTask) + +var returnValue = executor.isTrue; + diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/javascript/DefaultTaskLogic.javascript b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/javascript/DefaultTaskLogic.javascript new file mode 100644 index 000000000..f98e16555 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/javascript/DefaultTaskLogic.javascript @@ -0,0 +1,34 @@ +/* + * ============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========================================================= + */ + +executor.logger.debug(executor.subject.id); +var gc = executor.getContextAlbum("GlobalContextAlbum"); +executor.logger.debug(gc.name); +executor.logger.debug(executor.inFields); + +var caseSelectedType = Java.type("java.lang.Byte"); +executor.outFields.put("TestCaseSelected", new caseSelectedType()); + +var JavaDate = Java.type("java.util.Date"); +timeNow = new JavaDate(); +executor.outFields.put("TestStateTime", timeNow.getTime()); +executor.logger.debug(executor.eo); + +var returnValue = executor.isTrue; diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/javascript/EvalStateLogic.javascript b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/javascript/EvalStateLogic.javascript new file mode 100644 index 000000000..535cad595 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/javascript/EvalStateLogic.javascript @@ -0,0 +1,25 @@ +/* + * ============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========================================================= + */ + +executor.logger.debug(executor.subject.id); +executor.subject.defaultTaskKey.copyTo(executor.selectedTask); + +var returnValue = executor.isTrue; + diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/javascript/EvalTaskLogic.javascript b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/javascript/EvalTaskLogic.javascript new file mode 100644 index 000000000..b0756504c --- /dev/null +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/javascript/EvalTaskLogic.javascript @@ -0,0 +1,29 @@ +/* + * ============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========================================================= + */ + +executor.logger.debug(executor.subject.id); +executor.logger.debug(executor.inFields); + +var JavaDate = Java.type("java.util.Date"); +timeNow = new JavaDate(); +executor.outFields.put("StateTimestamp", timeNow.getTime()); +executor.logger.debug(executor.outFields); + +var returnValue = executor.isTrue; diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jruby/DefaultStateLogic.jruby b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jruby/DefaultStateLogic.jruby new file mode 100644 index 000000000..2965476a8 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jruby/DefaultStateLogic.jruby @@ -0,0 +1,24 @@ +#------------------------------------------------------------------------------- +# ============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========================================================= +#------------------------------------------------------------------------------- + +executor.logger.debug("id: " + executor.subject.id) +executor.logger.debug("ctxt name: " + executor.getContextAlbum("GlobalContextAlbum").name) +executor.subject.defaultTaskKey.copyTo(executor.selectedTask) +return true diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jruby/DefaultTaskLogic.jruby b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jruby/DefaultTaskLogic.jruby new file mode 100644 index 000000000..4ad39f57e --- /dev/null +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jruby/DefaultTaskLogic.jruby @@ -0,0 +1,33 @@ +#------------------------------------------------------------------------------- +# ============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========================================================= +#------------------------------------------------------------------------------- + +require 'java' + +executor.logger.debug("id: " + executor.subject.id) +executor.logger.debug("ctxt name: " + executor.getContextAlbum("GlobalContextAlbum").name) +executor.logger.debug("inFields: " + executor.inFields.toString()) + +executor.outFields.put("TestCaseSelected", .to_java(:byte)) + +timeNow = java.util.Date.new() +executor.outFields.put("TestStateTime", timeNow.getTime()) +executor.logger.debug("outFields: " + executor.outFields.toString()) + +return true diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jruby/EvalStateLogic.jruby b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jruby/EvalStateLogic.jruby new file mode 100644 index 000000000..e57a62c8b --- /dev/null +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jruby/EvalStateLogic.jruby @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------- +# ============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========================================================= +#------------------------------------------------------------------------------- + +executor.logger.debug("id: " + executor.subject.id); +executor.subject.defaultTaskKey.copyTo(executor.selectedTask); +return true; diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jruby/EvalTaskLogic.jruby b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jruby/EvalTaskLogic.jruby new file mode 100644 index 000000000..72a4ee607 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jruby/EvalTaskLogic.jruby @@ -0,0 +1,32 @@ +#------------------------------------------------------------------------------- +# ============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========================================================= +#------------------------------------------------------------------------------- + +require 'java'; + +executor.logger.debug("id: " + executor.subject.id); +executor.logger.debug("inFields: " + executor.inFields.toString()); + +executor.outFields.putAll(executor.inFields); + +timeNow = java.util.Date.new(); +executor.outFields.put("StateTimestamp", timeNow.getTime()); +executor.logger.debug("outFields: " + executor.outFields.toString()); + +return true; diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jython/DefaultStateLogic.jython b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jython/DefaultStateLogic.jython new file mode 100644 index 000000000..9752f057d --- /dev/null +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jython/DefaultStateLogic.jython @@ -0,0 +1,27 @@ +#------------------------------------------------------------------------------- +# ============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========================================================= +#------------------------------------------------------------------------------- + +from java.lang import Boolean +executor.logger.debug('id: ' + executor.subject.id) + +executor.logger.debug('ctxt name: ' + executor.getContextAlbum("GlobalContextAlbum").name) +executor.subject.defaultTaskKey.copyTo(executor.selectedTask) + +returnValue = executor.isTrue diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jython/DefaultTaskLogic.jython b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jython/DefaultTaskLogic.jython new file mode 100644 index 000000000..f57ce3f0a --- /dev/null +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jython/DefaultTaskLogic.jython @@ -0,0 +1,35 @@ +#------------------------------------------------------------------------------- +# ============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========================================================= +#------------------------------------------------------------------------------- + +from java.lang import Byte +from java.lang import Long +from java.util import Date + +executor.logger.debug('id: ' + executor.subject.id) + +executor.logger.debug('ctxt name: ' + executor.getContextAlbum("GlobalContextAlbum").name) +executor.logger.debug('inFields: ' + executor.inFields.toString()) + +executor.outFields["TestCaseSelected"] = Byte("") + +timeValue = Long(Date().getTime()); +executor.outFields["TestStateTime"] = timeValue +executor.logger.debug('outFields: ' + executor.outFields.toString()) +returnValue = executor.isTrue diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jython/EvalStateLogic.jython b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jython/EvalStateLogic.jython new file mode 100644 index 000000000..94f90b258 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jython/EvalStateLogic.jython @@ -0,0 +1,25 @@ +#------------------------------------------------------------------------------- +# ============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========================================================= +#------------------------------------------------------------------------------- + +executor.logger.debug('id: ' + executor.subject.id); + +executor.subject.defaultTaskKey.copyTo(executor.selectedTask); + +returnValue = executor.isTrue; diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jython/EvalTaskLogic.jython b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jython/EvalTaskLogic.jython new file mode 100644 index 000000000..aa6525673 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/jython/EvalTaskLogic.jython @@ -0,0 +1,32 @@ +#------------------------------------------------------------------------------- +# ============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========================================================= +#------------------------------------------------------------------------------- + +from java.lang import Boolean +from java.lang import Long +from java.util import Date + +executor.logger.debug('id: ' + executor.subject.id) + +executor.logger.debug('inFields: ' + executor.inFields.toString()) +executor.outFields.putAll(executor.inFields) + +executor.outFields["StateTimestamp"] = Long(Date().getTime()) +executor.logger.debug('outFields: ' + executor.outFields.toString()) +returnValue = Boolean.TRUE diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/mvel/DefaultStateLogic.mvel b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/mvel/DefaultStateLogic.mvel new file mode 100644 index 000000000..1620c6cd5 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/mvel/DefaultStateLogic.mvel @@ -0,0 +1,23 @@ +/* + * ============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========================================================= + */ + +logger.debug(subject.id + ":" + subject.stateName); +subject.defaultTaskKey.copyTo(selectedTask); +return true; diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/mvel/DefaultTaskLogic.mvel b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/mvel/DefaultTaskLogic.mvel new file mode 100644 index 000000000..9a1a4bad1 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/mvel/DefaultTaskLogic.mvel @@ -0,0 +1,30 @@ +/* + * ============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========================================================= + */ + +import java.util.Date; +logger.debug(subject.id); +gc = getContextAlbum("GlobalContextAlbum"); +logger.debug(gc); +logger.debug(inFields); +outFields["TestCaseSelected"] = (byte); +timeNow = new Date(); +outFields["TestStateTime"] = timeNow.getTime(); +logger.debug(outFields); +return true; \ No newline at end of file diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/mvel/EvalStateLogic.mvel b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/mvel/EvalStateLogic.mvel new file mode 100644 index 000000000..1620c6cd5 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/mvel/EvalStateLogic.mvel @@ -0,0 +1,23 @@ +/* + * ============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========================================================= + */ + +logger.debug(subject.id + ":" + subject.stateName); +subject.defaultTaskKey.copyTo(selectedTask); +return true; diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/mvel/EvalTaskLogic.mvel b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/mvel/EvalTaskLogic.mvel new file mode 100644 index 000000000..e15a4beec --- /dev/null +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/testsuites/integration/common/model/mvel/EvalTaskLogic.mvel @@ -0,0 +1,26 @@ +/* + * ============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========================================================= + */ + +import java.util.Date; +logger.debug(subject.id); +logger.debug(inFields); +timeNow = new Date(); +outFields["StateTimestamp"] = timeNow.getTime(); +return true; \ No newline at end of file -- cgit 1.2.3-korg