diff options
Diffstat (limited to 'controlloop/common/model-impl/so/src')
24 files changed, 218 insertions, 163 deletions
diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOAsyncRequestStatus.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOAsyncRequestStatus.java index ea1257d4d..5bb03de06 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOAsyncRequestStatus.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOAsyncRequestStatus.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,11 +20,11 @@ package org.onap.policy.so; +import com.google.gson.annotations.SerializedName; + import java.io.Serializable; import java.time.LocalDateTime; -import com.google.gson.annotations.SerializedName; - public class SOAsyncRequestStatus implements Serializable { private static final long serialVersionUID = -3283942659786236032L; diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOCloudConfiguration.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOCloudConfiguration.java index 7ad497a9f..b52fe2b7c 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOCloudConfiguration.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOCloudConfiguration.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,10 @@ package org.onap.policy.so; -import java.io.Serializable; - import com.google.gson.annotations.SerializedName; +import java.io.Serializable; + public class SOCloudConfiguration implements Serializable { private static final long serialVersionUID = -3283942659786236032L; diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOInstanceReferences.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOInstanceReferences.java index 307e0514f..645e7f711 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOInstanceReferences.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOInstanceReferences.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,10 @@ package org.onap.policy.so; -import java.io.Serializable; - import com.google.gson.annotations.SerializedName; +import java.io.Serializable; + public class SOInstanceReferences implements Serializable { private static final long serialVersionUID = -3283942659786236032L; diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOManager.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOManager.java index 92d52f4c2..a3f2be30b 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOManager.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOManager.java @@ -63,7 +63,7 @@ public final class SOManager { private long restGetTimeout = GET_REQUEST_WAIT_INTERVAL; /** - * Default constructor + * Default constructor. */ public SOManager() { restManager = new RESTManager(); @@ -100,12 +100,11 @@ public final class SOManager { /** * This method makes an asynchronous Rest call to MSO and inserts the response into * Drools working memory. - * + * + * @param requestID request id * @param wm the Drools working memory - * @param url the URL to use on the POST request - * @param urlBase the SO base URL - * @param username user name for SO requests - * @param password password for SO requests + * @param serviceInstanceId service instance id + * @param vnfInstanceId vnf instance id * @param request the SO request * @return a concurrent Future for the thread that handles the request */ diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOModelInfo.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOModelInfo.java index eb257a7e9..15cbd23d0 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOModelInfo.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOModelInfo.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,10 @@ package org.onap.policy.so; -import java.io.Serializable; - import com.google.gson.annotations.SerializedName; +import java.io.Serializable; + public class SOModelInfo implements Serializable { private static final long serialVersionUID = -3283942659786236032L; diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOPolicyExceptionHolder.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOPolicyExceptionHolder.java index 975a21cbc..4c4fed1f2 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOPolicyExceptionHolder.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOPolicyExceptionHolder.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,10 @@ package org.onap.policy.so; -import java.io.Serializable; - import com.google.gson.annotations.SerializedName; +import java.io.Serializable; + public class SOPolicyExceptionHolder implements Serializable { private static final long serialVersionUID = -3283942659786236032L; diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORelatedInstance.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORelatedInstance.java index e7f3efc57..90fe339ee 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORelatedInstance.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORelatedInstance.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,10 @@ package org.onap.policy.so; -import java.io.Serializable; - import com.google.gson.annotations.SerializedName; +import java.io.Serializable; + public class SORelatedInstance implements Serializable { private static final long serialVersionUID = -3283942659786236032L; diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORelatedInstanceListElement.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORelatedInstanceListElement.java index 1148ef1e0..4d3d27346 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORelatedInstanceListElement.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORelatedInstanceListElement.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,10 @@ package org.onap.policy.so; -import java.io.Serializable; - import com.google.gson.annotations.SerializedName; +import java.io.Serializable; + public class SORelatedInstanceListElement implements Serializable { private static final long serialVersionUID = -3283942659786236032L; diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequest.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequest.java index 73ebba260..4a2f405e7 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequest.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,12 +20,12 @@ package org.onap.policy.so; +import com.google.gson.annotations.SerializedName; + import java.io.Serializable; import java.time.LocalDateTime; import java.util.UUID; -import com.google.gson.annotations.SerializedName; - public class SORequest implements Serializable { private static final long serialVersionUID = -3283942659786236032L; diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestDetails.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestDetails.java index 13d25cf81..465895117 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestDetails.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestDetails.java @@ -20,11 +20,12 @@ package org.onap.policy.so; +import com.google.gson.annotations.SerializedName; + import java.io.Serializable; import java.util.LinkedList; import java.util.List; import java.util.Map; -import com.google.gson.annotations.SerializedName; public class SORequestDetails implements Serializable { @@ -55,6 +56,11 @@ public class SORequestDetails implements Serializable { } + /** + * Constructor. + * + * @param soRequestDetails copy object + */ public SORequestDetails(SORequestDetails soRequestDetails) { this.modelInfo = soRequestDetails.modelInfo; this.cloudConfiguration = soRequestDetails.cloudConfiguration; @@ -66,48 +72,65 @@ public class SORequestDetails implements Serializable { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } SORequestDetails other = (SORequestDetails) obj; if (cloudConfiguration == null) { - if (other.cloudConfiguration != null) + if (other.cloudConfiguration != null) { return false; - } else if (!cloudConfiguration.equals(other.cloudConfiguration)) + } + } else if (!cloudConfiguration.equals(other.cloudConfiguration)) { return false; + } if (configurationParameters == null) { - if (other.configurationParameters != null) + if (other.configurationParameters != null) { return false; - } else if (!configurationParameters.equals(other.configurationParameters)) + } + } else if (!configurationParameters.equals(other.configurationParameters)) { return false; + } if (modelInfo == null) { - if (other.modelInfo != null) + if (other.modelInfo != null) { return false; - } else if (!modelInfo.equals(other.modelInfo)) + } + } else if (!modelInfo.equals(other.modelInfo)) { return false; + } if (relatedInstanceList == null) { - if (other.relatedInstanceList != null) + if (other.relatedInstanceList != null) { return false; - } else if (!relatedInstanceList.equals(other.relatedInstanceList)) + } + } else if (!relatedInstanceList.equals(other.relatedInstanceList)) { return false; + } if (requestInfo == null) { - if (other.requestInfo != null) + if (other.requestInfo != null) { return false; - } else if (!requestInfo.equals(other.requestInfo)) + } + } else if (!requestInfo.equals(other.requestInfo)) { return false; + } if (requestParameters == null) { - if (other.requestParameters != null) + if (other.requestParameters != null) { return false; - } else if (!requestParameters.equals(other.requestParameters)) + } + } else if (!requestParameters.equals(other.requestParameters)) { return false; + } if (subscriberInfo == null) { - if (other.subscriberInfo != null) + if (other.subscriberInfo != null) { return false; - } else if (!subscriberInfo.equals(other.subscriberInfo)) + } + } else if (!subscriberInfo.equals(other.subscriberInfo)) { return false; + } return true; } diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestError.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestError.java index 763210831..7594ef95c 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestError.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestError.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,10 @@ package org.onap.policy.so; -import java.io.Serializable; - import com.google.gson.annotations.SerializedName; +import java.io.Serializable; + public class SORequestError implements Serializable { private static final long serialVersionUID = -3283942659786236032L; diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestInfo.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestInfo.java index fd92e3284..c30e50c17 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestInfo.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestInfo.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,10 @@ package org.onap.policy.so; -import java.io.Serializable; - import com.google.gson.annotations.SerializedName; +import java.io.Serializable; + public class SORequestInfo implements Serializable { private static final long serialVersionUID = -3283942659786236032L; diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestParameters.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestParameters.java index 7ea20defd..69faded76 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestParameters.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestParameters.java @@ -20,11 +20,12 @@ package org.onap.policy.so; +import com.google.gson.annotations.SerializedName; + import java.io.Serializable; import java.util.LinkedList; import java.util.List; import java.util.Map; -import com.google.gson.annotations.SerializedName; public class SORequestParameters implements Serializable { diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestReferences.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestReferences.java index ed14f6b58..71b1cccfe 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestReferences.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestReferences.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,10 @@ package org.onap.policy.so; -import java.io.Serializable; - import com.google.gson.annotations.SerializedName; +import java.io.Serializable; + public class SORequestReferences implements Serializable { private static final long serialVersionUID = -3283942659786236032L; diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestStatus.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestStatus.java index 2e77c157b..79406574d 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestStatus.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SORequestStatus.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,15 +20,12 @@ package org.onap.policy.so; -import java.io.Serializable; - import com.google.gson.annotations.SerializedName; +import java.io.Serializable; + public class SORequestStatus implements Serializable { - /** - * - */ private static final long serialVersionUID = -3283942659786236032L; @SerializedName("percentProgress") diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOResponse.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOResponse.java index 20e0c4155..e9350838a 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOResponse.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOResponse.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,10 @@ package org.onap.policy.so; -import java.io.Serializable; - import com.google.gson.annotations.SerializedName; +import java.io.Serializable; + public class SOResponse implements Serializable { private static final long serialVersionUID = -3283942659786236032L; diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOResponseWrapper.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOResponseWrapper.java index e18cbb62d..dcf640d83 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOResponseWrapper.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOResponseWrapper.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,10 @@ package org.onap.policy.so; -import java.io.Serializable; - import com.google.gson.annotations.SerializedName; +import java.io.Serializable; + public class SOResponseWrapper implements Serializable { private static final long serialVersionUID = 7673023687132889069L; @@ -86,12 +86,12 @@ public class SOResponseWrapper implements Serializable { return result; } - public void setRequestID(String requestID) { - this.requestID = requestID; + public void setRequestID(String requestId) { + this.requestID = requestId; } - public void setSoResponse(SOResponse sOResponse) { - soResponse = sOResponse; + public void setSoResponse(SOResponse response) { + soResponse = response; } @Override diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOServiceExceptionHolder.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOServiceExceptionHolder.java index 703e13be5..65ba446e3 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOServiceExceptionHolder.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOServiceExceptionHolder.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,12 +20,12 @@ package org.onap.policy.so; +import com.google.gson.annotations.SerializedName; + import java.io.Serializable; import java.util.LinkedList; import java.util.List; -import com.google.gson.annotations.SerializedName; - public class SOServiceExceptionHolder implements Serializable { private static final long serialVersionUID = -3283942659786236032L; diff --git a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOSubscriberInfo.java b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOSubscriberInfo.java index 618e9ec1e..f7a4982a1 100644 --- a/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOSubscriberInfo.java +++ b/controlloop/common/model-impl/so/src/main/java/org/onap/policy/so/SOSubscriberInfo.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,10 @@ package org.onap.policy.so; -import java.io.Serializable; - import com.google.gson.annotations.SerializedName; +import java.io.Serializable; + public class SOSubscriberInfo implements Serializable { private static final long serialVersionUID = -3283942659786236032L; diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/DummyWorkingMemory.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/DummyWorkingMemory.java index af7ddc426..b8fd036c5 100644 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/DummyWorkingMemory.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/DummyWorkingMemory.java @@ -17,6 +17,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package org.onap.policy.so; import java.util.Collection; @@ -50,16 +51,15 @@ public class DummyWorkingMemory implements WorkingMemory { } @Override - public void removeEventListener(RuleRuntimeEventListener listener) { + public void addEventListener(AgendaEventListener listener) { } @Override - public Collection<RuleRuntimeEventListener> getRuleRuntimeEventListeners() { - return null; + public void addEventListener(KieBaseEventListener listener) { } @Override - public void addEventListener(AgendaEventListener listener) { + public void removeEventListener(RuleRuntimeEventListener listener) { } @Override @@ -67,16 +67,17 @@ public class DummyWorkingMemory implements WorkingMemory { } @Override - public Collection<AgendaEventListener> getAgendaEventListeners() { - return null; + public void removeEventListener(KieBaseEventListener listener) { } @Override - public void addEventListener(KieBaseEventListener listener) { + public Collection<RuleRuntimeEventListener> getRuleRuntimeEventListeners() { + return null; } @Override - public void removeEventListener(KieBaseEventListener listener) { + public Collection<AgendaEventListener> getAgendaEventListeners() { + return null; } @Override @@ -90,16 +91,16 @@ public class DummyWorkingMemory implements WorkingMemory { } @Override - public void dispose() { + public FactHandle insert(Object object) { + return null; } @Override - public String getEntryPointId() { - return null; + public void dispose() { } @Override - public FactHandle insert(Object object) { + public String getEntryPointId() { return null; } diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoDummyServer.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoDummyServer.java index 348523140..5eb0a01ee 100644 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoDummyServer.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoDummyServer.java @@ -22,6 +22,7 @@ package org.onap.policy.so; +import com.google.gson.Gson; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import javax.ws.rs.GET; @@ -29,7 +30,6 @@ import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.Response; -import com.google.gson.Gson; @Path("/SO") public class TestSoDummyServer { @@ -41,6 +41,11 @@ public class TestSoDummyServer { private static Map<String, SOResponse> ongoingRequestMap = new ConcurrentHashMap<>(); + /** + * Stats method. + * + * @return response + */ @GET @Path("/Stats") public Response serviceGetStats() { @@ -49,6 +54,12 @@ public class TestSoDummyServer { + ",\"POST\": " + postMessagesReceived + ",\"PUT\": " + putMessagesReceived + "}").build(); } + /** + * Get stat type. + * + * @param statType the stat type + * @return http response + */ @GET @Path("/OneStat/{statType}") public Response serviceGetStat(@PathParam("statType") final String statType) { @@ -56,6 +67,12 @@ public class TestSoDummyServer { return Response.status(200).entity("{\"TYPE\": " + statType + "}").build(); } + /** + * Post to service instantiation. + * + * @param jsonString string to send + * @return http response + */ @POST @Path("/serviceInstantiation/v7") public Response servicePostRequest(final String jsonString) { @@ -138,6 +155,14 @@ public class TestSoDummyServer { return null; } + /** + * Post. + * + * @param serviceInstanceId service instance id + * @param vnfInstanceId vnf instance id + * @param jsonString json body + * @return http response + */ @POST @Path("/serviceInstantiation/v7/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/scaleOut") public Response servicePostRequestVfModules(@PathParam("serviceInstanceId") final String serviceInstanceId, @@ -221,6 +246,12 @@ public class TestSoDummyServer { return null; } + /** + * Get instance ID. + * + * @param nsInstanceId node instance id + * @return http response + */ @GET @Path("/orchestrationRequests/v5/{nsInstanceId}") public Response soRequestStatus(@PathParam("nsInstanceId") final String nsInstanceId) { diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSOManager.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoManager.java index 4a7fdda8d..38bfcd398 100644 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSOManager.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoManager.java @@ -3,6 +3,7 @@ * TestSOManager * ================================================================================ * Copyright (C) 2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +18,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package org.onap.policy.so; import static org.junit.Assert.assertEquals; @@ -24,6 +26,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; + import java.io.IOException; import java.net.URI; import java.util.UUID; @@ -43,7 +46,7 @@ import org.junit.BeforeClass; import org.junit.Test; import org.onap.policy.drools.system.PolicyEngine; -public class TestSOManager { +public class TestSoManager { private static final String BASE_URI = "http://localhost:46553/TestSOManager"; private static final String BASE_SO_URI = BASE_URI + "/SO"; private static HttpServer server; diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestDetails.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestDetails.java index 6e9a2bade..c4b024593 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestDetails.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoRequestDetails.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * so * ================================================================================ - * + * Copyright (C) 2018 Ericsson. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,45 +72,45 @@ public class TestSoRequestDetails { assertEquals(subscriberInfo, obj.getSubscriberInfo()); } - @Test - public void testSOMRequestDetailsMethods() { - SORequestDetails details = new SORequestDetails(); - assertNotNull(details); - assertNotEquals(0, details.hashCode()); - - SOCloudConfiguration cloudConfiguration = new SOCloudConfiguration(); - details.setCloudConfiguration(cloudConfiguration); - assertEquals(cloudConfiguration, details.getCloudConfiguration()); - assertNotEquals(0, details.hashCode()); - - SOModelInfo modelInfo = new SOModelInfo(); - details.setModelInfo(modelInfo); - assertEquals(modelInfo, details.getModelInfo()); - assertNotEquals(0, details.hashCode()); - - List<SORelatedInstanceListElement> relatedInstanceList = new ArrayList<>(); - details.setRelatedInstanceList(relatedInstanceList); - assertEquals(relatedInstanceList, details.getRelatedInstanceList()); - assertNotEquals(0, details.hashCode()); - - SORequestInfo requestInfo = new SORequestInfo(); - details.setRequestInfo(requestInfo); - assertEquals(requestInfo, details.getRequestInfo()); - assertNotEquals(0, details.hashCode()); - - SORequestParameters requestParameters = new SORequestParameters(); - details.setRequestParameters(requestParameters); - assertEquals(requestParameters, details.getRequestParameters()); - assertNotEquals(0, details.hashCode()); - - SOSubscriberInfo subscriberInfo = new SOSubscriberInfo(); - details.setSubscriberInfo(subscriberInfo); - assertEquals(subscriberInfo, details.getSubscriberInfo()); - assertNotEquals(0, details.hashCode()); - - assertEquals("SORequestDetails [modelInfo=org.onap.policy.so", details.toString().substring(0, 46)); - - SORequestDetails copiedDetails = new SORequestDetails(details); + @Test + public void testSoMRequestDetailsMethods() { + SORequestDetails details = new SORequestDetails(); + assertNotNull(details); + assertNotEquals(0, details.hashCode()); + + SOCloudConfiguration cloudConfiguration = new SOCloudConfiguration(); + details.setCloudConfiguration(cloudConfiguration); + assertEquals(cloudConfiguration, details.getCloudConfiguration()); + assertNotEquals(0, details.hashCode()); + + SOModelInfo modelInfo = new SOModelInfo(); + details.setModelInfo(modelInfo); + assertEquals(modelInfo, details.getModelInfo()); + assertNotEquals(0, details.hashCode()); + + List<SORelatedInstanceListElement> relatedInstanceList = new ArrayList<>(); + details.setRelatedInstanceList(relatedInstanceList); + assertEquals(relatedInstanceList, details.getRelatedInstanceList()); + assertNotEquals(0, details.hashCode()); + + SORequestInfo requestInfo = new SORequestInfo(); + details.setRequestInfo(requestInfo); + assertEquals(requestInfo, details.getRequestInfo()); + assertNotEquals(0, details.hashCode()); + + SORequestParameters requestParameters = new SORequestParameters(); + details.setRequestParameters(requestParameters); + assertEquals(requestParameters, details.getRequestParameters()); + assertNotEquals(0, details.hashCode()); + + SOSubscriberInfo subscriberInfo = new SOSubscriberInfo(); + details.setSubscriberInfo(subscriberInfo); + assertEquals(subscriberInfo, details.getSubscriberInfo()); + assertNotEquals(0, details.hashCode()); + + assertEquals("SORequestDetails [modelInfo=org.onap.policy.so", details.toString().substring(0, 46)); + + SORequestDetails copiedDetails = new SORequestDetails(details); assertTrue(details.equals(details)); assertTrue(details.equals(copiedDetails)); @@ -143,7 +143,7 @@ public class TestSoRequestDetails { assertFalse(details.equals(copiedDetails)); copiedDetails.setRequestInfo(requestInfo); assertTrue(details.equals(copiedDetails)); - + details.setRequestParameters(null); assertFalse(details.equals(copiedDetails)); copiedDetails.setRequestParameters(null); @@ -152,7 +152,7 @@ public class TestSoRequestDetails { assertFalse(details.equals(copiedDetails)); copiedDetails.setRequestParameters(requestParameters); assertTrue(details.equals(copiedDetails)); - + details.setSubscriberInfo(null); assertFalse(details.equals(copiedDetails)); copiedDetails.setSubscriberInfo(null); @@ -161,14 +161,14 @@ public class TestSoRequestDetails { assertFalse(details.equals(copiedDetails)); copiedDetails.setSubscriberInfo(subscriberInfo); assertTrue(details.equals(copiedDetails)); - + details.setRelatedInstanceList(null); assertFalse(details.equals(copiedDetails)); - copiedDetails.setRelatedInstanceList(null); + copiedDetails.setRelatedInstanceList(null); assertTrue(details.equals(copiedDetails)); details.setRelatedInstanceList(relatedInstanceList); assertFalse(details.equals(copiedDetails)); - copiedDetails.setRelatedInstanceList(relatedInstanceList); + copiedDetails.setRelatedInstanceList(relatedInstanceList); assertTrue(details.equals(copiedDetails)); - } + } } diff --git a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoResponseWrapper.java b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoResponseWrapper.java index 4f21630a2..d7ef9708d 100755 --- a/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoResponseWrapper.java +++ b/controlloop/common/model-impl/so/src/test/java/org/onap/policy/so/TestSoResponseWrapper.java @@ -53,23 +53,23 @@ public class TestSoResponseWrapper { obj.setRequestID("id2"); assertEquals("id2", obj.getRequestID()); } - - @Test - public void testSOResponseWrapperMethods() { - String requestID = UUID.randomUUID().toString(); - SOResponse response = new SOResponse(); - - SOResponseWrapper responseWrapper = new SOResponseWrapper(response, requestID); - assertNotNull(responseWrapper); - assertNotEquals(0, responseWrapper.hashCode()); - - assertEquals(response, responseWrapper.getSoResponse()); - - assertNotEquals(0, responseWrapper.hashCode()); - - assertEquals("SOResponseWrapper [SOResponse=org.onap.policy.", responseWrapper.toString().substring(0, 46)); - - SOResponseWrapper identicalResponseWrapper = new SOResponseWrapper(response, requestID); + + @Test + public void testSoResponseWrapperMethods() { + String requestId = UUID.randomUUID().toString(); + SOResponse response = new SOResponse(); + + SOResponseWrapper responseWrapper = new SOResponseWrapper(response, requestId); + assertNotNull(responseWrapper); + assertNotEquals(0, responseWrapper.hashCode()); + + assertEquals(response, responseWrapper.getSoResponse()); + + assertNotEquals(0, responseWrapper.hashCode()); + + assertEquals("SOResponseWrapper [SOResponse=org.onap.policy.", responseWrapper.toString().substring(0, 46)); + + SOResponseWrapper identicalResponseWrapper = new SOResponseWrapper(response, requestId); assertEquals(responseWrapper, responseWrapper); assertEquals(responseWrapper, identicalResponseWrapper); @@ -81,25 +81,25 @@ public class TestSoResponseWrapper { assertEquals(new SOResponseWrapper(null, null), new SOResponseWrapper(null, null)); assertNotEquals(new SOResponseWrapper(null, null), identicalResponseWrapper); - assertNotEquals(0, new SOResponseWrapper(null, null).hashCode()); + assertNotEquals(0, new SOResponseWrapper(null, null).hashCode()); - identicalResponseWrapper.setSoResponse(new SOResponse()); + identicalResponseWrapper.setSoResponse(new SOResponse()); assertNotEquals(responseWrapper, identicalResponseWrapper); identicalResponseWrapper.setSoResponse(response); assertEquals(responseWrapper, identicalResponseWrapper); identicalResponseWrapper.setRequestID(UUID.randomUUID().toString()); assertNotEquals(responseWrapper, identicalResponseWrapper); - identicalResponseWrapper.setRequestID(requestID); + identicalResponseWrapper.setRequestID(requestId); assertEquals(responseWrapper, identicalResponseWrapper); responseWrapper.setRequestID(null); assertNotEquals(responseWrapper, identicalResponseWrapper); identicalResponseWrapper.setRequestID(null); assertEquals(responseWrapper, identicalResponseWrapper); - responseWrapper.setRequestID(requestID); + responseWrapper.setRequestID(requestId); assertNotEquals(responseWrapper, identicalResponseWrapper); - identicalResponseWrapper.setRequestID(requestID); + identicalResponseWrapper.setRequestID(requestId); assertEquals(responseWrapper, identicalResponseWrapper); - } + } } |