Updating the jdk version from jdk8 to jdk11 for CSITs

Removes JAVA_HOME for drools pdp
Updates Policy API tests
Updates XACML-PDP database connection
Downloads dmaap simulator instead of compiling it for xacml-pdp,apex-pdp and distribution

Changes from Jim, Jorge and Chenfei

Issue-ID: POLICY-2325
Change-Id: I28ff3384f9ae9b7d1ce6940eb62aa87278e7a9c5
Signed-off-by: Bilal A <bilal@research.att.com>
diff --git a/scripts/policy/config/drools/base.conf b/scripts/policy/config/drools/base.conf
index d3164cb..1e57226 100644
--- a/scripts/policy/config/drools/base.conf
+++ b/scripts/policy/config/drools/base.conf
@@ -1,5 +1,5 @@
 # ============LICENSE_START=======================================================
-# Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2020 AT&T Intellectual Property. 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.
@@ -22,7 +22,6 @@
 
 POLICY_HOME=/opt/app/policy
 POLICY_LOGS=/var/log/onap/policy/pdpd
-JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk
 KEYSTORE_PASSWD=Pol1cy_0nap
 TRUSTSTORE_PASSWD=Pol1cy_0nap
 
diff --git a/scripts/policy/config/policy-csit.conf b/scripts/policy/config/policy-csit.conf
index aa5f939..1858698 100644
--- a/scripts/policy/config/policy-csit.conf
+++ b/scripts/policy/config/policy-csit.conf
@@ -1,2 +1,3 @@
 GERRIT_BRANCH=master
 POLICY_MARIADB_VER=10.2.25
+NEXUS_URL=https://nexus.onap.org/content/repositories/snapshots
diff --git a/scripts/policy/policy-models-dmaap-sim.sh b/scripts/policy/policy-models-dmaap-sim.sh
new file mode 100644
index 0000000..0abd9f9
--- /dev/null
+++ b/scripts/policy/policy-models-dmaap-sim.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2020 AT&T Intellectual Property. 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=========================================================
+
+source ${SCRIPTS}/policy/config/policy-csit.conf
+
+POLICY_MODELS_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/models/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
+export POLICY_MODELS_VERSION="${POLICY_MODELS_VERSION_EXTRACT}"
+echo ${POLICY_MODELS_VERSION}
+
+# download dmaap tarball and build docker image
+git clone --depth 1 https://gerrit.onap.org/r/policy/models -b ${GERRIT_BRANCH}
+cd models/models-sim/models-sim-dmaap
+item=`curl --silent -L ${NEXUS_URL}/org/onap/policy/models/sim/policy-models-sim-dmaap/${POLICY_MODELS_VERSION} | egrep 'policy-models-sim-dmaap-.*tarball' | cut '-d"' -f2 | egrep 'gz$' | sort | tail -1`
+mkdir target
+curl -L $item -o target/policy-models-sim-dmaap-${POLICY_MODELS_VERSION}-tarball.tar.gz
+bash ./src/main/package/docker/docker_build.sh
+cd ${WORKSPACE}
+rm -rf ${WORK_DIR}
+
diff --git a/scripts/policy/policy-xacml-pdp/config/db/db.sh b/scripts/policy/policy-xacml-pdp/config/db/db.sh
old mode 100644
new mode 100755
index ac150a0..499764d
--- a/scripts/policy/policy-xacml-pdp/config/db/db.sh
+++ b/scripts/policy/policy-xacml-pdp/config/db/db.sh
@@ -1,6 +1,6 @@
 #!/bin/bash -xv
 # ============LICENSE_START=======================================================
-#  Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+#  Copyright (C) 2020 AT&T Intellectual Property. 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.
@@ -17,10 +17,10 @@
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
 
-for db in policyadmin
+for db in policyadmin operationshistory
 do
      mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};"
      mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;"
 done
 
-mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "FLUSH PRIVILEGES;"
\ No newline at end of file
+mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "FLUSH PRIVILEGES;"