Uploaded image for project: 'Policy Framework'
  1. Policy Framework
  2. POLICY-55

Ensure drools-application JUnit test works on ONAP JJB using in memory database

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Medium Medium
    • Amsterdam Release
    • None
    • None
    • None
    • Policy Sprint 1, Policy Sprint 3 - 8/7-8/21, Policy Sprint 4 - 8/21-9/4, Policy Sprint 5 - 9/6-9/20

      The JUnit test in file "/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopXacmlGuardTest.java" requires Drools to write to the OperationsHistory DB and XACML PDP to read from it when a Guard policy is executed.

      Currently, the test assumes that there is a remote DB exists. Since there is no remote DB available, the test fails. We need to create in-memory DB just for running the test and let Drools and XACML know about it.

      Create a new in-memory DB in the JUnit test and specify the access to it in "/eventmanager/src/main/resources/META-INF/persistence.xml".

      If the new DB will have a different SQL syntax (than mariadb), then the SQL queries in Guard (/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java) will need to be updated.

            pdragosh pdragosh
            pdragosh pdragosh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: