Improve code coverage for aaf cadi modules
[aaf/cadi.git] / core / src / test / java / org / onap / aaf / cadi / CadiExceptionTest.java
index 29a0a8b..f994b60 100644 (file)
  ******************************************************************************/\r
 package org.onap.aaf.cadi;\r
 \r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
 import static org.hamcrest.CoreMatchers.is;\r
 import static org.junit.Assert.*;\r
 \r
@@ -57,5 +61,65 @@ public class CadiExceptionTest {
                assertThat(exception.getMessage(), is("New Exception"));\r
 \r
        }\r
+       \r
+       @Test\r
+       public void testCadiException1() {\r
+               CadiException exception = new CadiException();\r
+               \r
+               assertNotNull(exception);\r
+       }\r
+\r
+       @Test\r
+       public void testCadiExceptionString1() {\r
+               CadiException exception = new CadiException("New Exception");\r
+               assertNotNull(exception);\r
+               assertThat(exception.getMessage(), is("New Exception"));\r
+       }\r
+\r
+       @Test\r
+       public void testCadiExceptionThrowable1() {\r
+               CadiException exception = new CadiException(new Throwable("New Exception"));\r
+               assertNotNull(exception);\r
+               assertThat(exception.getMessage(), is("java.lang.Throwable: New Exception"));\r
+       }\r
+\r
+       @Test\r
+       public void testCadiExceptionStringThrowable1() {\r
+               CadiException exception = new CadiException("New Exception",new Throwable("New Exception"));\r
+               assertNotNull(exception);\r
+               assertThat(exception.getMessage(), is("New Exception"));\r
+\r
+       }\r
+       \r
+       @Test\r
+       public void testCadiException2() {\r
+               CadiException exception = new CadiException();\r
+               \r
+               assertNotNull(exception);\r
+       }\r
+\r
+       @Test\r
+       public void testCadiExceptionString2() {\r
+               CadiException exception = new CadiException("New Exception");\r
+               assertNotNull(exception);\r
+               assertThat(exception.getMessage(), is("New Exception"));\r
+       }\r
+\r
+       @Test\r
+       public void testCadiExceptionThrowable2() {\r
+               CadiException exception = new CadiException(new Throwable("New Exception"));\r
+               assertNotNull(exception);\r
+               assertThat(exception.getMessage(), is("java.lang.Throwable: New Exception"));\r
+       }\r
+\r
+       @Test\r
+       public void testCadiExceptionStringThrowable2() {\r
+               CadiException exception = new CadiException("New Exception",new Throwable("New Exception"));\r
+               assertNotNull(exception);\r
+               assertThat(exception.getMessage(), is("New Exception"));\r
+\r
+       }\r
+\r
+\r
 \r
 }\r