Fix write failure on PDP statistics 17/119417/1
authorliamfallon <liam.fallon@est.tech>
Fri, 19 Mar 2021 18:18:10 +0000 (18:18 +0000)
committerJorge Hernandez <jorge.hernandez-herrero@att.com>
Mon, 22 Mar 2021 20:32:54 +0000 (20:32 +0000)
commit04868c54c8139fcf6163541540879c6243ec06fb
treedec97b2618804e1ddca55c269ad727f5eb8fdc65
parentcfb5faf035e743e88829ef90a99d6f0c501d37f8
Fix write failure on PDP statistics

Due to the precision of time stamps being saved to the nearest second,
a millisecond precision timestamp was being compared to a second
precision timestamp, causing the write to fail. This change fixes that.

A unit test is also added to test for this on the provider.

In addition, a USE-MARIADB flag is being introduced, which allows unit
tests to be run against a locally installed MariaDB instance so that the
unit tests can be verified against MariaDB locally rather than H2, the
default in Gerrit.

Issue-ID: POLICY-3146
Change-Id: I878f160956e89506743dc074679ee81ac1c48216
Signed-off-by: liamfallon <liam.fallon@est.tech>
(cherry picked from commit d6db5582b6705c11abbf8b507aa423aa00bcd7ae)
16 files changed:
models-base/src/main/java/org/onap/policy/models/base/PfReferenceTimestampKey.java
models-base/src/main/java/org/onap/policy/models/base/PfTimestampKey.java
models-dao/src/test/resources/META-INF/persistence.xml
models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/provider/PdpProviderTest.java
models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/provider/PdpStatisticsProviderTest.java
models-pdp/src/test/resources/META-INF/persistence.xml
models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyStatisticsPersistenceTest.java [new file with mode: 0644]
models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyToscaPersistenceTest.java
models-provider/src/test/java/org/onap/policy/models/provider/impl/PolicyTypePersistenceTest.java
models-provider/src/test/resources/META-INF/persistence.xml
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderGenericTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTypeTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProviderTest.java
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaServiceTemplateProviderTest.java
models-tosca/src/test/resources/META-INF/persistence.xml