aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.sdnc
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-02-17 13:57:56 -0500
committerJim Hahn <jrh3@att.com>2020-02-17 20:41:09 -0500
commite44f1a1c58efed9fbe2efce78864aaee3b577003 (patch)
treee0a1903c107162dc2d9a3bcae2257862a99c6b48 /models-interactions/model-actors/actor.sdnc
parent85a2fee4074903012e77f78e26328b9a03a8bdfc (diff)
More changes to actor code
Use Coder.convert() from policy-common. Passed response to setOutcome(). Changed class names from XxxOperator to XxxOperation. Modified SDNC junits to invoke start() instead of startOperationAsync(). Changed context obtain() to re-run if the future was canceled. Added junit support class, BasicBidirectionalTopicOperation. Modified HttpOperation to allow subsequent requests to be issued. Some actors, like SO, send an initial HTTP request and then follow it with HTTP "are you done?" requests. Issue-ID: POLICY-2363-prop Change-Id: I12b5c2d4f07254e0cb79fabfe1ccf844b70a0654 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.sdnc')
-rw-r--r--models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BandwidthOnDemandOperationTest.java (renamed from models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BandwidthOnDemandOperatorTest.java)4
-rw-r--r--models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java (renamed from models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperator.java)9
-rw-r--r--models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/RerouteOperationTest.java (renamed from models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/RerouteOperatorTest.java)4
-rw-r--r--models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/SdncOperationTest.java (renamed from models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/SdncOperatorTest.java)2
4 files changed, 10 insertions, 9 deletions
diff --git a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BandwidthOnDemandOperatorTest.java b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BandwidthOnDemandOperationTest.java
index 0623df2f5..42042da67 100644
--- a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BandwidthOnDemandOperatorTest.java
+++ b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BandwidthOnDemandOperationTest.java
@@ -28,11 +28,11 @@ import org.junit.Before;
import org.junit.Test;
import org.onap.policy.sdnc.SdncRequest;
-public class BandwidthOnDemandOperatorTest extends BasicSdncOperator {
+public class BandwidthOnDemandOperationTest extends BasicSdncOperation {
private BandwidthOnDemandOperation oper;
- public BandwidthOnDemandOperatorTest() {
+ public BandwidthOnDemandOperationTest() {
super(DEFAULT_ACTOR, BandwidthOnDemandOperation.NAME);
}
diff --git a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperator.java b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java
index deafc4e9d..db8751d26 100644
--- a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperator.java
+++ b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java
@@ -49,14 +49,14 @@ import org.powermock.reflect.Whitebox;
/**
* Superclass for various operator tests.
*/
-public abstract class BasicSdncOperator extends BasicHttpOperation<SdncRequest> {
+public abstract class BasicSdncOperation extends BasicHttpOperation<SdncRequest> {
protected SdncResponse response;
/**
* Constructs the object using a default actor and operation name.
*/
- public BasicSdncOperator() {
+ public BasicSdncOperation() {
super();
}
@@ -66,7 +66,7 @@ public abstract class BasicSdncOperator extends BasicHttpOperation<SdncRequest>
* @param actor actor name
* @param operation operation name
*/
- public BasicSdncOperator(String actor, String operation) {
+ public BasicSdncOperation(String actor, String operation) {
super(actor, operation);
}
@@ -94,7 +94,8 @@ public abstract class BasicSdncOperator extends BasicHttpOperation<SdncRequest>
protected SdncRequest verifyOperation(SdncOperation operation)
throws InterruptedException, ExecutionException, TimeoutException {
- CompletableFuture<OperationOutcome> future2 = operation.startOperationAsync(1, outcome);
+ CompletableFuture<OperationOutcome> future2 = operation.start();
+ executor.runAll(100);
assertFalse(future2.isDone());
verify(client).post(callbackCaptor.capture(), any(), requestCaptor.capture(), any());
diff --git a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/RerouteOperatorTest.java b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/RerouteOperationTest.java
index 7fc5ee7c2..a98c38180 100644
--- a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/RerouteOperatorTest.java
+++ b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/RerouteOperationTest.java
@@ -28,11 +28,11 @@ import org.junit.Before;
import org.junit.Test;
import org.onap.policy.sdnc.SdncRequest;
-public class RerouteOperatorTest extends BasicSdncOperator {
+public class RerouteOperationTest extends BasicSdncOperation {
private RerouteOperation oper;
- public RerouteOperatorTest() {
+ public RerouteOperationTest() {
super(DEFAULT_ACTOR, RerouteOperation.NAME);
}
diff --git a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/SdncOperatorTest.java b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/SdncOperationTest.java
index 4bc514c08..e0825e13b 100644
--- a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/SdncOperatorTest.java
+++ b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/SdncOperationTest.java
@@ -30,7 +30,7 @@ import org.junit.Before;
import org.junit.Test;
import org.onap.policy.sdnc.SdncRequest;
-public class SdncOperatorTest extends BasicSdncOperator {
+public class SdncOperationTest extends BasicSdncOperation {
private SdncRequest request;
private SdncOperation oper;