diff options
author | IanHowell <ian.howell@att.com> | 2018-04-17 08:17:47 -0500 |
---|---|---|
committer | IanHowell <ian.howell@att.com> | 2018-04-17 08:18:42 -0500 |
commit | 0b8d6377d7d67800f5059d56352c017f712ccbc2 (patch) | |
tree | 6fae08448529453c067e502763587da36d2f0fad /cadi/client/src/main/java | |
parent | 3726a143ad0cd0416e0aa8e1b1a3dc654e733dc7 (diff) |
Improve coverage of Cadi
Improved coverage of tests in cadi-core, cadi-aaf, and cadi-client
Issue-ID: AAF-128
Change-Id: Ie7df52ede1586d127098937f8d42cc6314e7eaa7
Signed-off-by: IanHowell <ian.howell@att.com>
Diffstat (limited to 'cadi/client/src/main/java')
-rw-r--r-- | cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java index 9761937e..4591122c 100644 --- a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java +++ b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java @@ -137,7 +137,7 @@ public class PropertyLocator implements Locator<URI> { @Override public synchronized void invalidate(Item item) throws LocatorException { - if(--end<=0) { + if(--end<0) { refresh(); return; } @@ -186,7 +186,7 @@ public class PropertyLocator implements Locator<URI> { URI o,n; for(int j=0;j<ia.length;++j) { o = orig[i]; - Socket socket = new Socket(); + Socket socket = createSocket(); try { realname=ia[j].getHostAddress().equals(ia[j].getHostName())?ia[j].getCanonicalHostName():ia[j].getHostName(); int port = o.getPort(); @@ -251,6 +251,10 @@ public class PropertyLocator implements Locator<URI> { return false; } } + + protected Socket createSocket() { + return new Socket(); + } private class PLItem implements Item { public int idx,order; |