diff options
41 files changed, 173 insertions, 314 deletions
diff --git a/api-active-standby-management/pom.xml b/api-active-standby-management/pom.xml index ff706fcf..2c46dc14 100644 --- a/api-active-standby-management/pom.xml +++ b/api-active-standby-management/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>api-active-standby-management</artifactId> diff --git a/api-server-pool-state-control/pom.xml b/api-server-pool-state-control/pom.xml index a26e8025..5d7066e0 100644 --- a/api-server-pool-state-control/pom.xml +++ b/api-server-pool-state-control/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>api-server-pool-state-control</artifactId> diff --git a/api-state-management/pom.xml b/api-state-management/pom.xml index e41e0d7c..81edac28 100644 --- a/api-state-management/pom.xml +++ b/api-state-management/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>api-state-management</artifactId> diff --git a/feature-active-standby-management/pom.xml b/feature-active-standby-management/pom.xml index 46d987cc..eff02316 100644 --- a/feature-active-standby-management/pom.xml +++ b/feature-active-standby-management/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>feature-active-standby-management</artifactId> diff --git a/feature-controller-logging/pom.xml b/feature-controller-logging/pom.xml index 7f31c37d..8de68643 100755 --- a/feature-controller-logging/pom.xml +++ b/feature-controller-logging/pom.xml @@ -25,7 +25,7 @@ <parent>
<groupId>org.onap.policy.drools-pdp</groupId>
<artifactId>drools-pdp</artifactId>
- <version>1.7.0-SNAPSHOT</version>
+ <version>1.7.1-SNAPSHOT</version>
</parent>
<artifactId>feature-controller-logging</artifactId>
diff --git a/feature-distributed-locking/pom.xml b/feature-distributed-locking/pom.xml index f6b83551..4b62a305 100644 --- a/feature-distributed-locking/pom.xml +++ b/feature-distributed-locking/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>feature-distributed-locking</artifactId> diff --git a/feature-drools-init/pom.xml b/feature-drools-init/pom.xml index 71affc95..a1966d02 100644 --- a/feature-drools-init/pom.xml +++ b/feature-drools-init/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>feature-drools-init</artifactId> diff --git a/feature-eelf/pom.xml b/feature-eelf/pom.xml index 1e1fc6ce..553ed6ca 100644 --- a/feature-eelf/pom.xml +++ b/feature-eelf/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>feature-eelf</artifactId> diff --git a/feature-healthcheck/pom.xml b/feature-healthcheck/pom.xml index 2263f716..6262f49c 100644 --- a/feature-healthcheck/pom.xml +++ b/feature-healthcheck/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>feature-healthcheck</artifactId> diff --git a/feature-lifecycle/pom.xml b/feature-lifecycle/pom.xml index 90b2d2a8..2805ea97 100644 --- a/feature-lifecycle/pom.xml +++ b/feature-lifecycle/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>feature-lifecycle</artifactId> diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateUnsupportedTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateUnsupportedTest.java index 14da6ab0..1b7c62a3 100644 --- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateUnsupportedTest.java +++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateUnsupportedTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * 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. @@ -21,7 +21,7 @@ package org.onap.policy.drools.lifecycle; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; -import static org.assertj.core.api.Java6Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -60,31 +60,31 @@ public abstract class LifecycleStateUnsupportedTest { @Test public void start() { - assertThatThrownBy(() -> state.start()) + assertThatThrownBy(state::start) .isInstanceOf(UnsupportedOperationException.class); } @Test public void stop() { - assertThatThrownBy(() -> state.stop()) + assertThatThrownBy(state::stop) .isInstanceOf(UnsupportedOperationException.class); } @Test public void shutdown() { - assertThatThrownBy(() -> state.shutdown()) + assertThatThrownBy(state::shutdown) .isInstanceOf(UnsupportedOperationException.class); } @Test public void isAlive() { - assertThatThrownBy(() -> state.isAlive()) + assertThatThrownBy(state::isAlive) .isInstanceOf(UnsupportedOperationException.class); } @Test public void status() { - assertThatThrownBy(() -> state.status()) + assertThatThrownBy(state::status) .isInstanceOf(UnsupportedOperationException.class); } diff --git a/feature-mdc-filters/pom.xml b/feature-mdc-filters/pom.xml index 7b2399af..b979387e 100755 --- a/feature-mdc-filters/pom.xml +++ b/feature-mdc-filters/pom.xml @@ -24,7 +24,7 @@ <parent> <artifactId>drools-pdp</artifactId> <groupId>org.onap.policy.drools-pdp</groupId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>feature-mdc-filters</artifactId> diff --git a/feature-pooling-dmaap/pom.xml b/feature-pooling-dmaap/pom.xml index 47db8909..a6953aa6 100644 --- a/feature-pooling-dmaap/pom.xml +++ b/feature-pooling-dmaap/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>feature-pooling-dmaap</artifactId> diff --git a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/ActiveStateTest.java b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/ActiveStateTest.java index e24c3c1e..d8ed62c8 100644 --- a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/ActiveStateTest.java +++ b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/ActiveStateTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2018, 2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2020 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -38,6 +38,7 @@ import static org.mockito.Mockito.when; import java.util.Arrays; import java.util.Map; import org.apache.commons.lang3.tuple.Pair; +import org.apache.commons.lang3.tuple.Triple; import org.junit.Before; import org.junit.Test; import org.onap.policy.drools.pooling.message.BucketAssignments; @@ -46,7 +47,6 @@ import org.onap.policy.drools.pooling.message.Leader; import org.onap.policy.drools.pooling.message.Message; import org.onap.policy.drools.pooling.message.Offline; import org.onap.policy.drools.pooling.message.Query; -import org.onap.policy.drools.utils.Triple; public class ActiveStateTest extends SupportBasicStateTester { @@ -304,18 +304,18 @@ public class ActiveStateTest extends SupportBasicStateTester { // heart beat generator timer = repeatedTasks.remove(); - assertEquals(STD_INTER_HEARTBEAT_MS, timer.first().longValue()); - assertEquals(STD_INTER_HEARTBEAT_MS, timer.second().longValue()); + assertEquals(STD_INTER_HEARTBEAT_MS, timer.getLeft().longValue()); + assertEquals(STD_INTER_HEARTBEAT_MS, timer.getMiddle().longValue()); // my heart beat checker timer = repeatedTasks.remove(); - assertEquals(STD_ACTIVE_HEARTBEAT_MS, timer.first().longValue()); - assertEquals(STD_ACTIVE_HEARTBEAT_MS, timer.second().longValue()); + assertEquals(STD_ACTIVE_HEARTBEAT_MS, timer.getLeft().longValue()); + assertEquals(STD_ACTIVE_HEARTBEAT_MS, timer.getMiddle().longValue()); // predecessor's heart beat checker timer = repeatedTasks.remove(); - assertEquals(STD_ACTIVE_HEARTBEAT_MS, timer.first().longValue()); - assertEquals(STD_ACTIVE_HEARTBEAT_MS, timer.second().longValue()); + assertEquals(STD_ACTIVE_HEARTBEAT_MS, timer.getLeft().longValue()); + assertEquals(STD_ACTIVE_HEARTBEAT_MS, timer.getMiddle().longValue()); } @Test @@ -333,13 +333,13 @@ public class ActiveStateTest extends SupportBasicStateTester { // heart beat generator timer = repeatedTasks.remove(); - assertEquals(STD_INTER_HEARTBEAT_MS, timer.first().longValue()); - assertEquals(STD_INTER_HEARTBEAT_MS, timer.second().longValue()); + assertEquals(STD_INTER_HEARTBEAT_MS, timer.getLeft().longValue()); + assertEquals(STD_INTER_HEARTBEAT_MS, timer.getMiddle().longValue()); // my heart beat checker timer = repeatedTasks.remove(); - assertEquals(STD_ACTIVE_HEARTBEAT_MS, timer.first().longValue()); - assertEquals(STD_ACTIVE_HEARTBEAT_MS, timer.second().longValue()); + assertEquals(STD_ACTIVE_HEARTBEAT_MS, timer.getLeft().longValue()); + assertEquals(STD_ACTIVE_HEARTBEAT_MS, timer.getMiddle().longValue()); } @Test @@ -356,7 +356,7 @@ public class ActiveStateTest extends SupportBasicStateTester { verify(mgr).publish(anyString(), any(Heartbeat.class)); // fire the task - assertNull(task.third().fire()); + assertNull(task.getRight().fire()); // should have generated a second pair of heart beats verify(mgr, times(2)).publish(anyString(), any(Heartbeat.class)); @@ -381,7 +381,7 @@ public class ActiveStateTest extends SupportBasicStateTester { when(mgr.goInactive()).thenReturn(next); // fire the task - should not transition - assertNull(task.third().fire()); + assertNull(task.getRight().fire()); verify(mgr, never()).publishAdmin(any(Query.class)); } @@ -398,7 +398,7 @@ public class ActiveStateTest extends SupportBasicStateTester { when(mgr.goStart()).thenReturn(next); // fire the task - should transition - assertEquals(next, task.third().fire()); + assertEquals(next, task.getRight().fire()); // should continue to distribute verify(mgr, never()).startDistributing(null); @@ -423,7 +423,7 @@ public class ActiveStateTest extends SupportBasicStateTester { when(mgr.goQuery()).thenReturn(next); // fire the task - should NOT transition - assertNull(task.third().fire()); + assertNull(task.getRight().fire()); verify(mgr, never()).publishAdmin(any(Query.class)); } @@ -440,7 +440,7 @@ public class ActiveStateTest extends SupportBasicStateTester { when(mgr.goQuery()).thenReturn(next); // fire the task - should transition - assertEquals(next, task.third().fire()); + assertEquals(next, task.getRight().fire()); verify(mgr).publishAdmin(any(Query.class)); } diff --git a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/StartStateTest.java b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/StartStateTest.java index 1fd49c50..142fbf7e 100644 --- a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/StartStateTest.java +++ b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/StartStateTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2018, 2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2020 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -33,6 +33,7 @@ import static org.mockito.Mockito.when; import java.util.Map; import org.apache.commons.lang3.tuple.Pair; +import org.apache.commons.lang3.tuple.Triple; import org.junit.Before; import org.junit.Test; import org.onap.policy.drools.pooling.message.Forward; @@ -42,7 +43,6 @@ import org.onap.policy.drools.pooling.message.Leader; import org.onap.policy.drools.pooling.message.Message; import org.onap.policy.drools.pooling.message.Offline; import org.onap.policy.drools.pooling.message.Query; -import org.onap.policy.drools.utils.Triple; public class StartStateTest extends SupportBasicStateTester { @@ -92,15 +92,15 @@ public class StartStateTest extends SupportBasicStateTester { */ Triple<Long, Long, StateTimerTask> generator = repeatedTasks.removeFirst(); - assertEquals(STD_INTER_HEARTBEAT_MS, generator.first().longValue()); - assertEquals(STD_INTER_HEARTBEAT_MS, generator.second().longValue()); + assertEquals(STD_INTER_HEARTBEAT_MS, generator.getLeft().longValue()); + assertEquals(STD_INTER_HEARTBEAT_MS, generator.getMiddle().longValue()); // invoke the task - it should generate another heartbeat - assertEquals(null, generator.third().fire()); + assertEquals(null, generator.getRight().fire()); verify(mgr, times(2)).publish(MY_HOST, msg.getRight()); // and again - assertEquals(null, generator.third().fire()); + assertEquals(null, generator.getRight().fire()); verify(mgr, times(3)).publish(MY_HOST, msg.getRight()); diff --git a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/SupportBasicStateTester.java b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/SupportBasicStateTester.java index a1246938..1a65c802 100644 --- a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/SupportBasicStateTester.java +++ b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/SupportBasicStateTester.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2018, 2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2020 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -37,13 +37,13 @@ import java.util.SortedSet; import java.util.TreeSet; import java.util.concurrent.atomic.AtomicReference; import org.apache.commons.lang3.tuple.Pair; +import org.apache.commons.lang3.tuple.Triple; import org.onap.policy.drools.pooling.CancellableScheduledTask; import org.onap.policy.drools.pooling.PoolingManager; import org.onap.policy.drools.pooling.PoolingProperties; import org.onap.policy.drools.pooling.message.BucketAssignments; import org.onap.policy.drools.pooling.message.Leader; import org.onap.policy.drools.pooling.message.Message; -import org.onap.policy.drools.utils.Triple; /** * Superclass used to test subclasses of {@link State}. @@ -179,7 +179,7 @@ public class SupportBasicStateTester { // capture scheduleWithFixedDelay() arguments, and return a new future when(mgr.scheduleWithFixedDelay(anyLong(), anyLong(), any(StateTimerTask.class))).thenAnswer(invocation -> { Object[] args = invocation.getArguments(); - repeatedTasks.add(new Triple<>((Long) args[0], (Long) args[1], (StateTimerTask) args[2])); + repeatedTasks.add(Triple.of((Long) args[0], (Long) args[1], (StateTimerTask) args[2])); CancellableScheduledTask sched = mock(CancellableScheduledTask.class); repeatedSchedules.add(sched); diff --git a/feature-server-pool/pom.xml b/feature-server-pool/pom.xml index d8b0cc45..7d733356 100644 --- a/feature-server-pool/pom.xml +++ b/feature-server-pool/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>feature-server-pool</artifactId> diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/MainLoop.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/MainLoop.java index 4ae8b59b..ca5e86ac 100644 --- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/MainLoop.java +++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/MainLoop.java @@ -84,7 +84,9 @@ class MainLoop extends Thread { * @param work this is the Runnable to invoke */ public static void queueWork(Runnable work) { - incomingWork.offer(work); + if (!incomingWork.offer(work)) { + logger.info("incomingWork returned false"); + } } /** @@ -143,11 +145,7 @@ class MainLoop extends Thread { // work that runs every cycle for (Runnable work : backgroundWork) { - try { - work.run(); - } catch (Exception e) { - logger.error("Exception in MainLoop background work", e); - } + backgroundWorkRunnable(work); } } catch (Exception e) { logger.error("Exception in MainLoop", e); @@ -156,6 +154,17 @@ class MainLoop extends Thread { } /** + * Runnable try loop. + */ + static void backgroundWorkRunnable(Runnable work) { + try { + work.run(); + } catch (Exception e) { + logger.error("Exception in MainLoop background work", e); + } + } + + /** * Poll for and process incoming messages for up to 1 second. */ static void handleIncomingWork() { diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java index 634c15ec..d310805a 100644 --- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java +++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/Server.java @@ -59,8 +59,6 @@ import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.UnknownHostException; import java.nio.charset.StandardCharsets; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; import java.text.SimpleDateFormat; import java.util.Base64; import java.util.Collection; @@ -239,14 +237,14 @@ public class Server implements Comparable<Server> { * This method may be invoked from any thread, and is used as the main * entry point when testing. * - * @param args arguments contaning an '=' character are intepreted as + * @param args arguments containing an '=' character are interpreted as * a property, other arguments are presumed to be a property file. */ public static void main(String[] args) throws IOException { Properties prop = new Properties(); for (String arg : args) { - // arguments with an '=' in them are a property definition; + // arguments with an equals sign in them are a property definition; // otherwise, they are a properties file name if (arg.contains("=")) { @@ -646,9 +644,7 @@ public class Server implements Comparable<Server> { // initialize the 'target' field target = getTarget(client); - } catch (KeyManagementException | NoSuchAlgorithmException - | NoSuchFieldException | IllegalAccessException - | ClassNotFoundException | HttpClientConfigException e) { + } catch (NoSuchFieldException | IllegalAccessException | HttpClientConfigException e) { logger.error("Server.newServer: problems creating 'client'", e); } } @@ -684,9 +680,7 @@ public class Server implements Comparable<Server> { // initialize the 'target' field target = getTarget(client); - } catch (KeyManagementException | NoSuchAlgorithmException - | NoSuchFieldException | IllegalAccessException - | ClassNotFoundException | HttpClientConfigException e) { + } catch (NoSuchFieldException | IllegalAccessException | HttpClientConfigException e) { logger.error("Server.checkServer: problems recreating 'client'", e); } } @@ -756,7 +750,7 @@ public class Server implements Comparable<Server> { } /** - * Fetch, and possibily calculate, the "notify list" associated with this + * Fetch, and possibly calculate, the "notify list" associated with this * server. This is the list of servers to forward a server and bucket * information to, and is approximately log2(n) in length, where 'n' is * the total number of servers. @@ -790,7 +784,7 @@ public class Server implements Comparable<Server> { siteSocketAddresses.add(thisSiteSocketAddress); // the list we are building - notifyList = new LinkedList<Server>(); + notifyList = new LinkedList<>(); int index = 1; for ( ; ; ) { @@ -869,8 +863,7 @@ public class Server implements Comparable<Server> { * @param destName the string name to use for the destination */ static HttpClient buildClient(String name, InetSocketAddress dest, String destName) - throws KeyManagementException, NoSuchAlgorithmException, - ClassNotFoundException, HttpClientConfigException { + throws HttpClientConfigException { return HttpClientFactoryInstance.getClientFactory().build( BusTopicParams.builder() @@ -1211,9 +1204,6 @@ public class Server implements Comparable<Server> { getTarget(httpClient).path("admin").request().post(entity); httpClient.shutdown(); httpClient = null; - } catch (KeyManagementException | NoSuchAlgorithmException e) { - out.println(host + ": Unable to create client connection"); - logger.error(PINGHOSTS_ERROR, e); } catch (NoSuchFieldException | IllegalAccessException e) { out.println(host + ": Unable to get link to target"); logger.error(PINGHOSTS_ERROR, e); diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/TargetLock.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/TargetLock.java index ef88abf2..1637e9ef 100644 --- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/TargetLock.java +++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/TargetLock.java @@ -131,13 +131,13 @@ public class TargetLock implements Lock, Serializable { // this is used to notify the application when a lock is available, // or if it is not available - private volatile LockCallback owner; + private final LockCallback owner; // This is what is actually called by the infrastructure to do the owner // notification. The owner may be running in a Drools session, in which case // the actual notification should be done within that thread -- the 'context' // object ensures that it happens this way. - private volatile LockCallback context; + private final LockCallback context; // HTTP query parameters private static final String QP_KEY = "key"; @@ -150,6 +150,11 @@ public class TargetLock implements Lock, Serializable { // define a constant for empty of byte array private static final byte[] EMPTY_BYTE_ARRAY = {}; + // below are for duplicating string in printout or logger + private static final String PRINTOUT_DASHES = "---------"; + private static final String LOCK_AUDIT = "lock/audit"; + private static final String TARGETLOCK_AUDIT_SEND = "TargetLock.Audit.send: "; + /** * This method triggers registration of 'eventHandler', and also extracts * property values. @@ -1783,9 +1788,9 @@ public class TargetLock implements Lock, Serializable { out.printf(format, "Key", "Bucket", "Host UUID", "Owner Key", "Bucket", "Host UUID", "Lock UUID", "State", "Comments"); - out.printf(format, "---", "------", "---------", - "---------", "------", "---------", - "---------", "-----", "--------"); + out.printf(format, "---", "------", PRINTOUT_DASHES, + PRINTOUT_DASHES, "------", PRINTOUT_DASHES, + PRINTOUT_DASHES, "-----", "--------"); } else { // generate format based upon the maximum key length, maximum // owner key length, and whether comments are included anywhere @@ -1794,7 +1799,7 @@ public class TargetLock implements Lock, Serializable { // dump out the header out.printf(format, "Key", "Owner Key", "UUID", "State", "Comments"); - out.printf(format, "---", "---------", "----", "-----", "--------"); + out.printf(format, "---", PRINTOUT_DASHES, "----", "-----", "--------"); } dumpServerTable(out); @@ -2170,9 +2175,6 @@ public class TargetLock implements Lock, Serializable { static class AuditData implements Serializable { private static final long serialVersionUID = 1L; - // sending UUID - private UUID hostUuid; - // client records that currently exist, or records to be cleared // (depending upon message) -- client/server is from the senders side private List<Identity> clientData; @@ -2186,7 +2188,6 @@ public class TargetLock implements Lock, Serializable { * empty lists. */ AuditData() { - hostUuid = Server.getThisServer().getUuid(); clientData = new ArrayList<>(); serverData = new ArrayList<>(); } @@ -2530,9 +2531,9 @@ public class TargetLock implements Lock, Serializable { if (ttl > 0) { Server server = Server.getServer(serverUuid); if (server != null) { - WebTarget webTarget = server.getWebTarget("lock/audit"); + WebTarget webTarget = server.getWebTarget(LOCK_AUDIT); if (webTarget != null) { - logger.info("Forwarding 'lock/audit' to uuid {}", + logger.info("Forwarding {} to uuid {}", LOCK_AUDIT, serverUuid); Entity<String> entity = Entity.entity(new String(encodedData), @@ -2547,7 +2548,8 @@ public class TargetLock implements Lock, Serializable { // if we reach this point, we didn't forward for some reason - logger.error("Couldn't forward 'lock/audit to uuid {}", serverUuid); + logger.error("Couldn't forward {} to uuid {}", LOCK_AUDIT, + serverUuid); return EMPTY_BYTE_ARRAY; } @@ -2675,8 +2677,7 @@ public class TargetLock implements Lock, Serializable { if (respData.clientData.isEmpty() && respData.serverData.isEmpty()) { // no mismatches - logger.info("TargetLock.Audit.send: " - + "no errors from self ({})", server); + logger.info("{} no errors from self ({})", TARGETLOCK_AUDIT_SEND, server); return; } @@ -2687,7 +2688,7 @@ public class TargetLock implements Lock, Serializable { if (AuditPostResponse.responseSupport( respData, "self (" + server + ")", "TargetLock.Audit.send")) { - // a return falue of 'true' either indicates the + // a return value of 'true' either indicates the // mismatches were resolved after a retry, or we // received an interrupt, and need to abort return; @@ -2711,7 +2712,7 @@ public class TargetLock implements Lock, Serializable { Entity.entity(new String(encodedData), MediaType.APPLICATION_OCTET_STREAM_TYPE); - server.post("lock/audit", entity, new AuditPostResponse(server)); + server.post(LOCK_AUDIT, entity, new AuditPostResponse(server)); } } @@ -2736,9 +2737,8 @@ public class TargetLock implements Lock, Serializable { AuditData respData = AuditData.decode(response.readEntity(byte[].class)); if (respData == null) { - logger.error("TargetLock.Audit.send: " - + "couldn't process response from {}", - server); + logger.error("{} couldn't process response from {}", + TARGETLOCK_AUDIT_SEND, server); return; } @@ -2746,8 +2746,7 @@ public class TargetLock implements Lock, Serializable { if (respData.clientData.isEmpty() && respData.serverData.isEmpty()) { // no mismatches - logger.info("TargetLock.Audit.send: " - + "no errors from {}", server); + logger.info("{} no errors from {}", TARGETLOCK_AUDIT_SEND, server); return; } diff --git a/feature-session-persistence/pom.xml b/feature-session-persistence/pom.xml index afa9e601..cacc3fc9 100644 --- a/feature-session-persistence/pom.xml +++ b/feature-session-persistence/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>feature-session-persistence</artifactId> diff --git a/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/DroolsSessionEntityTest.java b/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/DroolsSessionEntityTest.java index 3033a7bd..2cc7d33a 100644 --- a/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/DroolsSessionEntityTest.java +++ b/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/DroolsSessionEntityTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * feature-session-persistence * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-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. @@ -21,9 +21,7 @@ package org.onap.policy.drools.persistence; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertTrue; import java.util.Date; import org.junit.Test; diff --git a/feature-simulators/pom.xml b/feature-simulators/pom.xml index beda57b7..dec5599b 100644 --- a/feature-simulators/pom.xml +++ b/feature-simulators/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>feature-simulators</artifactId> diff --git a/feature-state-management/pom.xml b/feature-state-management/pom.xml index 76517c3a..c751ebe5 100644 --- a/feature-state-management/pom.xml +++ b/feature-state-management/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>feature-state-management</artifactId> diff --git a/feature-test-transaction/pom.xml b/feature-test-transaction/pom.xml index 353d3421..6d38fa48 100644 --- a/feature-test-transaction/pom.xml +++ b/feature-test-transaction/pom.xml @@ -23,7 +23,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>feature-test-transaction</artifactId> diff --git a/packages/base/pom.xml b/packages/base/pom.xml index 4bc9887d..93129bf2 100644 --- a/packages/base/pom.xml +++ b/packages/base/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-packages</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>base</artifactId> diff --git a/packages/docker/pom.xml b/packages/docker/pom.xml index 0b22c9ca..a689b5e8 100644 --- a/packages/docker/pom.xml +++ b/packages/docker/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-packages</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>docker</artifactId> diff --git a/packages/install/pom.xml b/packages/install/pom.xml index b1b68503..84c9503c 100644 --- a/packages/install/pom.xml +++ b/packages/install/pom.xml @@ -28,7 +28,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-packages</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>install-drools</artifactId> diff --git a/packages/pom.xml b/packages/pom.xml index c99ee1c3..5f7f69ea 100644 --- a/packages/pom.xml +++ b/packages/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>drools-packages</artifactId> <packaging>pom</packaging> diff --git a/policy-core/pom.xml b/policy-core/pom.xml index dbba23a0..2993eebb 100644 --- a/policy-core/pom.xml +++ b/policy-core/pom.xml @@ -28,7 +28,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <dependencies> diff --git a/policy-core/src/test/java/org/onap/policy/drools/core/jmx/PdpJmxTest.java b/policy-core/src/test/java/org/onap/policy/drools/core/jmx/PdpJmxTest.java index 7b565f76..e585a4b6 100644 --- a/policy-core/src/test/java/org/onap/policy/drools/core/jmx/PdpJmxTest.java +++ b/policy-core/src/test/java/org/onap/policy/drools/core/jmx/PdpJmxTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2018 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. @@ -23,7 +23,6 @@ package org.onap.policy.drools.core.jmx; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; diff --git a/policy-domains/pom.xml b/policy-domains/pom.xml index f09ebb43..3750b026 100644 --- a/policy-domains/pom.xml +++ b/policy-domains/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>policy-domains</artifactId> diff --git a/policy-management/pom.xml b/policy-management/pom.xml index fb96fd7b..68b288ee 100644 --- a/policy-management/pom.xml +++ b/policy-management/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>policy-management</artifactId> diff --git a/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolsetTest.java b/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolsetTest.java index 6b497fa3..abf9b387 100644 --- a/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolsetTest.java +++ b/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolsetTest.java @@ -26,6 +26,8 @@ import java.io.IOException; import java.nio.file.Paths; import java.util.List; import java.util.Properties; +import lombok.AllArgsConstructor; +import lombok.Getter; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -42,7 +44,6 @@ import org.onap.policy.drools.properties.DroolsPropertyConstants; import org.onap.policy.drools.protocol.coders.EventProtocolCoder.CoderFilters; import org.onap.policy.drools.protocol.coders.TopicCoderFilterConfiguration.CustomGsonCoder; import org.onap.policy.drools.util.KieUtils; -import org.onap.policy.drools.utils.Triple; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -68,11 +69,10 @@ public class ProtocolCoderToolsetTest { */ @BeforeClass public static void setUpClass() throws IOException { - releaseId = KieUtils.installArtifact( - Paths.get(MavenDroolsControllerTest.JUNIT_ECHO_KMODULE_PATH).toFile(), - Paths.get(MavenDroolsControllerTest.JUNIT_ECHO_KMODULE_POM_PATH).toFile(), - MavenDroolsControllerTest.JUNIT_ECHO_KJAR_DRL_PATH, - Paths.get(MavenDroolsControllerTest.JUNIT_ECHO_KMODULE_DRL_PATH).toFile()); + releaseId = KieUtils.installArtifact(Paths.get(MavenDroolsControllerTest.JUNIT_ECHO_KMODULE_PATH).toFile(), + Paths.get(MavenDroolsControllerTest.JUNIT_ECHO_KMODULE_POM_PATH).toFile(), + MavenDroolsControllerTest.JUNIT_ECHO_KJAR_DRL_PATH, + Paths.get(MavenDroolsControllerTest.JUNIT_ECHO_KMODULE_DRL_PATH).toFile()); } /** @@ -104,28 +104,25 @@ public class ProtocolCoderToolsetTest { * @param protocolFilter protocol filter */ private void testGsonToolset(JsonProtocolFilter protocolFilter) { - GsonProtocolCoderToolset gsonToolset = new GsonProtocolCoderToolset( - EventProtocolParams.builder().topic(JUNIT_PROTOCOL_CODER_TOPIC) - .groupId(releaseId.getGroupId()) - .artifactId(releaseId.getArtifactId()) - .eventClass(Triple.class.getName()) - .protocolFilter(protocolFilter) - .customGsonCoder(null) - .modelClassLoaderHash(12345678), CONTROLLER_ID); + GsonProtocolCoderToolset gsonToolset = + new GsonProtocolCoderToolset(EventProtocolParams.builder().topic(JUNIT_PROTOCOL_CODER_TOPIC) + .groupId(releaseId.getGroupId()).artifactId(releaseId.getArtifactId()) + .eventClass(ThreeStrings.class.getName()).protocolFilter(protocolFilter) + .customGsonCoder(null).modelClassLoaderHash(12345678), CONTROLLER_ID); Assert.assertNotNull(gsonToolset.getEncoder()); Assert.assertNotNull(gsonToolset.getDecoder()); testToolset(protocolFilter, gsonToolset); - Triple<String, String, String> triple = createTriple(); + ThreeStrings triple = createTriple(); gsonToolset.setCustomCoder(new CustomGsonCoder(this.getClass().getName(), "customCoder")); String tripleEncoded = encode(gsonToolset, triple); decode(protocolFilter, gsonToolset, triple, tripleEncoded); } - private Triple<String, String, String> createTriple() { - return new Triple<>("v1", "v2", "v3"); + private ThreeStrings createTriple() { + return new ThreeStrings("v1", "v2", "v3"); } private void testToolset(JsonProtocolFilter protocolFilter, ProtocolCoderToolset coderToolset) { @@ -137,61 +134,59 @@ public class ProtocolCoderToolsetTest { addRemoveCoder(coderToolset); /* restore original filters */ - coderToolset.addCoder(Triple.class.getName(), protocolFilter, 654321); + coderToolset.addCoder(ThreeStrings.class.getName(), protocolFilter, 654321); - Triple<String, String, String> triple = createTriple(); + ThreeStrings triple = createTriple(); String tripleEncoded = encode(coderToolset, triple); decode(protocolFilter, coderToolset, triple, tripleEncoded); } - @SuppressWarnings("unchecked") private void decode(JsonProtocolFilter protocolFilter, ProtocolCoderToolset coderToolset, - Triple<String, String, String> triple, String tripleEncoded) { + ThreeStrings triple, String tripleEncoded) { - Triple<String, String, String> tripleDecoded = null; + ThreeStrings tripleDecoded = null; try { - tripleDecoded = (Triple<String, String, String>) coderToolset.decode(tripleEncoded); + tripleDecoded = (ThreeStrings) coderToolset.decode(tripleEncoded); } catch (UnsupportedOperationException e) { /* OK */ logger.trace("Junit expected exception - decode does not pass filtering", e); } - CoderFilters coderFilters = coderToolset.getCoder(Triple.class.getName()); - Assert.assertSame(coderFilters.getCodedClass(), Triple.class.getName()); + CoderFilters coderFilters = coderToolset.getCoder(ThreeStrings.class.getName()); + Assert.assertSame(coderFilters.getCodedClass(), ThreeStrings.class.getName()); Assert.assertSame(coderFilters.getFilter(), protocolFilter); Assert.assertNotNull(coderFilters.getFilter().getRule()); coderFilters.getFilter().setRule("[?($.second =~ /^v2$/ && $.third =~ /.*v3.*/)]"); - tripleDecoded = (Triple<String, String, String>) coderToolset.decode(tripleEncoded); + tripleDecoded = (ThreeStrings) coderToolset.decode(tripleEncoded); - Assert.assertEquals(triple.first(), tripleDecoded.first()); - Assert.assertEquals(triple.second(), tripleDecoded.second()); - Assert.assertEquals(triple.third(), tripleDecoded.third()); + Assert.assertEquals(triple.getFirst(), tripleDecoded.getFirst()); + Assert.assertEquals(triple.getSecond(), tripleDecoded.getSecond()); + Assert.assertEquals(triple.getThird(), tripleDecoded.getThird()); coderFilters.getFilter().setRule(null); Assert.assertEquals("[?($ =~ /.*/)]", coderFilters.getFilter().getRule()); - tripleDecoded = (Triple<String, String, String>) coderToolset.decode(tripleEncoded); + tripleDecoded = (ThreeStrings) coderToolset.decode(tripleEncoded); - Assert.assertEquals(tripleDecoded.first(), triple.first()); - Assert.assertEquals(tripleDecoded.second(), triple.second()); - Assert.assertEquals(tripleDecoded.third(), triple.third()); + Assert.assertEquals(tripleDecoded.getFirst(), triple.getFirst()); + Assert.assertEquals(tripleDecoded.getSecond(), triple.getSecond()); + Assert.assertEquals(tripleDecoded.getThird(), triple.getThird()); coderFilters.getFilter().setRule("[?($.third =~ /.*v3.*/)]"); } - private String encode(ProtocolCoderToolset coderToolset, Triple<String, String, String> triple) { + private String encode(ProtocolCoderToolset coderToolset, ThreeStrings triple) { String tripleEncoded = coderToolset.encode(triple); Assert.assertTrue(!tripleEncoded.isEmpty()); return tripleEncoded; } private void addRemoveCoder(ProtocolCoderToolset coderToolset) { - coderToolset.addCoder(this.getClass().getName(), - new JsonProtocolFilter("[?($.second =~ /.*/)]"), 654321); + coderToolset.addCoder(this.getClass().getName(), new JsonProtocolFilter("[?($.second =~ /.*/)]"), 654321); Assert.assertEquals(2, coderToolset.getCoders().size()); coderToolset.removeCoders(this.getClass().getName()); @@ -199,18 +194,16 @@ public class ProtocolCoderToolsetTest { } private void updateCoderFilterRule(ProtocolCoderToolset coderToolset) { - coderToolset.addCoder(Triple.class.getName(), new JsonProtocolFilter("[?($.third =~ /.*/)]"), 654321); + coderToolset.addCoder(ThreeStrings.class.getName(), new JsonProtocolFilter("[?($.third =~ /.*/)]"), 654321); Assert.assertEquals(1, coderToolset.getCoders().size()); - Assert.assertEquals(654321, coderToolset.getCoder(Triple.class.getName()).getModelClassLoaderHash()); + Assert.assertEquals(654321, coderToolset.getCoder(ThreeStrings.class.getName()).getModelClassLoaderHash()); - Assert.assertNotNull( - coderToolset.getCoder( - Triple.class.getName()).getFilter().getRule()); + Assert.assertNotNull(coderToolset.getCoder(ThreeStrings.class.getName()).getFilter().getRule()); - Assert.assertEquals("[?($.third =~ /.*/)]", coderToolset.getCoder(Triple.class.getName()) - .getFilter().getRule()); + Assert.assertEquals("[?($.third =~ /.*/)]", + coderToolset.getCoder(ThreeStrings.class.getName()).getFilter().getRule()); } private void validateInitialization(JsonProtocolFilter protocolFilter, ProtocolCoderToolset coderToolset) { @@ -224,7 +217,7 @@ public class ProtocolCoderToolsetTest { CoderFilters coderFilters = coderToolset.getCoder(CONTROLLER_ID); Assert.assertNull(coderFilters); - coderFilters = coderToolset.getCoder(Triple.class.getName()); + coderFilters = coderToolset.getCoder(ThreeStrings.class.getName()); Assert.assertNotNull(coderFilters); Assert.assertEquals(coderFilters.getFilter(), protocolFilter); @@ -243,8 +236,10 @@ public class ProtocolCoderToolsetTest { droolsControllerConfig.put(DroolsPropertyConstants.RULES_GROUPID, releaseId.getGroupId()); droolsControllerConfig.put(DroolsPropertyConstants.RULES_ARTIFACTID, releaseId.getArtifactId()); droolsControllerConfig.put(DroolsPropertyConstants.RULES_VERSION, releaseId.getVersion()); - droolsControllerConfig.put(PolicyEndPointProperties.PROPERTY_NOOP_SINK_TOPICS + "." + JUNIT_PROTOCOL_CODER_TOPIC - + PolicyEndPointProperties.PROPERTY_TOPIC_EVENTS_SUFFIX, Triple.class.getName()); + droolsControllerConfig.put( + PolicyEndPointProperties.PROPERTY_NOOP_SINK_TOPICS + "." + JUNIT_PROTOCOL_CODER_TOPIC + + PolicyEndPointProperties.PROPERTY_TOPIC_EVENTS_SUFFIX, + ThreeStrings.class.getName()); return DroolsControllerConstants.getFactory().build(droolsControllerConfig, null, noopTopics); } @@ -252,4 +247,16 @@ public class ProtocolCoderToolsetTest { private JsonProtocolFilter createFilterSet() { return new JsonProtocolFilter("[?($.first =~ /.*/ && $.second =~ /^blah.*/ && $.third =~ /^hello$/)]"); } + + /** + * Note: We need an object that can be constructed, but the apache Triple cannot, thus + * we create our own class just for these tests. + */ + @Getter + @AllArgsConstructor + public static class ThreeStrings { + private String first; + private String second; + private String third; + } } diff --git a/policy-utils/pom.xml b/policy-utils/pom.xml index 6c1fa571..a30ad171 100644 --- a/policy-utils/pom.xml +++ b/policy-utils/pom.xml @@ -28,7 +28,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <dependencies> diff --git a/policy-utils/src/main/java/org/onap/policy/drools/utils/Triple.java b/policy-utils/src/main/java/org/onap/policy/drools/utils/Triple.java deleted file mode 100644 index d37a5d92..00000000 --- a/policy-utils/src/main/java/org/onap/policy/drools/utils/Triple.java +++ /dev/null @@ -1,93 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - * ================================================================================ - * 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. - * 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. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.drools.utils; - -public class Triple<F, S, T> { - - private F first; - private S second; - private T third; - - public Triple() { - // empty constructor - } - - /** - * Constructor. - * - * @param first first - * @param second second - * @param third third - */ - public Triple(F first, S second, T third) { - this.first = first; - this.second = second; - this.third = third; - } - - public F first() { - return this.getFirst(); - } - - public void first(F first) { - this.setFirst(first); - } - - public F getFirst() { - return first; - } - - public void setFirst(F first) { - this.first = first; - } - - public S second() { - return this.getSecond(); - } - - public void second(S second) { - this.setSecond(second); - } - - public S getSecond() { - return second; - } - - public void setSecond(S second) { - this.second = second; - } - - public T third() { - return this.getThird(); - } - - public void third(T third) { - this.setThird(third); - } - - public T getThird() { - return this.third; - } - - public void setThird(T third) { - this.third = third; - } -} diff --git a/policy-utils/src/test/java/org/onap/policy/drools/utils/TripleTest.java b/policy-utils/src/test/java/org/onap/policy/drools/utils/TripleTest.java deleted file mode 100644 index b62c9530..00000000 --- a/policy-utils/src/test/java/org/onap/policy/drools/utils/TripleTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP - * ================================================================================ - * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2020 Nordix Foundation - * ================================================================================ - * 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. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.drools.utils; - -import org.junit.Assert; -import org.junit.Test; - -public class TripleTest { - - @Test - public void test() { - Triple<String, String, String> triple = - new Triple<>("one", "two", "three"); - - Assert.assertEquals("one", triple.first()); - Assert.assertEquals("one", triple.getFirst()); - - Assert.assertEquals("two", triple.second()); - Assert.assertEquals("two", triple.getSecond()); - - Assert.assertEquals("three", triple.third()); - Assert.assertEquals("three", triple.getThird()); - - triple.first("I"); - Assert.assertEquals("I", triple.first()); - - triple.setFirst("1"); - Assert.assertEquals("1", triple.first()); - - triple.second("2"); - Assert.assertEquals("2", triple.second()); - - triple.setSecond("II"); - Assert.assertEquals("II", triple.second()); - - triple.third("3"); - Assert.assertEquals("3", triple.third()); - - triple.setThird("III"); - Assert.assertEquals("III", triple.third()); - - } -}
\ No newline at end of file @@ -26,13 +26,13 @@ <parent> <groupId>org.onap.policy.parent</groupId> <artifactId>integration</artifactId> - <version>3.2.0-SNAPSHOT</version> + <version>3.2.0</version> <relativePath /> </parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> <packaging>pom</packaging> <name>policy-drools-pdp</name> @@ -52,8 +52,8 @@ <hibernate.commons.annotations.version>5.0.1.Final</hibernate.commons.annotations.version> <commons.io.version>2.5</commons.io.version> <xml.apis.version>1.4.01</xml.apis.version> - <policy.common.version>1.7.0-SNAPSHOT</policy.common.version> - <policy.models.version>2.3.0-SNAPSHOT</policy.models.version> + <policy.common.version>1.7.0</policy.common.version> + <policy.models.version>2.3.0</policy.models.version> </properties> <modules> diff --git a/releases/1.7.0-container.yaml b/releases/1.7.0-container.yaml new file mode 100644 index 00000000..557ea3ec --- /dev/null +++ b/releases/1.7.0-container.yaml @@ -0,0 +1,8 @@ +distribution_type: 'container' +container_release_tag: '1.7.0' +project: 'policy-drools-pdp' +log_dir: 'policy-drools-pdp-maven-docker-stage-master/391' +ref: 1a6b6d8c0f5ebd0af8bae3c5de225e5eb7d01214 +containers: + - name: 'policy-drools' + version: '1.7.0-20200710T1321' diff --git a/releases/1.7.0.yaml b/releases/1.7.0.yaml new file mode 100644 index 00000000..9f3de88d --- /dev/null +++ b/releases/1.7.0.yaml @@ -0,0 +1,4 @@ +distribution_type: 'maven' +version: '1.7.0' +project: 'policy-drools-pdp' +log_dir: 'policy-drools-pdp-maven-stage-master/392/' diff --git a/version.properties b/version.properties index e377fcf8..4bdcfa1b 100644 --- a/version.properties +++ b/version.properties @@ -4,7 +4,7 @@ major=1 minor=7 -patch=0 +patch=1 base_version=${major}.${minor}.${patch} |