Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

mvn clean install -DUSE-POSTGRES


[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] PdpProviderTest.cudPolicyStatus_Create:746
Expected size:<2> but was:<5> in:
<[PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=pdp3pdp2, policy=MyPolicy 10MyPolicyB 2.203.304, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=pdp2pdp3, policy=MyPolicyB 2MyPolicy 10.320.430, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=pdp1, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=idYidX, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=idXidY, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS)]>
[ERROR] PdpProviderTest.cudPolicyStatus_Delete:795
Expected size:<4> but was:<7> in:
<[PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=pdp3pdp2, policy=MyPolicy 10MyPolicyB 2.203.304, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=pdp2pdp3, policy=MyPolicyB 2MyPolicy 10.320.430, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=pdp1, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=idYidX, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=idXidY, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=idZ, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=idW, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS)]>
[ERROR] PdpProviderTest.cudPolicyStatus_Update:767
Expected size:<4> but was:<11> in:
<[PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=pdp3pdp2, policy=MyPolicy 10MyPolicyB 2.203.304, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=pdp2pdp3, policy=MyPolicyB 2MyPolicy 10.320.430, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=pdp1, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=idYidX, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=idXidY, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=idZ, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=idW, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=zIdwId, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=xIdzId, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=wIdyId, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=yIdxId, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS)]>
[ERROR] PdpProviderTest.testFromAuthorativeStatus:834
Expecting empty but was:<[PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=pdp2, policy=MyPolicyB 2.3.4, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=pdp3, policy=MyPolicy 10.20.30, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS),
PdpPolicyStatus(pdpGroup=groupA, pdpType=MyPdpType, pdpId=pdp1, policy=MyPolicy 1.2.3, policyType=MyPolicyType 1.2.4, deploy=true, state=SUCCESS)]>
[ERROR] PdpStatisticsProviderTest.testGetPdpStatistics:184 expected:<...s(pdpInstanceId=name[,timeStamp=2004-03-10T02:05:19Z,generatedId=1,pdpGroupName=group,pdpSubGroupName=subgroup,policyDeployCount=2,policyDeploySuccessCount=1,policyDeployFailCount=1,policyExecutedCount=2,policyExecutedSuccessCount=1,policyExecutedFailCount=1,engineStats=[]),PdpStatistics(pdpInstanceId=name2,timeStamp=2004-03-10T02:05:50Z,generatedId=2],pdpGroupName=group,...> but was:<...s(pdpInstanceId=name[2,timeStamp=2004-03-10T02:05:50Z,generatedId=2,pdpGroupName=group,pdpSubGroupName=subgroup,policyDeployCount=2,policyDeploySuccessCount=1,policyDeployFailCount=1,policyExecutedCount=2,policyExecutedSuccessCount=1,policyExecutedFailCount=1,engineStats=[]),PdpStatistics(pdpInstanceId=name,timeStamp=2004-03-10T02:05:19Z,generatedId=1],pdpGroupName=group,...>


models-tosca in postgres

Update the following files with java code above:

src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderGenericTest.java
src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTest.java
src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTypeTest.java
src/test/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProviderTest.java
src/test/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaServiceTemplateProviderTest.java


and pom.xml with postgres dependency.

[ERROR] Failures:
[ERROR] AuthorativeToscaProviderPolicyTypeTest.testPolicyTypesGet:167 expected:<2> but was:<4>
[ERROR] AuthorativeToscaProviderPolicyTypeTest.testPolicyTypesGetFiltered:253 expected:<2> but was:<4>
[ERROR] SimpleToscaProviderTest.testCreateUpdateGetDeleteDataType:174
Expecting message to be:
<"no data types found">
but was:
<"data type DataType0:0.0.1 not found">

Throwable that failed the check:


models-providers

Update the following files with java code below:

src/test/java/org/onap/policy/models/provider/impl/PolicyStatisticsPersistenceTest.java
src/test/java/org/onap/policy/models/provider/impl/PolicyToscaPersistenceTest.java
src/test/java/org/onap/policy/models/provider/impl/PolicyTypePersistenceTest.java


Code Block
languagejava
titlePolicyStatisticsPersistenceTest.java
        if (System.getProperty("USE-MARIADB") != null) {
            parameters.setDatabaseDriver("org.mariadb.jdbc.Driver");
            parameters.setDatabaseUrl("jdbc:mariadb://localhost:3306/policy");
        } else if (System.getProperty("USE-POSTGRES") != null) {
            parameters.setDatabaseDriver("org.postgresql.Driver");
            parameters.setDatabaseUrl("jdbc:postgresql://localhost:5432/policy");
            parameters.setDatabaseType("PostgreSQL");
        } else {
            parameters.setDatabaseDriver("org.h2.Driver");
            parameters.setDatabaseUrl("jdbc:h2:mem:PolicyStatisticsPersistenceTest");
        }


This passes all tests as before

models-dao also passes all tests.

All the tests work with H2 but this is an in-memory DB so the tables/records are not persisted.