diff options
Diffstat (limited to 'integrity-audit/src/test')
5 files changed, 56 insertions, 164 deletions
diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditExceptionTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditExceptionTest.java deleted file mode 100644 index 005a9f15..00000000 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditExceptionTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Integrity Audit - * ================================================================================ - * Copyright (C) 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.common.ia; - -import static org.junit.Assert.*; - -import org.junit.Test; - -public class DbAuditExceptionTest { - - @Test - public void test() { - DbAuditException e = new DbAuditException(); - assertNull(e.getMessage()); - e = new DbAuditException(""); - assertNotNull(e.getMessage()); - e = new DbAuditException(new Throwable()); - assertNotNull(e.getCause()); - e = new DbAuditException("", new Throwable()); - assertNotNull(e.getMessage()); - assertNotNull(e.getCause()); - } - -} diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/DbDaoTransactionExceptionTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/DbDaoTransactionExceptionTest.java deleted file mode 100644 index d93576e0..00000000 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/DbDaoTransactionExceptionTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Integrity Audit - * ================================================================================ - * Copyright (C) 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.common.ia; - -import static org.junit.Assert.*; - -import org.junit.Test; - -public class DbDaoTransactionExceptionTest { - - @Test - public void test() { - DbDaoTransactionException e = new DbDaoTransactionException(); - assertNull(e.getMessage()); - e = new DbDaoTransactionException(""); - assertNotNull(e.getMessage()); - e = new DbDaoTransactionException(new Throwable()); - assertNotNull(e.getCause()); - e = new DbDaoTransactionException("", new Throwable()); - assertNotNull(e.getMessage()); - assertNotNull(e.getCause()); - } - -} diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditExceptionTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditExceptionTest.java deleted file mode 100644 index b39e3986..00000000 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditExceptionTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Integrity Audit - * ================================================================================ - * Copyright (C) 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.common.ia; - -import static org.junit.Assert.*; - -import org.junit.Test; - -public class IntegrityAuditExceptionTest { - - @Test - public void test() { - IntegrityAuditException e = new IntegrityAuditException(); - assertNull(e.getMessage()); - e = new IntegrityAuditException(""); - assertNotNull(e.getMessage()); - e = new IntegrityAuditException(new Throwable()); - assertNotNull(e.getCause()); - e = new IntegrityAuditException("", new Throwable()); - assertNotNull(e.getMessage()); - assertNotNull(e.getCause()); - } - -} diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditPropertiesExceptionTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditPropertiesExceptionTest.java deleted file mode 100644 index 9c2b1196..00000000 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditPropertiesExceptionTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Integrity Audit - * ================================================================================ - * Copyright (C) 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.common.ia; - -import static org.junit.Assert.*; - -import org.junit.Test; - -public class IntegrityAuditPropertiesExceptionTest { - - @Test - public void test() { - IntegrityAuditPropertiesException e = new IntegrityAuditPropertiesException(); - assertNull(e.getMessage()); - e = new IntegrityAuditPropertiesException(""); - assertNotNull(e.getMessage()); - e = new IntegrityAuditPropertiesException(new Throwable()); - assertNotNull(e.getCause()); - e = new IntegrityAuditPropertiesException("", new Throwable()); - assertNotNull(e.getMessage()); - assertNotNull(e.getCause()); - } - -} diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/test/ExceptionsTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/test/ExceptionsTest.java new file mode 100644 index 00000000..af4a8ceb --- /dev/null +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/test/ExceptionsTest.java @@ -0,0 +1,56 @@ +/* + * ============LICENSE_START======================================================= + * Integrity Monitor + * ================================================================================ + * Copyright (C) 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.common.ia.test; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.onap.policy.common.ia.DbAuditException; +import org.onap.policy.common.ia.DbDaoTransactionException; +import org.onap.policy.common.ia.IntegrityAuditException; +import org.onap.policy.common.ia.IntegrityAuditPropertiesException; +import org.onap.policy.common.utils.test.ExceptionsTester; + +/** + * Tests various Exception subclasses. + */ +public class ExceptionsTest extends ExceptionsTester { + + @Test + public void testDbAuditException() throws Exception { + assertEquals(4, test(DbAuditException.class)); + } + + @Test + public void testDbDaoTransactionException() throws Exception { + assertEquals(4, test(DbDaoTransactionException.class)); + } + + @Test + public void testIntegrityAuditException() throws Exception { + assertEquals(4, test(IntegrityAuditException.class)); + } + + @Test + public void testIntegrityAuditPropertiesException() throws Exception { + assertEquals(4, test(IntegrityAuditPropertiesException.class)); + } +} |