From 4e3bb539cd8a678d8ea1e861c0cf04d472d50d9d Mon Sep 17 00:00:00 2001 From: Parshad Patel Date: Fri, 21 Dec 2018 15:36:35 +0900 Subject: Rename test classes in apex-pdp/model,core Make test classes name consitence by adding 'Test' at end of junit test classes and adding 'Support' or 'Dummy' at start of util or dummy type of test classes Issue-ID: POLICY-1263 Change-Id: I6cb8d09799d7abd1b50ead1edbc4986649ad4ba7 Signed-off-by: Parshad Patel --- .../engine/engine/impl/ApexEngineImplTest.java | 6 +-- .../apex/core/engine/engine/impl/BadListener.java | 43 ---------------- .../engine/engine/impl/DummyEnEventListener.java | 43 ++++++++++++++++ .../engine/impl/DummySlowEnEventListener.java | 58 ++++++++++++++++++++++ .../apex/core/engine/engine/impl/SlowListener.java | 58 ---------------------- 5 files changed, 104 insertions(+), 104 deletions(-) delete mode 100644 core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/BadListener.java create mode 100644 core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/DummyEnEventListener.java create mode 100644 core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/DummySlowEnEventListener.java delete mode 100644 core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/SlowListener.java (limited to 'core/core-engine') diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImplTest.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImplTest.java index 2a80cf06b..6d35adc54 100644 --- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImplTest.java +++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImplTest.java @@ -371,7 +371,7 @@ public class ApexEngineImplTest { } try { - engine.addEventListener("badListener", new BadListener()); + engine.addEventListener("badListener", new DummyEnEventListener()); } catch (Exception e) { fail("test should not throw an exception"); } @@ -394,7 +394,7 @@ public class ApexEngineImplTest { try { engine.removeEventListener("badListener"); - engine.addEventListener("slowListener", new SlowListener()); + engine.addEventListener("slowListener", new DummySlowEnEventListener()); } catch (Exception e) { fail("test should not throw an exception"); } @@ -414,7 +414,7 @@ public class ApexEngineImplTest { fail("test should not throw an exception"); } - SlowListener slowListener = new SlowListener(); + DummySlowEnEventListener slowListener = new DummySlowEnEventListener(); try { engine.addEventListener("slowListener", slowListener); } catch (Exception e) { diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/BadListener.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/BadListener.java deleted file mode 100644 index b829437d6..000000000 --- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/BadListener.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2018 Ericsson. 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.apex.core.engine.engine.impl; - -import org.onap.policy.apex.core.engine.engine.EnEventListener; -import org.onap.policy.apex.core.engine.event.EnEvent; -import org.onap.policy.apex.model.basicmodel.concepts.ApexException; - -/** - * Dummy engine event listener for unit test. - * - */ -public class BadListener implements EnEventListener { - - /* - * (non-Javadoc) - * - * @see - * org.onap.policy.apex.core.engine.engine.EnEventListener#onEnEvent(org.onap.policy.apex.core.engine.event.EnEvent) - */ - @Override - public void onEnEvent(EnEvent enEvent) throws ApexException { - throw new ApexException("not implemented on dummy class"); - } -} diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/DummyEnEventListener.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/DummyEnEventListener.java new file mode 100644 index 000000000..e67d256fe --- /dev/null +++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/DummyEnEventListener.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. 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.apex.core.engine.engine.impl; + +import org.onap.policy.apex.core.engine.engine.EnEventListener; +import org.onap.policy.apex.core.engine.event.EnEvent; +import org.onap.policy.apex.model.basicmodel.concepts.ApexException; + +/** + * Dummy engine event listener for unit test. + * + */ +public class DummyEnEventListener implements EnEventListener { + + /* + * (non-Javadoc) + * + * @see + * org.onap.policy.apex.core.engine.engine.EnEventListener#onEnEvent(org.onap.policy.apex.core.engine.event.EnEvent) + */ + @Override + public void onEnEvent(EnEvent enEvent) throws ApexException { + throw new ApexException("not implemented on dummy class"); + } +} diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/DummySlowEnEventListener.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/DummySlowEnEventListener.java new file mode 100644 index 000000000..fbb38c99e --- /dev/null +++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/DummySlowEnEventListener.java @@ -0,0 +1,58 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. 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.apex.core.engine.engine.impl; + +import org.onap.policy.apex.core.engine.engine.EnEventListener; +import org.onap.policy.apex.core.engine.event.EnEvent; +import org.onap.policy.apex.model.basicmodel.concepts.ApexException; + +/** + * Dummy engine event listener for unit test. + * + */ +public class DummySlowEnEventListener implements EnEventListener { + + private long waitTime; + + /* + * (non-Javadoc) + * + * @see + * org.onap.policy.apex.core.engine.engine.EnEventListener#onEnEvent(org.onap.policy.apex.core.engine.event.EnEvent) + */ + @Override + public void onEnEvent(EnEvent enEvent) throws ApexException { + try { + Thread.sleep(waitTime); + } + catch (InterruptedException ie) { + // Do nothing + } + } + + public long getWaitTime() { + return waitTime; + } + + public void setWaitTime(long waitTime) { + this.waitTime = waitTime; + } +} diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/SlowListener.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/SlowListener.java deleted file mode 100644 index f3f885911..000000000 --- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/SlowListener.java +++ /dev/null @@ -1,58 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2018 Ericsson. 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.apex.core.engine.engine.impl; - -import org.onap.policy.apex.core.engine.engine.EnEventListener; -import org.onap.policy.apex.core.engine.event.EnEvent; -import org.onap.policy.apex.model.basicmodel.concepts.ApexException; - -/** - * Dummy engine event listener for unit test. - * - */ -public class SlowListener implements EnEventListener { - - private long waitTime; - - /* - * (non-Javadoc) - * - * @see - * org.onap.policy.apex.core.engine.engine.EnEventListener#onEnEvent(org.onap.policy.apex.core.engine.event.EnEvent) - */ - @Override - public void onEnEvent(EnEvent enEvent) throws ApexException { - try { - Thread.sleep(waitTime); - } - catch (InterruptedException ie) { - // Do nothing - } - } - - public long getWaitTime() { - return waitTime; - } - - public void setWaitTime(long waitTime) { - this.waitTime = waitTime; - } -} -- cgit 1.2.3-korg