--- /dev/null
+<?xml version="1.0"?>
+<!--
+ ============LICENSE_START=======================================================
+ Copyright (C) 2020 AT&T Technologies. 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.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ SPDX-License-Identifier: Apache-2.0
+ ============LICENSE_END=========================================================
+
+
+ **** NOTE ****
+ This file is needed to suppress checkstyle for properties files.
+ **************
+-->
+
+<!DOCTYPE suppressions PUBLIC
+ "-//Puppy Crawl//DTD Suppressions 1.0//EN"
+ "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
+
+<suppressions>
+ <suppress files="\.properties" checks="[a-zA-Z0-9]*"/>
+</suppressions>
============LICENSE_START=======================================================
drools-applications
================================================================================
- Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ Copyright (C) 2019-2020 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.
with minor changes -->
<configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
<!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
- <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
+ <sourceDirectories>${project.build.sourceDirectory}</sourceDirectories>
<includeResources>true</includeResources>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<includeTestResources>true</includeTestResources>
============LICENSE_START=======================================================
drools-applications
================================================================================
- Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ Copyright (C) 2019-2020 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.
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
- <version>2.13.0</version>
<scope>test</scope>
</dependency>
</dependencies>
with minor changes -->
<configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
<!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
- <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
+ <sourceDirectories>${project.build.sourceDirectory}</sourceDirectories>
<includeResources>true</includeResources>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<includeTestResources>true</includeTestResources>
============LICENSE_START=======================================================
eventmanager
================================================================================
- Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
Modifications Copyright (C) 2019 Nordix Foundation.
Modifications Copyright (C) 2019 Bell Canada.
================================================================================
</dependency>
<dependency>
<groupId>org.powermock</groupId>
- <artifactId>powermock-api-mockito</artifactId>
+ <artifactId>powermock-api-mockito2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
with minor changes -->
<configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
<!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
- <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
+ <sourceDirectories>${project.build.sourceDirectory}</sourceDirectories>
<includeResources>true</includeResources>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<includeTestResources>true</includeTestResources>
public class ControlLoopUtilsTest {
@Test
- public void toControlLoopParams() throws Exception {
+ public void testToControlLoopParams() throws Exception {
String policy =
new String(Files.readAllBytes(Paths.get("src/test/resources/tosca-policy-operational-restart.json")));
============LICENSE_START=======================================================
ONAP
================================================================================
- Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+ Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
Modifications Copyright (C) 2019 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
Extensions to the PDP-D to improve control loop specific management capabilities.
</description>
- <properties>
- <maven.compiler.source>1.8</maven.compiler.source>
- <maven.compiler.target>1.8</maven.compiler.target>
- </properties>
-
<build>
<resources>
<resource>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
- <artifactId>powermock-api-mockito</artifactId>
+ <artifactId>powermock-api-mockito2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
============LICENSE_START=======================================================
ONAP
================================================================================
- Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+ Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
Modifications Copyright (C) 2019 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
Loadable PDP-D feature module to track control loop transactions
</description>
- <properties>
- <maven.compiler.source>1.8</maven.compiler.source>
- <maven.compiler.target>1.8</maven.compiler.target>
- </properties>
-
<build>
<plugins>
<plugin>
with minor changes -->
<configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
<!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
- <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
+ <sourceDirectories>${project.build.sourceDirectory}</sourceDirectories>
<includeResources>true</includeResources>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<includeTestResources>true</includeTestResources>
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018-2020 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.
}
@Test
- public void cacheDefaults() {
+ public void testCacheDefaults() {
assertEquals(3, ControlLoopMetricsManager.getManager().getCacheSize());
assertEquals(2, ControlLoopMetricsManager.getManager().getTransactionTimeout());
assertEquals(0, ControlLoopMetricsManager.getManager().getCacheOccupancy());
}
@Test
- public void invalidNotifications() {
+ public void testInvalidNotifications() {
ControlLoopMetricsFeature feature = new ControlLoopMetricsFeature();
VirtualControlLoopNotification notification = new VirtualControlLoopNotification();
feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, notification);
- this.cacheDefaults();
+ this.testCacheDefaults();
UUID requestId = UUID.randomUUID();
notification.setRequestId(requestId);
feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, notification);
assertNull(ControlLoopMetricsManager.getManager().getTransaction(requestId));
- this.cacheDefaults();
+ this.testCacheDefaults();
}
@Test
- public void validActiveNotification() throws InterruptedException {
+ public void testValidActiveNotification() throws InterruptedException {
ControlLoopMetricsFeature feature = new ControlLoopMetricsFeature();
VirtualControlLoopNotification notification = new VirtualControlLoopNotification();
UUID requestId = UUID.randomUUID();
await().atMost(ControlLoopMetricsManager.getManager().getTransactionTimeout() + 1, TimeUnit.SECONDS)
.until(() -> ControlLoopMetricsManager.getManager().getTransaction(requestId) == null);
- this.cacheDefaults();
+ this.testCacheDefaults();
}
@Test
- public void reset() {
+ public void testReset() {
VirtualControlLoopNotification notification = this.generateNotification();
new ControlLoopMetricsFeature().beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT,
notification);
ControlLoopMetricsManager.getManager().resetCache(ControlLoopMetricsManager.getManager().getCacheSize(),
ControlLoopMetricsManager.getManager().getTransactionTimeout());
assertNull(ControlLoopMetricsManager.getManager().getTransaction(notification.getRequestId()));
- this.cacheDefaults();
+ this.testCacheDefaults();
}
@Test
- public void removeTransaction() {
+ public void testRemoveTransaction() {
VirtualControlLoopNotification notification = this.generateNotification();
assertNull(ControlLoopMetricsManager.getManager().getTransaction(notification.getRequestId()));
ControlLoopMetricsManager.getManager().removeTransaction(notification.getRequestId());
}
@Test
- public void eviction() throws InterruptedException {
+ public void testEviction() throws InterruptedException {
ControlLoopMetricsFeature feature = new ControlLoopMetricsFeature();
for (int i = 0; i < ControlLoopMetricsManager.getManager().getCacheSize(); i++) {
VirtualControlLoopNotification notification = generateNotification();
assertTrue(ControlLoopMetricsManager.getManager().getTransactionIds().isEmpty());
assertTrue(ControlLoopMetricsManager.getManager().getTransactions().isEmpty());
- this.cacheDefaults();
+ this.testCacheDefaults();
}
private VirtualControlLoopNotification generateNotification() {
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2020 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.
public class ControlLoopUtilsFeatureTest {
@Test
- public void simulate() {
+ public void testSimulate() {
LoggerUtil.setLevel("ROOT", "INFO");
LoggerUtil.setLevel("org.eclipse.jetty", "WARN");
final ControlLoopUtilsFeature feature = new ControlLoopUtilsFeature();
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
- <version>2.13.0</version>
<scope>test</scope>
</dependency>
<dependency>
with minor changes -->
<configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
<!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
- <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
+ <sourceDirectories>${project.build.sourceDirectory}</sourceDirectories>
<includeResources>true</includeResources>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<includeTestResources>true</includeTestResources>
* guard
* ================================================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2020 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.
public class GuardResultTest {
@Test
- public void guardResultTest() {
+ public void testGuardResult() {
assertEquals(3, GuardResult.values().length);
assertNotNull(GuardResult.LOCK_ACQUIRED);
assertNotNull(GuardResult.LOCK_DENIED);
* ================================================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
* ================================================================================
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-2020 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.
private static final String DOROTHY = "Dorothy";
@Test
- public void policyGuardRequestTest() {
+ public void testPolicyGuardRequest() {
UUID requestId = UUID.randomUUID();
assertNotNull(new PolicyGuardRequest(null, null, null, null));
* ================================================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
* ================================================================================
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-2020 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.
private static final String BACK_HOME = "BackHome";
@Test
- public void policyGuardResponseTest() {
+ public void testPolicyGuardResponse() {
UUID requestId = UUID.randomUUID();
assertNotNull(new PolicyGuardResponse(null, null, null));
* ================================================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
* ================================================================================
- * Modifications Copyright (C) 2018-2019 AT&T. All rights reserved.
+ * Modifications Copyright (C) 2018-2020 AT&T. 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.
public class PolicyGuardXacmlRequestAttributesTest {
@Test
- public void policyGuardXacmlRequestAttributesTest() {
+ public void testPolicyGuardXacmlRequestAttributes() {
PolicyGuardXacmlRequestAttributes attributes =
new PolicyGuardXacmlRequestAttributes(null, null, null, null, null, null);
assertNotNull(attributes);
<dependency>
<groupId>org.powermock</groupId>
- <artifactId>powermock-api-mockito</artifactId>
+ <artifactId>powermock-api-mockito2</artifactId>
<scope>test</scope>
</dependency>
}
@Test
- public void getVnfHealthCheckRequestTest() throws ControlLoopException {
+ public void testGetVnfHealthCheckRequest() throws ControlLoopException {
policy.setRecipe("HEALTHCHECK");
policy.getTarget().setType(TargetType.VNF);
}
@Test
- public void incomingHealthCheckMessageHealthyStateTest() {
+ public void testIncomingHealthCheckMessageHealthyState() {
policy.setRecipe("HEALTHCHECK");
policy.getTarget().setType(TargetType.VNF);
operation = new AppcLcmHealthCheckOperation(transaction, policy, event, 1);
}
@Test
- public void incomingHealthCheckMessageUnhealthyStateTest() {
+ public void testIncomingHealthCheckMessageUnhealthyState() {
policy.setRecipe("HEALTHCHECK");
policy.getTarget().setType(TargetType.VNF);
operation = new AppcLcmHealthCheckOperation(transaction, policy, event, 1);
}
@Test
- public void incomingHealthCheckMessageUnknownStateTest() {
+ public void testIncomingHealthCheckMessageUnknownState() {
policy.setRecipe("HEALTHCHECK");
policy.getTarget().setType(TargetType.VNF);
operation = new AppcLcmHealthCheckOperation(transaction, policy, event, 1);
}
@Test
- public void incomingHealthCheckMessageNoStateTest() {
+ public void testIncomingHealthCheckMessageNoState() {
policy.setRecipe("HEALTHCHECK");
policy.getTarget().setType(TargetType.VNF);
operation = new AppcLcmHealthCheckOperation(transaction, policy, event, 1);
}
@Test
- public void incomingHealthCheckMessageUnsuccessfulTest() {
+ public void testIncomingHealthCheckMessageUnsuccessful() {
policy.setRecipe("HEALTHCHECK");
policy.getTarget().setType(TargetType.VNF);
operation = new AppcLcmHealthCheckOperation(transaction, policy, event, 1);
}
@Test
- public void incomingHealthCheckMessageNoPayloadTest() {
+ public void testIncomingHealthCheckMessageNoPayload() {
policy.setRecipe("HEALTHCHECK");
policy.getTarget().setType(TargetType.VNF);
operation = new AppcLcmHealthCheckOperation(transaction, policy, event, 1);
}
@Test
- public void incomingHealthCheckMessageEmptyPayloadTest() {
+ public void testIncomingHealthCheckMessageEmptyPayload() {
policy.setRecipe("HEALTHCHECK");
policy.getTarget().setType(TargetType.VNF);
operation = new AppcLcmHealthCheckOperation(transaction, policy, event, 1);
}
@Test
- public void getVmRestartRequestTest() throws ControlLoopException {
+ public void testGetVmRestartRequest() throws ControlLoopException {
policy.setRecipe("RESTART");
policy.getTarget().setType(TargetType.VM);
}
@Test
- public void getVnfRestartRequestTest() throws ControlLoopException {
+ public void testGetVnfRestartRequest() throws ControlLoopException {
policy.setRecipe("RESTART");
policy.getTarget().setType(TargetType.VNF);
}
@Test
- public void getVmRebuildRequestTest() throws ControlLoopException {
+ public void testGetVmRebuildRequest() throws ControlLoopException {
policy.setRecipe("REBUILD");
policy.getTarget().setType(TargetType.VM);
}
@Test
- public void getVnfRebuildRequestTest() throws ControlLoopException {
+ public void testGetVnfRebuildRequest() throws ControlLoopException {
policy.setRecipe("REBUILD");
policy.getTarget().setType(TargetType.VNF);
}
@Test
- public void getVmMigrateRequestTest() throws ControlLoopException {
+ public void testGetVmMigrateRequest() throws ControlLoopException {
policy.setRecipe("MIGRATE");
policy.getTarget().setType(TargetType.VM);
}
@Test
- public void getVnfMigrateRequestTest() throws ControlLoopException {
+ public void testGetVnfMigrateRequest() throws ControlLoopException {
policy.setRecipe("MIGRATE");
policy.getTarget().setType(TargetType.VNF);
}
@Test
- public void getVmEvacuateRequestTest() throws ControlLoopException {
+ public void testGetVmEvacuateRequest() throws ControlLoopException {
policy.setRecipe("EVACUATE");
policy.getTarget().setType(TargetType.VM);
}
@Test
- public void getVnfEvacuateRequestTest() throws ControlLoopException {
+ public void testGetVnfEvacuateRequest() throws ControlLoopException {
policy.setRecipe("EVACUATE");
policy.getTarget().setType(TargetType.VNF);
}
@Test
- public void getVmRebootRequestTest() throws ControlLoopException {
+ public void testGetVmRebootRequest() throws ControlLoopException {
policy.setRecipe("REBOOT");
policy.getTarget().setType(TargetType.VM);
}
@Test
- public void getVnfRebootRequestTest() throws ControlLoopException {
+ public void testGetVnfRebootRequest() throws ControlLoopException {
policy.setRecipe("REBOOT");
policy.getTarget().setType(TargetType.VNF);
}
@Test
- public void getVnfStartRequestTest() throws ControlLoopException {
+ public void testGetVnfStartRequest() throws ControlLoopException {
policy.setRecipe("START");
policy.getTarget().setType(TargetType.VNF);
}
@Test
- public void getVmStartRequestTest() throws ControlLoopException {
+ public void testGetVmStartRequest() throws ControlLoopException {
policy.setRecipe("START");
policy.getTarget().setType(TargetType.VM);
}
@Test
- public void getVnfStopRequestTest() throws ControlLoopException {
+ public void testGetVnfStopRequest() throws ControlLoopException {
policy.setRecipe("STOP");
policy.getTarget().setType(TargetType.VNF);
}
@Test
- public void getVmStopRequestTest() throws ControlLoopException {
+ public void testGetVmStopRequest() throws ControlLoopException {
policy.setRecipe("STOP");
policy.getTarget().setType(TargetType.VM);
*/
@Test
- public void incomingVmSuccessMessageTest() {
+ public void testIncomingVmSuccessMessage() {
policy.setRecipe("RESTART");
policy.getTarget().setType(TargetType.VM);
operation = new AppcLcmOperation(transaction, policy, event, 1);
}
@Test
- public void incomingVnfSuccessMessageTest() {
+ public void testIncomingVnfSuccessMessage() {
policy.setRecipe("RESTART");
policy.getTarget().setType(TargetType.VNF);
operation = new AppcLcmOperation(transaction, policy, event, 1);
}
@Test
- public void incomingVmFailureMessageTest() {
+ public void testIncomingVmFailureMessage() {
policy.setRecipe("RESTART");
policy.getTarget().setType(TargetType.VM);
operation = new AppcLcmOperation(transaction, policy, event, 1);
}
@Test
- public void incomingAllVnfFailureMessageTest() {
+ public void testIncomingAllVnfFailureMessage() {
policy.setRecipe("RESTART");
policy.getTarget().setType(TargetType.VNF);
operation = new AppcLcmOperation(transaction, policy, event, 1);
}
@Test
- public void incomingPartialVnfFailureMessageTest() {
+ public void testIncomingPartialVnfFailureMessage() {
policy.setRecipe("RESTART");
policy.getTarget().setType(TargetType.VNF);
operation = new AppcLcmOperation(transaction, policy, event, 1);
*/
@Test
- public void validAaiSubtagTest() {
+ public void testValidAaiSubtag() {
transaction.setNotificationMessage(null);
VirtualControlLoopEvent validEvent = new VirtualControlLoopEvent();
validEvent.setTarget("vserver.vserver-name");
}
@Test
- public void noAaiSubtagTest() {
+ public void testNoAaiSubtag() {
transaction.setNotificationMessage(null);
VirtualControlLoopEvent noAaiTag = new VirtualControlLoopEvent();
noAaiTag.setAai(null);
}
@Test
- public void noClosedLoopDisabledInAaiTest() {
+ public void testNoClosedLoopDisabledInAai() {
transaction.setNotificationMessage(null);
VirtualControlLoopEvent invalidEvent = new VirtualControlLoopEvent();
assertFalse(AppcLcmOperation.isAaiValid(transaction, invalidEvent));
}
@Test
- public void closedLoopDisabledInAaiTest() {
+ public void testClosedLoopDisabledInAai() {
transaction.setNotificationMessage(null);
VirtualControlLoopEvent invalidEvent = new VirtualControlLoopEvent();
invalidEvent.getAai().put(AppcLcmOperation.DCAE_CLOSEDLOOP_DISABLED_FIELD, "true");
}
@Test
- public void targetMismatchInAaiTest() {
+ public void testTargetMismatchInAai() {
transaction.setNotificationMessage(null);
VirtualControlLoopEvent validEvent = new VirtualControlLoopEvent();
validEvent.setTarget("vserver.vserver-name");
<dependency>
<groupId>org.powermock</groupId>
- <artifactId>powermock-api-mockito</artifactId>
+ <artifactId>powermock-api-mockito2</artifactId>
<scope>test</scope>
</dependency>
*
* @param histEntry the history entry for this particular operation
*/
- default void histEntryCompleted(ControlLoopOperation histEntry) {}
+ default void histEntryCompleted(ControlLoopOperation histEntry) {
+ }
}
*
* @param transaction the transaction containing the adjunct
*/
- public default void init(Transaction transaction) {}
+ public default void init(Transaction transaction) {
+ }
/**
* Called for each adjunct when the transaction completes, and is
* removed from Drools memory. Any adjunct-specific cleanup can be
* done at this point (e.g. freeing locks).
*/
- public default void cleanup(Transaction transaction) {}
+ public default void cleanup(Transaction transaction) {
+ }
}
/**
}
@Test
- public void operationTest() throws ControlLoopException {
+ public void testOperation() throws ControlLoopException {
Actor actor = new TestActor();
Operation operation = actor.createOperation(null, null, null, 0);
assertNotNull(operation);
}
@Test
- public void asyncQueryTest() {
+ public void testAsyncQuery() {
Policy policy = new Policy();
policy.setActor("APPCLCM");
policy.setRecipe("test");
}
@Test
- public void asyncCreateDbEntryTest() {
+ public void testAsyncCreateDbEntry() {
ControlLoopOperation op = new ControlLoopOperation();
op.setStart(Instant.now().minusSeconds(1));
op.setEnd(Instant.now());
}
@Test
- public void validControlLoopEventTest() {
+ public void testValidControlLoopEvent() {
VirtualControlLoopEvent event = setControlLoopEvent(UUID.randomUUID(),
"cltest", Instant.now(), ControlLoopTargetType.VM, "vserver.vserver-name");
Transaction transaction = new Transaction(null, "clvusptest", event.getRequestId(), createControlLoop());
}
@Test
- public void noRequestIdControlLoopEventTest() {
+ public void testNoRequestIdControlLoopEvent() {
VirtualControlLoopEvent event = setControlLoopEvent(null,
"cltest", Instant.now(), ControlLoopTargetType.VM, "vserver.vserver-name");
Transaction transaction = new Transaction(null, "clvusptest", event.getRequestId(), createControlLoop());
}
@Test
- public void noTargetTypeControlLoopEventTest() {
+ public void testNoTargetTypeControlLoopEvent() {
VirtualControlLoopEvent event = setControlLoopEvent(UUID.randomUUID(),
"cltest", Instant.now(), null, "vserver.vserver-name");
Transaction transaction = new Transaction(null, "clvusptest", event.getRequestId(), createControlLoop());
}
@Test
- public void noTargetControlLoopEventTest() {
+ public void testNoTargetControlLoopEvent() {
VirtualControlLoopEvent event = setControlLoopEvent(UUID.randomUUID(),
"cltest", Instant.now(), ControlLoopTargetType.VM, null);
Transaction transaction = new Transaction(null, "clvusptest", event.getRequestId(), createControlLoop());
}
@Test
- public void getRequestIdTest() {
+ public void testGetRequestId() {
UUID requestId = UUID.randomUUID();
Transaction transaction = new Transaction(null, "clvusptest", requestId, createControlLoop());
assertEquals(requestId, transaction.getRequestId());
}
@Test
- public void getWorkingMemoryTest() {
+ public void testGetWorkingMemory() {
// Create mock working session
StatefulKnowledgeSessionImpl mockWorkingMemory = mock(StatefulKnowledgeSessionImpl.class);
Transaction transaction = new Transaction(mockWorkingMemory, "clvusptest",
}
@Test
- public void getOperationTimeoutTest() {
+ public void testGetOperationTimeout() {
Transaction transaction = new Transaction(null, "clvusptest", UUID.randomUUID(), createControlLoop());
VirtualControlLoopEvent onset = setControlLoopEvent(UUID.randomUUID(),
"cltest", null, ControlLoopTargetType.VM, "vserver.vserver-name");
}
@Test
- public void getCurrentPolicy() {
+ public void testGetCurrentPolicy() {
ControlLoopPolicy controlLoopPolicy = createControlLoop();
Transaction transaction = new Transaction(null, "clvusptest", UUID.randomUUID(), controlLoopPolicy);
VirtualControlLoopEvent onset = setControlLoopEvent(UUID.randomUUID(),
}
@Test
- public void getNotificationTest() {
+ public void testGetNotification() {
Transaction transaction = new Transaction(null, "clvusptest", UUID.randomUUID(), createControlLoop());
VirtualControlLoopEvent onset = setControlLoopEvent(UUID.randomUUID(),
"cltest", null, ControlLoopTargetType.VM, "vserver.vserver-name");
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
}
@Test
- public void deliverTest() {
+ public void testDeliver() {
Properties prop = new Properties();
prop.put("noop.sink.topics", "testTopic");
TopicEndpointManager.getManager().addTopicSinks(prop);
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
- <version>2.13.0</version>
<scope>test</scope>
</dependency>
}
@Test
- public void guardDbResponseTest() throws InterruptedException {
+ public void testGuardDbResponse() throws InterruptedException {
Properties props = new Properties(prop);
props.setProperty("guard.disabled", "false");
props.setProperty("guard.javax.persistence.jdbc.user", "user");
}
@Test
- public void badValuesTest() throws InterruptedException {
+ public void testBadValues() throws InterruptedException {
Properties props = new Properties(prop);
props.setProperty("guard.disabled", "true");
props.setProperty("guard.pdp.rest.client.user", "");
}
@Test
- public void policyGuardResponseTest() {
+ public void testPolicyGuardResponse() {
UUID requestId = UUID.randomUUID();
PolicyGuardResponse emptyResponse1 = new PolicyGuardResponse(null, null, null);
}
@Test
- public void lockAdjunctTest() {
+ public void testLockAdjunct() {
owner = new TestOwner();
lock = PolicyEngineConstants.getManager().createLock("key", "ownerKey", 60, owner, false);
LockAdjunct lockA = new LockAdjunct();
* @return a JSON array, containing 0-limit messages
*/
String get(String group, long timeout, int limit)
- throws InterruptedException {
+ throws InterruptedException {
// look up the group -- create one if it doesn't exist
Group groupObj = groupTable.get(group);
if (groupObj == null) {
@PathParam("id") String id,
@QueryParam("timeout") long timeout,
@QueryParam("limit") int limit)
- throws InterruptedException {
+ throws InterruptedException {
logger.info("Receive: topic={}, group={}, id={}, timeout={}, limit={}",
topic, group, id, timeout, limit);
* @return a String containing the contents of the file
*/
public static String fileToString(File file)
- throws IOException, FileNotFoundException {
+ throws IOException, FileNotFoundException {
try (FileInputStream fis = new FileInputStream(file)) {
String string = inputStreamToString(fis);
return string;
* @return a File, whose contents contain the string
*/
public static File stringToFile(String string, String suffix)
- throws IOException {
+ throws IOException {
File file = File.createTempFile("templates-util", suffix);
file.deleteOnExit();
* @return a File, whose contents contain the string
*/
public static File stringToFile(String string)
- throws IOException {
+ throws IOException {
return stringToFile(string, "");
}
* replaced
*/
public static String openAndReplace(String fileName, String... args)
- throws IOException, FileNotFoundException {
+ throws IOException, FileNotFoundException {
String text = fileToString(new File(fileName));
for (int i = 0 ; i < args.length ; i += 2) {
text = text.replace(args[i], args[i + 1]);
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Huawei Technologies Co., Ltd. All rights reserved.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * Modifications Copyright (C) 2019-2020 AT&T Intellectual Property.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
@Test
- public void successTest() throws IOException {
+ public void testSuccess() throws IOException {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an event ready
}
@Test
- public void nullRequestTest() throws IOException {
+ public void testNullRequest() throws IOException {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an event ready
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Huawei. All rights reserved.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * Modifications Copyright (C) 2019-2020 AT&T Intellectual Property.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
@Test
- public void successTest() throws IOException {
+ public void testSuccess() throws IOException {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an event ready
}
@Test
- public void nullRequestTest() throws IOException {
+ public void testNullRequest() throws IOException {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an event ready
* ============LICENSE_START=======================================================
* demo
* ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2020 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.
import java.util.HashMap;
import java.util.UUID;
import org.junit.BeforeClass;
+import org.junit.FixMethodOrder;
import org.junit.Test;
+import org.junit.runners.MethodSorters;
import org.onap.policy.appclcm.AppcLcmBody;
import org.onap.policy.appclcm.AppcLcmDmaapWrapper;
import org.onap.policy.appclcm.AppcLcmInput;
import org.onap.policy.controlloop.VirtualControlLoopNotification;
import org.onap.policy.controlloop.policy.ControlLoopPolicy;
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class VcpeControlLoopTest extends ControlLoopBase implements TopicListener {
/**
}
@Test
- public void successTest() {
+ public void testASuccess() {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an event ready
}
@Test
- public void aaiGetFailTest() {
+ public void testBAaiGetFail() {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an event ready
* ============LICENSE_START=======================================================
* demo
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 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.
}
@Test
- public void successTest() {
+ public void testSuccess() {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an event ready
}
@Test
- public void aaiGetFailTest() {
+ public void testAaiGetFail() {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an event ready
* ============LICENSE_START=======================================================
* demo
* ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2020 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.
}
@Test
- public void successTest() {
+ public void testSuccessTest() {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an event ready
}
@Test
- public void namedQueryFailTest() {
+ public void testNamedQueryFail() {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an event ready
}
@Test
- public void aaiGetFailTest() {
+ public void testAaiGetFail() {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an event ready
* demo
* ================================================================================
* Copyright (C) 2017-2018 Intel Corp. All rights reserved.
- * Modifications Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2018-2020 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.
}
@Test
- public void successTest() throws IOException {
+ public void testSuccess() throws IOException {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an event ready
}
@Test
- public void nullRequestTest() throws IOException {
+ public void testNullRequest() throws IOException {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an event ready
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Bell Canada.
+ * Modifications Copyright (C) 2020 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.
}
@Test
- public void successTest() {
+ public void testSuccess() {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an event ready
* ============LICENSE_START=======================================================
* demo
* ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2020 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.
import java.util.HashMap;
import java.util.UUID;
import org.junit.BeforeClass;
+import org.junit.FixMethodOrder;
import org.junit.Test;
+import org.junit.runners.MethodSorters;
import org.onap.policy.appc.Request;
import org.onap.policy.appc.Response;
import org.onap.policy.appc.ResponseCode;
import org.onap.policy.controlloop.VirtualControlLoopNotification;
import org.onap.policy.controlloop.policy.ControlLoopPolicy;
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class VfwControlLoopTest extends ControlLoopBase implements TopicListener {
/**
}
@Test
- public void successTest() {
+ public void testASuccess() {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an event ready
}
@Test
- public void aaiFailTests() {
+ public void testBAaiFail() {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an event ready
* demo
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2018-2020 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.
}
@Test
- public void successTest() {
+ public void testSuccess() {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an
}
@Test
- public void aaiGetFailTest() {
+ public void testAaiGetFail() {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an
* demo
* ================================================================================
* Copyright (C) 2019 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-2020 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.
}
@Test
- public void successTest() {
+ public void testSuccess() {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an
}
@Test
- public void aaiGetFailTest() {
+ public void testAaiGetFailTest() {
/*
* Allows the PolicyEngine to callback to this object to notify that there is an
<parent>
<groupId>org.onap.policy.parent</groupId>
<artifactId>integration</artifactId>
- <version>3.1.0</version>
+ <version>3.1.1-SNAPSHOT</version>
<relativePath />
</parent>
<packaging>pom</packaging>
<properties>
- <!-- Project common build settings -->
- <maven.compiler.source>1.8</maven.compiler.source>
- <maven.compiler.target>1.8</maven.compiler.target>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.source.version>1.8</project.source.version>
- <project.target.version>1.8</project.target.version>
-
<!-- Project path properties -->
<nexusproxy>https://nexus.onap.org</nexusproxy>
<sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<!-- Project common dependency versions -->
- <version.policy.common>1.6.1</version.policy.common>
- <policy.models.version>2.2.0</policy.models.version>
+ <version.policy.common>1.6.2-SNAPSHOT</version.policy.common>
+ <policy.models.version>2.2.1-SNAPSHOT</policy.models.version>
<version.policy.drools-pdp>1.6.0-SNAPSHOT</version.policy.drools-pdp>
</properties>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<encoding>${project.encoding}</encoding>
- <source>${project.source.version}</source>
- <target>${project.target.version}</target>
+ <release>${java.version}</release>
</configuration>
</plugin>
<plugin>
with minor changes -->
<configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
<!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
- <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
+ <sourceDirectories>${project.build.sourceDirectory}</sourceDirectories>
<includeResources>true</includeResources>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<includeTestResources>true</includeTestResources>
<excludes>
</excludes>
+ <suppressionsLocation>/checkstyle-suppressions.xml</suppressionsLocation>
<consoleOutput>true</consoleOutput>
<failsOnViolation>true</failsOnViolation>
<violationSeverity>warning</violationSeverity>