summaryrefslogtreecommitdiffstats
path: root/appc-core/appc-common-bundle
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2019-03-01 16:31:24 +0530
committerJoss Armstrong <joss.armstrong@ericsson.com>2019-03-04 14:31:45 +0000
commitd7422e0ef739a61cadd536da1967174562d053ad (patch)
tree58059dca06cfd201f9b2f0648dad0b2575a1c8bb /appc-core/appc-common-bundle
parent8fcf11ec80afd9fce613bef76ce99ef87a959a8b (diff)
added test cases to CachedElementTest.java
to increase code coverage Issue-ID: APPC-1086 Change-Id: Idfb3ce36d41fdec4a5286da63b8a9592c1c83a96 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'appc-core/appc-common-bundle')
-rw-r--r--appc-core/appc-common-bundle/src/test/java/org/onap/appc/pool/CachedElementTest.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/appc-core/appc-common-bundle/src/test/java/org/onap/appc/pool/CachedElementTest.java b/appc-core/appc-common-bundle/src/test/java/org/onap/appc/pool/CachedElementTest.java
index 02bdd3be3..0d0c08ad9 100644
--- a/appc-core/appc-common-bundle/src/test/java/org/onap/appc/pool/CachedElementTest.java
+++ b/appc-core/appc-common-bundle/src/test/java/org/onap/appc/pool/CachedElementTest.java
@@ -6,6 +6,8 @@
* ================================================================================
* Copyright (C) 2017 Amdocs
* =============================================================================
+ * Modifications Copyright (C) 2019 IBM
+ * =============================================================================
* 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
@@ -27,6 +29,7 @@ package org.onap.appc.pool;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@@ -272,4 +275,21 @@ public class CachedElementTest implements Allocator<Testable>, Destructor<Testab
public void destroy(Testable obj, Pool<Testable> pool) {
destroyCount++;
}
+
+ @Test
+ public void testGetWrappedObject()
+ {
+ Testable element = new Element(index++);
+ CachedElement cachedElement = new CachedElement(pool, element);
+ assertNotNull(cachedElement.getWrappedObject());
+ assertSame(element, cachedElement.getWrappedObject());
+ }
+
+ @Test
+ public void testToString()
+ {
+ Testable element = new Element(index++);
+ CachedElement cachedElement = new CachedElement(pool, element);
+ assertTrue(cachedElement.toString() instanceof String);
+ }
}