From 13d8a3204013f1c0bc02ddede96ab37ac3d64129 Mon Sep 17 00:00:00 2001 From: jhh Date: Mon, 24 Aug 2020 13:09:58 -0500 Subject: exit jvm when detecting configuration problems It follows the same approach that in other policy components by throwing a runtime-exception vs System.exit(x). Issue-ID: POLICY-2752 Signed-off-by: jhh Change-Id: Iba508fc7095b060373742849e394c8fdd2a2334f Signed-off-by: jhh --- .../PolicyDroolsPdpRuntimeExceptionTest.java | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 policy-management/src/test/java/org/onap/policy/drools/system/PolicyDroolsPdpRuntimeExceptionTest.java (limited to 'policy-management/src/test/java/org/onap') diff --git a/policy-management/src/test/java/org/onap/policy/drools/system/PolicyDroolsPdpRuntimeExceptionTest.java b/policy-management/src/test/java/org/onap/policy/drools/system/PolicyDroolsPdpRuntimeExceptionTest.java new file mode 100644 index 00000000..64595178 --- /dev/null +++ b/policy-management/src/test/java/org/onap/policy/drools/system/PolicyDroolsPdpRuntimeExceptionTest.java @@ -0,0 +1,37 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP + * ================================================================================ + * Copyright (C) 2020 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.drools.system; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.onap.policy.common.utils.test.ExceptionsTester; + +public class PolicyDroolsPdpRuntimeExceptionTest { + + @Test + public void test() { + assertEquals(2, new ExceptionsTester().test(PolicyDroolsPdpRuntimeException.class)); + } + +} -- cgit 1.2.3-korg