diff options
author | liamfallon <liam.fallon@ericsson.com> | 2018-02-08 21:54:16 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@ericsson.com> | 2018-02-08 22:23:54 +0000 |
commit | d536517dd5d45abeb037eb3900759771d97b2418 (patch) | |
tree | 38c5dda6db8e1ef7846d97b456664b05259e6039 /controlloop/common/eventmanager/src/test/resources | |
parent | 5343982363a2221cdf9bd28fdb1f6547c04745f6 (diff) |
JUint/Technical Debt for eventmanager
Unit test expanded for SO POJOs, technical debt removed in eventmanager.
Change-Id: I7045f5af88fd2c15019befe29a0b4fcd69801c49
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Issue-ID: POLICY-455
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'controlloop/common/eventmanager/src/test/resources')
6 files changed, 160 insertions, 0 deletions
diff --git a/controlloop/common/eventmanager/src/test/resources/META-INF/persistence.xml b/controlloop/common/eventmanager/src/test/resources/META-INF/persistence.xml new file mode 100644 index 000000000..d5fadfffb --- /dev/null +++ b/controlloop/common/eventmanager/src/test/resources/META-INF/persistence.xml @@ -0,0 +1,17 @@ +<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> + <persistence-unit name="TestOperationsHistoryPU" transaction-type="RESOURCE_LOCAL"> + <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> + + <class>org.onap.policy.whatever.WhatEver</class> + + <properties> + <property name="javax.persistence.jdbc.url" value="jdbc:derby:memory:apex_test" /> + <property name="javax.persistence.target-database" value="Derby" /> + <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver" /> + + <property name="eclipselink.ddl-generation" value="drop-and-create-tables" /> + <property name="eclipselink.ddl-generation.output-mode" value="database"/> + <property name="eclipselink.logging.level" value="INFO" /> + </properties> + </persistence-unit> +</persistence> diff --git a/controlloop/common/eventmanager/src/test/resources/badtriggerpolicy.yaml b/controlloop/common/eventmanager/src/test/resources/badtriggerpolicy.yaml new file mode 100644 index 000000000..e263cd5b2 --- /dev/null +++ b/controlloop/common/eventmanager/src/test/resources/badtriggerpolicy.yaml @@ -0,0 +1,62 @@ +controlLoop: + version: 1.0.0 + controlLoopName: ControlLoop-vService-cbed919f-2212-4ef7-8051-fe6308da1bda + services: + - serviceName: service1 + resources: + - resourceName: resource1 + resourceType: VF + - resourceName: resource2 + resourceType: VF + - resourceName: resource3 + resourceType: VF + - resourceName: resource4 + resourceType: VF + - resourceName: resource5 + resourceType: VF + trigger_policy: a-policy-that-does-not-exist + timeout: 60 + +policies: + - id: unique-policy-id-1-restart + name: Restart Policy + description: + actor: APPC + recipe: Restart + target: + type: VNF + retry: 1 + timeout: 20 + success: final_success + failure: unique-policy-id-2-rebuild + failure_timeout: unique-policy-id-2-rebuild + failure_retries: unique-policy-id-2-rebuild + failure_exception: final_failure_exception + + - id: unique-policy-id-2-rebuild + name: Rebuild Policy + description: + actor: APPC + recipe: Rebuild + target: VM + retry: 0 + timeout: 10 + success: final_success + failure: unique-policy-id-3-migrate + failure_timeout: unique-policy-id-3-migrate + failure_retries: unique-policy-id-3-migrate + failure_exception: final_failure_exception + + - id: unique-policy-id-3-migrate + name: Migrate Policy + description: + actor: APPC + recipe: Migrate + target: VM + retry: 0 + timeout: 30 + success: final_success + failure: final_failure + failure_timeout: final_failure_timeout + failure_retries: final_failure_retries + failure_exception: final_failure_exception diff --git a/controlloop/common/eventmanager/src/test/resources/nopolicy.yaml b/controlloop/common/eventmanager/src/test/resources/nopolicy.yaml new file mode 100644 index 000000000..d3758f3da --- /dev/null +++ b/controlloop/common/eventmanager/src/test/resources/nopolicy.yaml @@ -0,0 +1,18 @@ +controlLoop: + version: 1.0.0 + controlLoopName: ControlLoop-vService-cbed919f-2212-4ef7-8051-fe6308da1bda + services: + - serviceName: service1 + resources: + - resourceName: resource1 + resourceType: VF + - resourceName: resource2 + resourceType: VF + - resourceName: resource3 + resourceType: VF + - resourceName: resource4 + resourceType: VF + - resourceName: resource5 + resourceType: VF + trigger_policy: a-policy-that-does-not-exist + timeout: 60 diff --git a/controlloop/common/eventmanager/src/test/resources/notutf8.yaml b/controlloop/common/eventmanager/src/test/resources/notutf8.yaml Binary files differnew file mode 100644 index 000000000..c2366a1cd --- /dev/null +++ b/controlloop/common/eventmanager/src/test/resources/notutf8.yaml diff --git a/controlloop/common/eventmanager/src/test/resources/string.yaml b/controlloop/common/eventmanager/src/test/resources/string.yaml new file mode 100644 index 000000000..dc03f8041 --- /dev/null +++ b/controlloop/common/eventmanager/src/test/resources/string.yaml @@ -0,0 +1 @@ +string: hello diff --git a/controlloop/common/eventmanager/src/test/resources/testSOactor.yaml b/controlloop/common/eventmanager/src/test/resources/testSOactor.yaml new file mode 100644 index 000000000..0d5f3b1e2 --- /dev/null +++ b/controlloop/common/eventmanager/src/test/resources/testSOactor.yaml @@ -0,0 +1,62 @@ +controlLoop: + version: 1.0.0 + controlLoopName: ControlLoop-vService-cbed919f-2212-4ef7-8051-fe6308da1bda + services: + - serviceName: service1 + resources: + - resourceName: resource1 + resourceType: VF + - resourceName: resource2 + resourceType: VF + - resourceName: resource3 + resourceType: VF + - resourceName: resource4 + resourceType: VF + - resourceName: resource5 + resourceType: VF + trigger_policy: unique-policy-id-1-restart + timeout: 60 + +policies: + - id: unique-policy-id-1-restart + name: Restart Policy + description: + actor: SO + recipe: Restart + target: + type: VNF + retry: 1 + timeout: 20 + success: final_success + failure: unique-policy-id-2-rebuild + failure_timeout: unique-policy-id-2-rebuild + failure_retries: unique-policy-id-2-rebuild + failure_exception: final_failure_exception + + - id: unique-policy-id-2-rebuild + name: Rebuild Policy + description: + actor: SO + recipe: Rebuild + target: VM + retry: 0 + timeout: 10 + success: final_success + failure: unique-policy-id-3-migrate + failure_timeout: unique-policy-id-3-migrate + failure_retries: unique-policy-id-3-migrate + failure_exception: final_failure_exception + + - id: unique-policy-id-3-migrate + name: Migrate Policy + description: + actor: SO + recipe: Migrate + target: VM + retry: 0 + timeout: 30 + success: final_success + failure: final_failure + failure_timeout: final_failure_timeout + failure_retries: final_failure_retries + failure_exception: final_failure_exception |