--- /dev/null
+/*-\r
+* ============LICENSE_START=======================================================\r
+* ONAP : APPC\r
+* ================================================================================\r
+* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.\r
+* =============================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.onap.appc.pool;\r
+\r
+import org.junit.Assert;\r
+\r
+import org.junit.Test;\r
+\r
+public class PoolExceptionTest {\r
+\r
+ @Test\r
+ public void testPoolException() {\r
+ PoolException poolException = new PoolException();\r
+ Assert.assertTrue(poolException.getCause() == null);\r
+ Assert.assertTrue(poolException.getMessage() == null);\r
+ }\r
+\r
+ @Test\r
+ public void testPoolExceptionString() {\r
+ String message = "test message";\r
+ PoolException poolException = new PoolException(message);\r
+ Assert.assertEquals(message, poolException.getMessage());\r
+ Assert.assertEquals(message, poolException.getLocalizedMessage());\r
+ }\r
+\r
+ @Test\r
+ public void testPoolExceptionThrowable() {\r
+ String tMessage = "throwable message";\r
+ Throwable throwable = new Throwable(tMessage);\r
+ PoolException poolException = new PoolException(throwable);\r
+ Assert.assertEquals(throwable, poolException.getCause());\r
+ }\r
+\r
+ @Test\r
+ public void testPoolExceptionStringThrowable() {\r
+ String message = "my test message";\r
+ String tMessage = "throwable message";\r
+ Throwable throwable = new Throwable(tMessage);\r
+ PoolException poolException = new PoolException(message, throwable);\r
+ Assert.assertEquals(throwable, poolException.getCause());\r
+ Assert.assertTrue(poolException.getMessage().contains(message));\r
+ Assert.assertEquals(message, poolException.getLocalizedMessage());\r
+ }\r
+\r
+ @Test\r
+ public void testPoolExceptionStringThrowableBooleanBoolean() {\r
+ String message = "my test message";\r
+ String tMessage = "throwable message";\r
+ Throwable throwable = new Throwable(tMessage);\r
+ PoolException poolException = new PoolException(message, throwable, true, true);\r
+ Assert.assertEquals(throwable, poolException.getCause());\r
+ Assert.assertTrue(poolException.getMessage().contains(message));\r
+ Assert.assertEquals(message, poolException.getLocalizedMessage());\r
+ }\r
+\r
+}\r