aboutsummaryrefslogtreecommitdiffstats
path: root/models-dao/src/test
AgeCommit message (Collapse)AuthorFilesLines
2021-03-22Fix write failure on PDP statisticsliamfallon1-1/+2
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)
2021-02-19Refactor timestamp property in policy models to use Instantrameshiyer271-5/+5
Updated JPA classes to use java.sql.TImestamp rather than Instant. Issue-ID: POLICY-3069 Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech> Change-Id: If5b874ec96931d4b8dd142d46a9980e83a4708fc
2020-12-17Use ValidationResult for models v2.0Jim Hahn3-11/+18
Policy models uses PfValidationXxx classes which are totally unrelated to ValidationResult in policy common. This precludes the use of various utility methods and annotations for doing validation. Modified policy models to use ValidationResult instead. This approach uses function calls, though a future approach could make use of annotations instead. Issue-ID: POLICY-2648 Change-Id: I9760f1dc46902ab6bef7f440f3caf5e951660a5d Signed-off-by: Jim Hahn <jrh3@att.com>
2020-08-20Sonar Fixes policy/models, removing model-yamluj426b1-7/+6
Change-Id: Icd82ea1aef90e4d638b13958519aac5ed5a53f73 Issue-ID: POLICY-2714 Signed-off-by: uj426b <uj426b@att.com>
2020-06-18Changes for Checkstyle 8.32liamfallon4-10/+0
Issue-ID: POLICY-2188 Change-Id: I6db16763c1d2d80ff934302081a8dfc16afa7d9a Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-04-07Address sonar issues in modelsJim Hahn1-2/+3
Addressed the following sonar issues: - use RE2 instead of java.util Pattern for "+" and "*" - don't use deprecated methods - for Date(long), sonar appeared not to parse the argument's type correctly. Modified the code slightly to make sonar happy - duplicate blocks of code - either log or throw - missing assert in junit - for SDNR & VFC, eliminated threads, as they are unnecessary - duplicate code block in different branches - useless assignments - redeclaring abstract methods - cyclomatic complexity - used lombok in some cases (e.g., EqualsAndHashCode) - assert argument order - actually deleted ControlLoopTargetType, because it is not needed and sonar complains regardless of which order is used - add private constructor to utility classes - use StandardCharsets instead of literals Also: - added logback-test.xml to SO to eliminate the voluminous output from the junit test Issue-ID: POLICY-2305 Change-Id: I586c331781bedbd54a115a71847d04d293689445 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-02-18Add safe entity delete, fix multiple entity getliamfallon1-2/+0
This review implements checks on whether entities are being used or referenced propr to allowing deletes. The review also fixes bugs on multiple entity get returning 4040 not found Issue-ID: POLICY-1402 Change-Id: I9cebb9a873098740e9ff4be6284d6307e19838bd Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-18add unit test for pdpstatistics providerning.xi3-7/+214
Issue-ID: POLICY-2314 Signed-off-by: ning.xi <ning.xi@est.tech> Change-Id: Ifb23ab301a326cc30950ecc2f115979fa261bc68
2019-08-27Replace copyTo methods with copy constructorsJim Hahn2-29/+17
Deleted the copyTo() method from PfConcepts and replaced uses with deep-copy constructors. Also added mapMap() and makeCopy() methods to PfUtils to facilitate. Change-Id: Id6391bb806ef0dfab6c1089278bf2b514c7e303e Issue-ID: POLICY-1600 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-18Change getCanonicalName to getName in modelsJim Hahn1-2/+2
Per javadocs, getName() should generally be used instead of Class.getCanonicalName(). This change only applies to classes; it does not apply to File objects. Note: this impacts the output from PfValidationMessage, as it will now list the names of embedded classes with a "$" separator instead of a ".". Change-Id: I2cd64bc0281dd324bf80eac57335a7299a516447 Issue-ID: POLICY-1646 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-17Fix more sonar issues in models: yaml to daoJim Hahn3-111/+95
Extracted common Strings into constants. Reduced "cyclomatic complexity" in some return statements. Used assertj to eliminate "log or rethrow" messages in junit tests. models-yaml models-base models-dao Change-Id: I20548d4cf5e67d085245e0d54df8ba0116ec86ec Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-12UNit test and minor fixes for DB parsliamfallon1-4/+7
Add unit test for the new database provider driver parameter. Address the comments raised in the last review. Issue-ID: POLICY-1095 Change-Id: I9f629d9f4446d12bfb492e00e49e07b97ef5a490 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-11Fix database propertiesliamfallon2-19/+18
Issue-ID: POLICY-1095 Change-Id: I3edd70898836d3bd978643857d1ba29599b1cf6c Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-08Add lists and tests for PDP filtersliamfallon1-0/+2
The policy type and policy filters for PDP groups are added in this review. Also filter tests for PDP group filter is completed. Issue-ID: POLICY-1095 Change-Id: Ia28776c809f2ab879af4007b3480621637a83f69 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-04Add filter obejcts for conceptsliamfallon1-6/+36
This review: - Fixes the bug in getting policies where the key fields were null - Removes complex version checks from DAO interface - Simplifies provider API by introducing filter objects for searches Issue-ID: POLICY-1095 Change-Id: I5ab7471c03e8b61849e7882ed18541acd627dc39 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-03Add impl of more PDP persistenceliamfallon2-0/+51
Add the implementation of more metods in the PDP provider. Issue-ID: POLICY-1095 Change-Id: Ie02189cad7a262a453e1f731190525f838648401 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-03-19Move examples into separate moduleliamfallon1-2/+0
Issue-ID: POLICY-1195 Change-Id: Id2dc5b5b490134648ca267e27b795f3f4c03bc7b Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-03-18Add serialization/deserialization for tosca policyChenfei Gao1-1/+1
Includes: a) Added serialization/deserialization for tosca policy b) Added serialization/deserialization for tosca topology template c) Added serialization/deserialization for tosca service template More junit tests for serialization/deserialization are being added, using the example input/output. Issue-ID: POLICY-1441 Change-Id: I5ef6b5ede35cfb1e88619e92535393cf8056987b Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-03-14Add DAO Enabled Tosca Modelliamfallon2-0/+85
Add DAO annotations to TOSCA model Add keying between concepts and define foreign keys in objects for translation to DB schema Added provider interface, factory, and stubbed implementation. Completed unit test for models-base Completed unit test for models-dao Completed unit test for models-tosca Issue-ID: POLICY-1195 Change-Id: I53a0ba8b7a679b6887b38bdab184b60315e0cf5b Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-03-05Add DAO module for Modelsliamfallon6-0/+748
This patch set fixes some typos and license headers. Issue-ID: POLICY-1195 Change-Id: I2d15b00fcb50ea92746ab7c5a87b57efa07196fe Signed-off-by: liamfallon <liam.fallon@est.tech>