diff options
20 files changed, 101 insertions, 49 deletions
diff --git a/feature-active-standby-management/src/main/feature/config/feature-active-standby-management.properties b/feature-active-standby-management/src/main/feature/config/feature-active-standby-management.properties index abd76fc0..e01dc9d9 100644 --- a/feature-active-standby-management/src/main/feature/config/feature-active-standby-management.properties +++ b/feature-active-standby-management/src/main/feature/config/feature-active-standby-management.properties @@ -2,7 +2,7 @@ # ============LICENSE_START=======================================================
# feature-active-standby-management
# ================================================================================
-# Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2017, 2019, 2021 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.
@@ -19,6 +19,7 @@ ###
# DB properties
+eclipselink.target-database=MySQL
javax.persistence.jdbc.driver=org.mariadb.jdbc.Driver
javax.persistence.jdbc.url=jdbc:mariadb://${env:SQL_HOST}:3306/activestandbymanagement
javax.persistence.jdbc.user=${env:SQL_USER}
@@ -36,4 +37,4 @@ pdp.updateInterval=2500 # Need long timeout, because testTransaction is only run every 10 seconds.
pdp.timeout=15000
#how long do we wait for the pdp table to populate on initial startup
-pdp.initialWait=20000
\ No newline at end of file +pdp.initialWait=20000
diff --git a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java index 7e853990..bd3f0215 100644 --- a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java +++ b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * feature-active-standby-management * ================================================================================ - * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2021 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. @@ -26,6 +26,7 @@ import java.util.Map; import java.util.Properties; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; +import org.eclipse.persistence.config.PersistenceUnitProperties; import org.onap.policy.common.im.MonitorTime; import org.onap.policy.drools.core.PolicySessionFeatureApi; import org.onap.policy.drools.features.PolicyEngineFeatureApi; @@ -187,14 +188,16 @@ public class ActiveStandbyFeature implements ActiveStandbyFeatureApi, public static DroolsPdpsConnector getDroolsPdpsConnector(String pu) { Map<String, Object> propMap = new HashMap<>(); - propMap.put("javax.persistence.jdbc.driver", ActiveStandbyProperties - .getProperty(ActiveStandbyProperties.DB_DRIVER)); - propMap.put("javax.persistence.jdbc.url", - ActiveStandbyProperties.getProperty(ActiveStandbyProperties.DB_URL)); - propMap.put("javax.persistence.jdbc.user", ActiveStandbyProperties - .getProperty(ActiveStandbyProperties.DB_USER)); - propMap.put("javax.persistence.jdbc.password", - ActiveStandbyProperties.getProperty(ActiveStandbyProperties.DB_PWD)); + propMap.put(PersistenceUnitProperties.JDBC_DRIVER, + ActiveStandbyProperties.getProperty(ActiveStandbyProperties.DB_DRIVER)); + propMap.put(PersistenceUnitProperties.JDBC_URL, + ActiveStandbyProperties.getProperty(ActiveStandbyProperties.DB_URL)); + propMap.put(PersistenceUnitProperties.JDBC_USER, + ActiveStandbyProperties.getProperty(ActiveStandbyProperties.DB_USER)); + propMap.put(PersistenceUnitProperties.JDBC_PASSWORD, + ActiveStandbyProperties.getProperty(ActiveStandbyProperties.DB_PWD)); + propMap.put(PersistenceUnitProperties.TARGET_DATABASE, + ActiveStandbyProperties.getProperty(ActiveStandbyProperties.DB_TYPE)); EntityManagerFactory emf = Persistence.createEntityManagerFactory( pu, propMap); diff --git a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyProperties.java b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyProperties.java index 3a0ba4d1..ebe57567 100644 --- a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyProperties.java +++ b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyProperties.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * feature-active-standby-management * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2019, 2021 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. @@ -21,6 +21,7 @@ package org.onap.policy.drools.activestandby; import java.util.Properties; +import org.eclipse.persistence.config.PersistenceUnitProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,10 +40,11 @@ public class ActiveStandbyProperties { /* * feature-active-standby-management.properties parameter key values */ - public static final String DB_DRIVER = "javax.persistence.jdbc.driver"; - public static final String DB_URL = "javax.persistence.jdbc.url"; - public static final String DB_USER = "javax.persistence.jdbc.user"; - public static final String DB_PWD = "javax.persistence.jdbc.password"; + public static final String DB_DRIVER = PersistenceUnitProperties.JDBC_DRIVER; + public static final String DB_URL = PersistenceUnitProperties.JDBC_URL; + public static final String DB_USER = PersistenceUnitProperties.JDBC_USER; + public static final String DB_PWD = PersistenceUnitProperties.JDBC_PASSWORD; + public static final String DB_TYPE = PersistenceUnitProperties.TARGET_DATABASE; private static Properties properties = null; diff --git a/feature-active-standby-management/src/test/resources/asw/feature-active-standby-management.properties b/feature-active-standby-management/src/test/resources/asw/feature-active-standby-management.properties index 9b01736c..23a1f6db 100644 --- a/feature-active-standby-management/src/test/resources/asw/feature-active-standby-management.properties +++ b/feature-active-standby-management/src/test/resources/asw/feature-active-standby-management.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # feature-active-standby-management # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017, 2021 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. @@ -19,6 +19,7 @@ ### # DB properties +eclipselink.target-database=Auto javax.persistence.jdbc.driver = org.h2.Driver javax.persistence.jdbc.url = jdbc:h2:mem:asw_activestandbymanagement javax.persistence.jdbc.user = sa @@ -36,4 +37,4 @@ pdp.updateInterval=1000 # Need long timeout, because testTransaction is only run every 1 seconds. pdp.timeout=3000 #how long do we wait for the pdp table to populate on initial startup -pdp.initialWait=1000
\ No newline at end of file +pdp.initialWait=1000 diff --git a/feature-active-standby-management/src/test/resources/asw/feature-state-management.properties b/feature-active-standby-management/src/test/resources/asw/feature-state-management.properties index a5403c9f..e03ebd2b 100644 --- a/feature-active-standby-management/src/test/resources/asw/feature-state-management.properties +++ b/feature-active-standby-management/src/test/resources/asw/feature-state-management.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # feature-active-standby-management # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017, 2021 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. @@ -19,6 +19,7 @@ ### # DB properties +eclipselink.target-database=Auto javax.persistence.jdbc.driver = org.h2.Driver javax.persistence.jdbc.url = jdbc:h2:mem:asw_statemanagement javax.persistence.jdbc.user = sa diff --git a/feature-active-standby-management/src/test/resources/feature-active-standby-management.properties b/feature-active-standby-management/src/test/resources/feature-active-standby-management.properties index 9e481b59..5a1f9607 100644 --- a/feature-active-standby-management/src/test/resources/feature-active-standby-management.properties +++ b/feature-active-standby-management/src/test/resources/feature-active-standby-management.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # feature-active-standby-management # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017, 2021 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. @@ -19,6 +19,7 @@ ### # DB properties +eclipselink.target-database=Auto javax.persistence.jdbc.driver = org.h2.Driver javax.persistence.jdbc.url = jdbc:h2:mem:activestandbymanagement javax.persistence.jdbc.user = sa @@ -35,4 +36,4 @@ pdp.updateInterval=1000 # Need long timeout, because testTransaction is only run every 10 seconds. pdp.timeout=3000 #how long do we wait for the pdp table to populate on initial startup -pdp.initialWait=1000
\ No newline at end of file +pdp.initialWait=1000 diff --git a/feature-active-standby-management/src/test/resources/feature-state-management.properties b/feature-active-standby-management/src/test/resources/feature-state-management.properties index d6843919..6e4f61f3 100644 --- a/feature-active-standby-management/src/test/resources/feature-state-management.properties +++ b/feature-active-standby-management/src/test/resources/feature-state-management.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # feature-active-standby-management # ================================================================================ -# Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017, 2019, 2021 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. @@ -19,6 +19,7 @@ ### # DB properties +eclipselink.target-database=Auto javax.persistence.jdbc.driver = org.h2.Driver javax.persistence.jdbc.url = jdbc:h2:mem:statemanagement javax.persistence.jdbc.user = sa diff --git a/feature-distributed-locking/src/main/feature/config/feature-distributed-locking.properties b/feature-distributed-locking/src/main/feature/config/feature-distributed-locking.properties index 9acea3c0..2b1e06f7 100644 --- a/feature-distributed-locking/src/main/feature/config/feature-distributed-locking.properties +++ b/feature-distributed-locking/src/main/feature/config/feature-distributed-locking.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # feature-distributed-locking # ================================================================================ -# Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2018-2019, 2021 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. @@ -19,6 +19,7 @@ ### #Database properties +eclipselink.target-database=MySQL javax.persistence.jdbc.driver=org.mariadb.jdbc.Driver javax.persistence.jdbc.url=jdbc:mariadb://${env:SQL_HOST}:3306/pooling javax.persistence.jdbc.user=${env:SQL_USER} diff --git a/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockProperties.java b/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockProperties.java index fff19447..3093ad49 100644 --- a/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockProperties.java +++ b/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockProperties.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * feature-distributed-locking * ================================================================================ - * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2018-2019, 2021 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. @@ -23,6 +23,7 @@ package org.onap.policy.distributed.locking; import java.util.Properties; import lombok.Getter; import lombok.Setter; +import org.eclipse.persistence.config.PersistenceUnitProperties; import org.onap.policy.common.utils.properties.BeanConfigurator; import org.onap.policy.common.utils.properties.Property; import org.onap.policy.common.utils.properties.exception.PropertyException; @@ -33,10 +34,10 @@ import org.onap.policy.common.utils.properties.exception.PropertyException; public class DistributedLockProperties { public static final String PREFIX = "distributed.locking."; - public static final String DB_DRIVER = "javax.persistence.jdbc.driver"; - public static final String DB_URL = "javax.persistence.jdbc.url"; - public static final String DB_USER = "javax.persistence.jdbc.user"; - public static final String DB_PASS = "javax.persistence.jdbc.password"; + public static final String DB_DRIVER = PersistenceUnitProperties.JDBC_DRIVER; + public static final String DB_URL = PersistenceUnitProperties.JDBC_URL; + public static final String DB_USER = PersistenceUnitProperties.JDBC_USER; + public static final String DB_PASS = PersistenceUnitProperties.JDBC_PASSWORD; public static final String EXPIRE_CHECK_SEC = PREFIX + "expire.check.seconds"; public static final String RETRY_SEC = PREFIX + "retry.seconds"; public static final String MAX_RETRIES = PREFIX + "max.retries"; diff --git a/feature-distributed-locking/src/test/resources/feature-distributed-locking.properties b/feature-distributed-locking/src/test/resources/feature-distributed-locking.properties index 0fca3c04..b34ac949 100644 --- a/feature-distributed-locking/src/test/resources/feature-distributed-locking.properties +++ b/feature-distributed-locking/src/test/resources/feature-distributed-locking.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # feature-distributed-locking # ================================================================================ -# Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2018-2019, 2021 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. @@ -18,6 +18,7 @@ # ============LICENSE_END========================================================= ### +eclipselink.target-database=Auto javax.persistence.jdbc.driver=org.h2.Driver javax.persistence.jdbc.url=jdbc:h2:mem:pooling javax.persistence.jdbc.user=user diff --git a/feature-session-persistence/pom.xml b/feature-session-persistence/pom.xml index 765d85b7..a1931451 100644 --- a/feature-session-persistence/pom.xml +++ b/feature-session-persistence/pom.xml @@ -2,7 +2,7 @@ ============LICENSE_START======================================================= ONAP Policy Engine - Drools PDP ================================================================================ - Copyright (C) 2017-2018, 2020 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017-2018, 2020-2021 AT&T Intellectual Property. All rights reserved. Modifications Copyright (C) 2020 Nordix Foundation. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); @@ -131,6 +131,16 @@ <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <scope>provided</scope> + <!-- + Exclude this because it's incompatible with eclipselink, which already + includes the same classes. + --> + <exclusions> + <exclusion> + <groupId>javax.persistence</groupId> + <artifactId>javax.persistence-api</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.hibernate.common</groupId> diff --git a/feature-session-persistence/src/main/feature/config/feature-session-persistence.properties b/feature-session-persistence/src/main/feature/config/feature-session-persistence.properties index a32ce229..ae9ce453 100644 --- a/feature-session-persistence/src/main/feature/config/feature-session-persistence.properties +++ b/feature-session-persistence/src/main/feature/config/feature-session-persistence.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # feature-session-persistence # ================================================================================ -# Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017, 2019, 2021 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. @@ -18,6 +18,7 @@ # ============LICENSE_END========================================================= ### +eclipselink.target-database=MySQL javax.persistence.jdbc.driver= org.mariadb.jdbc.Driver javax.persistence.jdbc.url=jdbc:mariadb://${env:SQL_HOST}:3306/sessionpersistence javax.persistence.jdbc.user=${env:SQL_USER} diff --git a/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java b/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java index 4700e8ae..93440dad 100644 --- a/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java +++ b/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java @@ -2,14 +2,14 @@ * ============LICENSE_START======================================================= * feature-session-persistence * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018, 2021 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. @@ -20,14 +20,16 @@ package org.onap.policy.drools.persistence; +import org.eclipse.persistence.config.PersistenceUnitProperties; + public class DroolsPersistenceProperties { /* * feature-session-persistence.properties parameter key values */ - public static final String DB_DRIVER = "javax.persistence.jdbc.driver"; - public static final String DB_URL = "javax.persistence.jdbc.url"; - public static final String DB_USER = "javax.persistence.jdbc.user"; - public static final String DB_PWD = "javax.persistence.jdbc.password"; + public static final String DB_DRIVER = PersistenceUnitProperties.JDBC_DRIVER; + public static final String DB_URL = PersistenceUnitProperties.JDBC_URL; + public static final String DB_USER = PersistenceUnitProperties.JDBC_USER; + public static final String DB_PWD = PersistenceUnitProperties.JDBC_PASSWORD; public static final String DB_SESSIONINFO_TIMEOUT = "persistence.sessioninfo.timeout"; public static final String JTA_OBJECTSTORE_DIR = "persistence.objectstore.dir"; diff --git a/feature-session-persistence/src/test/resources/feature-session-persistence.properties b/feature-session-persistence/src/test/resources/feature-session-persistence.properties index a1e9cc43..1c662f95 100644 --- a/feature-session-persistence/src/test/resources/feature-session-persistence.properties +++ b/feature-session-persistence/src/test/resources/feature-session-persistence.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # feature-session-persistence # ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017, 2021 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. @@ -18,6 +18,7 @@ # ============LICENSE_END========================================================= ### +eclipselink.target-database=Auto javax.persistence.jdbc.driver=org.h2.Driver javax.persistence.jdbc.url=jdbc:h2:mem:TestPersistenceFeature javax.persistence.jdbc.user=testuser diff --git a/feature-state-management/src/main/feature/config/feature-state-management.properties b/feature-state-management/src/main/feature/config/feature-state-management.properties index d2df6c52..84309e41 100644 --- a/feature-state-management/src/main/feature/config/feature-state-management.properties +++ b/feature-state-management/src/main/feature/config/feature-state-management.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # feature-state-management # ================================================================================ -# Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017-2019, 2021 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. @@ -19,6 +19,7 @@ ### # DB properties +eclipselink.target-database=MySQL javax.persistence.jdbc.driver=org.mariadb.jdbc.Driver javax.persistence.jdbc.url=jdbc:mariadb://${env:SQL_HOST}:3306/statemanagement javax.persistence.jdbc.user=${env:SQL_USER} diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java index 08c8e3a5..081a8292 100644 --- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java +++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * feature-state-management * ================================================================================ - * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2021 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. @@ -116,6 +116,7 @@ public class DroolsPdpIntegrityMonitor extends IntegrityMonitor { checkPropError(stateManagementProperties, StateManagementProperties.SITE_NAME); checkPropError(stateManagementProperties, StateManagementProperties.NODE_TYPE); checkPropError(stateManagementProperties, StateManagementProperties.DEPENDENCY_GROUPS); + checkPropError(stateManagementProperties, StateManagementProperties.DB_TYPE); checkPropError(stateManagementProperties, StateManagementProperties.DB_DRIVER); checkPropError(stateManagementProperties, StateManagementProperties.DB_URL); checkPropError(stateManagementProperties, StateManagementProperties.DB_USER); diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementProperties.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementProperties.java index d7f15883..20494b0f 100644 --- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementProperties.java +++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementProperties.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * feature-state-management * ================================================================================ - * Copyright (C) 2017-2018, 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018, 2020-2021 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. @@ -21,6 +21,7 @@ package org.onap.policy.drools.statemanagement; import java.util.Properties; +import org.eclipse.persistence.config.PersistenceUnitProperties; import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,10 +34,11 @@ public class StateManagementProperties { public static final String NODE_TYPE = "node_type"; public static final String SITE_NAME = "site_name"; - public static final String DB_DRIVER = "javax.persistence.jdbc.driver"; - public static final String DB_URL = "javax.persistence.jdbc.url"; - public static final String DB_USER = "javax.persistence.jdbc.user"; - public static final String DB_PWD = "javax.persistence.jdbc.password"; + public static final String DB_DRIVER = PersistenceUnitProperties.JDBC_DRIVER; + public static final String DB_URL = PersistenceUnitProperties.JDBC_URL; + public static final String DB_USER = PersistenceUnitProperties.JDBC_USER; + public static final String DB_PWD = PersistenceUnitProperties.JDBC_PASSWORD; + public static final String DB_TYPE = PersistenceUnitProperties.TARGET_DATABASE; public static final String TEST_SERVICES = PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES; public static final String TEST_SERVICES_DEFAULT = "TEST"; diff --git a/feature-state-management/src/test/resources/feature-state-management.properties b/feature-state-management/src/test/resources/feature-state-management.properties index 5e1864a3..ef7b805a 100644 --- a/feature-state-management/src/test/resources/feature-state-management.properties +++ b/feature-state-management/src/test/resources/feature-state-management.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # feature-state-management # ================================================================================ -# Copyright (C) 2017, 2020 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017, 2020-2021 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. @@ -19,6 +19,7 @@ ### # DB properties +eclipselink.target-database=Auto javax.persistence.jdbc.driver = org.h2.Driver javax.persistence.jdbc.url = jdbc:h2:mem:statemanagement javax.persistence.jdbc.user = sa diff --git a/policy-core/pom.xml b/policy-core/pom.xml index c2d4b040..6058f8b2 100644 --- a/policy-core/pom.xml +++ b/policy-core/pom.xml @@ -3,7 +3,7 @@ ============LICENSE_START======================================================= ONAP Policy Engine - Drools PDP ================================================================================ - Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. Modifications Copyright (C) 2019 Bell Canada. Modifications Copyright (C) 2020 Nordix Foundation. ================================================================================ @@ -78,6 +78,16 @@ <dependency> <groupId>org.drools</groupId> <artifactId>drools-persistence-jpa</artifactId> + <!-- + Exclude this because it's incompatible with eclipselink, which already + includes the same classes. + --> + <exclusions> + <exclusion> + <groupId>javax.persistence</groupId> + <artifactId>javax.persistence-api</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> diff --git a/policy-management/pom.xml b/policy-management/pom.xml index 2600c5e0..7890d887 100644 --- a/policy-management/pom.xml +++ b/policy-management/pom.xml @@ -3,7 +3,7 @@ ============LICENSE_START======================================================= ONAP Policy Engine - Drools PDP ================================================================================ - Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. Modifications Copyright (C) 2020 Nordix Foundation. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); @@ -281,6 +281,16 @@ <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> + <!-- + Exclude this because it's incompatible with eclipselink, which already + includes the same classes. + --> + <exclusions> + <exclusion> + <groupId>javax.persistence</groupId> + <artifactId>javax.persistence-api</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> |