diff options
author | liamfallon <liam.fallon@est.tech> | 2020-09-04 11:03:24 +0100 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2020-09-04 11:24:29 +0100 |
commit | 25e3f7a0d6cd5e364e4fd69eef310fcdb8a58b55 (patch) | |
tree | 0bf44a0a6a7be18568e368c35f983e18a23fa42b /core/core-protocols/src/test/java/org/onap | |
parent | 508bdbd4d17ebf3726d92553839cc4b3af922250 (diff) |
Remove client code from apex-pdp
Removal of the deployment and monitoring client from the apex-pdp as
the functionality is replaced by the Policy Framework deployment using
PAP and the Policy Framework monitoring GUI.
Code in the engine proper that was used to administer apex-pdp over the
Web Socket port is also removed, as this code was only used by the
apex-pdp legacy GUIs.
Issue-ID: POLICY-2621
Change-Id: Ib9fc4a667a4bc79377bb7b82fae6a2bd520a3e3d
Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'core/core-protocols/src/test/java/org/onap')
12 files changed, 0 insertions, 652 deletions
diff --git a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/SupportMessageTester.java b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/SupportMessageTester.java index e6f1fa74a..1f8ccabb1 100644 --- a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/SupportMessageTester.java +++ b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/SupportMessageTester.java @@ -26,7 +26,6 @@ import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.onap.policy.apex.core.protocols.engdep.messages.StartEngine; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; /** @@ -66,7 +65,6 @@ public class SupportMessageTester { // disabling sonar because this code tests the equals() method assertEquals(dummyMessage, dummyMessage); // NOSONAR assertNotNull(dummyMessage); - assertNotEquals(dummyMessage, (Object) new StartEngine(new AxArtifactKey())); dummyMessage = new DummyMessage(new DummyAction(null), null, null); DummyMessage otherDummyMessage = new DummyMessage(null, null, null); diff --git a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/EngDepActionTest.java b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/EngDepActionTest.java deleted file mode 100644 index 0b75bb584..000000000 --- a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/EngDepActionTest.java +++ /dev/null @@ -1,48 +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.protocols.engdep; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -/** - * Test the Eng Dep Action class. - * - */ -public class EngDepActionTest { - - @Test - public void test() { - assertEquals("gets runtime information an Apex engine service", EngDepAction.GET_ENGINE_INFO.getActionString()); - assertEquals("Apex engine service information", EngDepAction.GET_ENGINE_SERVICE_INFO.getActionString()); - assertEquals("gets the status of an Apex engine service", EngDepAction.GET_ENGINE_STATUS.getActionString()); - assertEquals("response from Apex engine service", EngDepAction.RESPONSE.getActionString()); - assertEquals("starts an Apex engine", EngDepAction.START_ENGINE.getActionString()); - assertEquals("starts periodic events on an Apex engine service", - EngDepAction.START_PERIODIC_EVENTS.getActionString()); - assertEquals("stops an Apex engine service", EngDepAction.STOP_ENGINE.getActionString()); - assertEquals("stops periodic events on an Apex engine service", - EngDepAction.STOP_PERIODIC_EVENTS.getActionString()); - assertEquals("update model on Apex engine service", EngDepAction.UPDATE_MODEL.getActionString()); - } - -} diff --git a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/EngineServiceInfoResponseTest.java b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/EngineServiceInfoResponseTest.java deleted file mode 100644 index 445f831e6..000000000 --- a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/EngineServiceInfoResponseTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019-2020 Nordix Foundation. - * ================================================================================ - * 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.protocols.engdep.messages; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; - -import java.util.ArrayList; -import java.util.List; -import org.junit.Test; -import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; - -/** - * Test the start engine message. - */ -public class EngineServiceInfoResponseTest { - - @Test - public void test() { - AxArtifactKey targetKey = new AxArtifactKey("Target:0.0.1"); - GetEngineServiceInfo request = new GetEngineServiceInfo(targetKey); - - EngineServiceInfoResponse response = new EngineServiceInfoResponse(targetKey, true, request); - assertNotNull(response); - response = new EngineServiceInfoResponse(targetKey, true, "Response Data", request); - assertNotNull(response); - assertEquals("Response Data", response.getMessageData()); - - AxArtifactKey apexModelKey = new AxArtifactKey("Model:0.0.1"); - response.setApexModelKey(apexModelKey); - assertEquals(apexModelKey, response.getApexModelKey()); - - AxArtifactKey engineServiceKey = new AxArtifactKey("EngineService:0.0.1"); - response.setEngineServiceKey(engineServiceKey);; - assertEquals(engineServiceKey, response.getEngineServiceKey()); - - List<AxArtifactKey> engineKeyArrayList = new ArrayList<>(); - AxArtifactKey engineKey = new AxArtifactKey("Engine:0.0.1"); - engineKeyArrayList.add(engineKey); - response.setEngineKeyArray(engineKeyArrayList); - assertEquals(engineKeyArrayList.get(0), response.getEngineKeyArray()[0]); - - response = new EngineServiceInfoResponse(null, false, null); - assertNotEquals(0, response.hashCode()); - response.setApexModelKey(apexModelKey); - assertNotEquals(0, response.hashCode()); - response.setApexModelKey(null); - response.setEngineServiceKey(engineServiceKey);; - assertNotEquals(0, response.hashCode()); - response.setEngineServiceKey(null); - response.setEngineKeyArray(engineKeyArrayList); - assertNotEquals(0, response.hashCode()); - response.setEngineKeyArray(null); - // disabling sonar because this code tests the equals() method - assertEquals(response, response); // NOSONAR - assertNotNull(response); - assertNotEquals(response, (Object) new StartEngine(new AxArtifactKey())); - - response = new EngineServiceInfoResponse(null, false, null); - EngineServiceInfoResponse otherResponse = new EngineServiceInfoResponse(null, false, null); - - response.setApexModelKey(apexModelKey); - assertNotEquals(response, otherResponse); - otherResponse.setApexModelKey(apexModelKey); - assertEquals(response, otherResponse); - response.setApexModelKey(null); - assertNotEquals(response, otherResponse); - otherResponse.setApexModelKey(null); - assertEquals(response, otherResponse); - - response.setEngineServiceKey(engineServiceKey); - assertNotEquals(response, otherResponse); - otherResponse.setEngineServiceKey(engineServiceKey); - assertEquals(response, otherResponse); - response.setEngineServiceKey(null); - assertNotEquals(response, otherResponse); - otherResponse.setEngineServiceKey(null); - assertEquals(response, otherResponse); - - response.setEngineKeyArray(engineKeyArrayList); - assertNotEquals(response, otherResponse); - otherResponse.setEngineKeyArray(engineKeyArrayList); - assertEquals(response, otherResponse); - response.setEngineKeyArray(null); - assertNotEquals(response, otherResponse); - otherResponse.setEngineKeyArray(null); - assertEquals(response, otherResponse); - - } -} diff --git a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/GetEngineInfoTest.java b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/GetEngineInfoTest.java deleted file mode 100644 index 5bdf4a9ce..000000000 --- a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/GetEngineInfoTest.java +++ /dev/null @@ -1,42 +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.protocols.engdep.messages; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.junit.Test; -import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; - -/** - * Test the start engine message. - */ -public class GetEngineInfoTest { - - @Test - public void test() { - assertNotNull(new GetEngineInfo(new AxArtifactKey())); - assertNotNull(new GetEngineInfo(new AxArtifactKey(), "Start Engine Data")); - assertEquals("GetEngineInfo {Message [action=GET_ENGINE_INFO, " - + "targetKey=AxArtifactKey:(name=NULL,version=0.0.0), data=null]}[]", - new GetEngineInfo(new AxArtifactKey()).toString()); - } -} diff --git a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/GetEngineServiceInfoTest.java b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/GetEngineServiceInfoTest.java deleted file mode 100644 index 1bf4d6b28..000000000 --- a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/GetEngineServiceInfoTest.java +++ /dev/null @@ -1,42 +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.protocols.engdep.messages; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.junit.Test; -import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; - -/** - * Test the start engine message. - */ -public class GetEngineServiceInfoTest { - - @Test - public void test() { - assertNotNull(new GetEngineServiceInfo(new AxArtifactKey())); - assertNotNull(new GetEngineServiceInfo(new AxArtifactKey(), "Start Engine Data")); - assertEquals("GetEngineServiceInfo {Message [action=GET_ENGINE_SERVICE_INFO, " - + "targetKey=AxArtifactKey:(name=NULL,version=0.0.0), data=null]}[]", - new GetEngineServiceInfo(new AxArtifactKey()).toString()); - } -} diff --git a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/GetEngineStatusTest.java b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/GetEngineStatusTest.java deleted file mode 100644 index a2a1e6a88..000000000 --- a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/GetEngineStatusTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-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.protocols.engdep.messages; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.net.UnknownHostException; -import org.junit.Test; -import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; -import org.slf4j.ext.XLogger; -import org.slf4j.ext.XLoggerFactory; - -/** - * The Class GetExecutionStatusTest. - * - * @author Liam Fallon (liam.fallon@ericsson.com) - */ -public class GetEngineStatusTest { - // Logger for this class - private static final XLogger logger = XLoggerFactory.getXLogger(GetEngineStatusTest.class); - - GetEngineStatus message = null; - - /** - * Test register entity. - * - * @throws UnknownHostException the unknown host exception - */ - @Test - public void testRegisterEntity() throws UnknownHostException { - final AxArtifactKey targetKey = new AxArtifactKey("UpdateModelTest", "0.0.1"); - message = new GetEngineStatus(targetKey); - assertNotNull(message); - logger.debug(message.toString()); - assertTrue((message.toString()).contains("UpdateModelTest")); - } -} diff --git a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/ResponseTest.java b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/ResponseTest.java deleted file mode 100644 index 2ed8ef607..000000000 --- a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/ResponseTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019-2020 Nordix Foundation. - * ================================================================================ - * 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.protocols.engdep.messages; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.net.UnknownHostException; -import org.junit.Test; -import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; -import org.slf4j.ext.XLogger; -import org.slf4j.ext.XLoggerFactory; - -/** - * The Class ResponseTest. - * - * @author Liam Fallon (liam.fallon@ericsson.com) - */ -public class ResponseTest { - // Logger for this class - private static final XLogger logger = XLoggerFactory.getXLogger(ResponseTest.class); - - /** - * Test response. - * - * @throws UnknownHostException the unknown host exception - */ - @Test - public void testResponse() throws UnknownHostException { - final AxArtifactKey responseKey = new AxArtifactKey("ResponseTest", "0.0.1"); - final AxArtifactKey responseToKey = new AxArtifactKey("ResponseTestTo", "0.0.1"); - UpdateModel responseTo = new UpdateModel(responseToKey); - - Response message = new Response(responseKey, false, responseTo); - logger.debug(message.toString()); - assertTrue(message.toString().contains("ResponseTest")); - assertFalse(message.isSuccessful()); - - message = new Response(responseKey, true, responseTo); - logger.debug(message.toString()); - assertTrue(message.toString().contains("ResponseTest")); - assertTrue(message.isSuccessful()); - assertEquals(responseTo, message.getResponseTo()); - - message = new Response(null, false, null); - assertNotEquals(0, message.hashCode()); - message = new Response(responseKey, false, null); - assertNotEquals(0, message.hashCode()); - message = new Response(responseKey, true, null); - assertNotEquals(0, message.hashCode()); - message = new Response(responseKey, true, new UpdateModel(null)); - assertNotEquals(0, message.hashCode()); - // disabling sonar because this code tests the equals() method - assertEquals(message, message); // NOSONAR - assertNotNull(message); - assertNotEquals(message, (Object) new StartEngine(new AxArtifactKey())); - - message = new Response(null, false, responseTo); - Response otherMessage = new Response(null, false, null); - assertNotEquals(message, otherMessage); - otherMessage = new Response(null, false, responseTo); - assertEquals(message, otherMessage); - message = new Response(null, false, null); - assertNotEquals(message, otherMessage); - otherMessage = new Response(null, false, null); - assertEquals(message, (otherMessage)); - - message = new Response(null, false, null); - otherMessage = new Response(null, true, null); - assertNotEquals(message, otherMessage); - otherMessage = new Response(null, false, null); - assertEquals(message, otherMessage); - } -} diff --git a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/StartEngineTest.java b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/StartEngineTest.java deleted file mode 100644 index 037f7580e..000000000 --- a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/StartEngineTest.java +++ /dev/null @@ -1,42 +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.protocols.engdep.messages; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.junit.Test; -import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; - -/** - * Test the start engine message. - */ -public class StartEngineTest { - - @Test - public void test() { - assertNotNull(new StartEngine(new AxArtifactKey())); - assertNotNull(new StartEngine(new AxArtifactKey(), "Start Engine Data")); - assertEquals("StartEngine {Message [action=START_ENGINE, " - + "targetKey=AxArtifactKey:(name=NULL,version=0.0.0), data=null]}[]", - new StartEngine(new AxArtifactKey()).toString()); - } -} diff --git a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/StartPeriodicEventsTest.java b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/StartPeriodicEventsTest.java deleted file mode 100644 index 2f3efc754..000000000 --- a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/StartPeriodicEventsTest.java +++ /dev/null @@ -1,42 +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.protocols.engdep.messages; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.junit.Test; -import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; - -/** - * Test the start engine message. - */ -public class StartPeriodicEventsTest { - - @Test - public void test() { - assertNotNull(new StartPeriodicEvents(new AxArtifactKey())); - assertNotNull(new StartPeriodicEvents(new AxArtifactKey(), "Start Periodic Events Data")); - assertEquals("StartPeriodicEvents {Message [action=START_PERIODIC_EVENTS, " - + "targetKey=AxArtifactKey:(name=NULL,version=0.0.0), data=null]}[]", - new StartPeriodicEvents(new AxArtifactKey()).toString()); - } -} diff --git a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/StopEngineTest.java b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/StopEngineTest.java deleted file mode 100644 index a9f8dcb29..000000000 --- a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/StopEngineTest.java +++ /dev/null @@ -1,42 +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.protocols.engdep.messages; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.junit.Test; -import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; - -/** - * Test the start engine message. - */ -public class StopEngineTest { - - @Test - public void test() { - assertNotNull(new StopEngine(new AxArtifactKey())); - assertNotNull(new StopEngine(new AxArtifactKey(), "Stop Engine Data")); - assertEquals("StopEngine {Message [action=STOP_ENGINE, " - + "targetKey=AxArtifactKey:(name=NULL,version=0.0.0), data=null]}[]", - new StopEngine(new AxArtifactKey()).toString()); - } -} diff --git a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/StopPeriodicEventsTest.java b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/StopPeriodicEventsTest.java deleted file mode 100644 index e174031ef..000000000 --- a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/StopPeriodicEventsTest.java +++ /dev/null @@ -1,42 +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.protocols.engdep.messages; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.junit.Test; -import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; - -/** - * Test the start engine message. - */ -public class StopPeriodicEventsTest { - - @Test - public void test() { - assertNotNull(new StopPeriodicEvents(new AxArtifactKey())); - assertNotNull(new StopPeriodicEvents(new AxArtifactKey(), "Stop Periodic Events Data")); - assertEquals("StopPeriodicEvents {Message [action=STOP_PERIODIC_EVENTS, " - + "targetKey=AxArtifactKey:(name=NULL,version=0.0.0), data=null]}[]", - new StopPeriodicEvents(new AxArtifactKey()).toString()); - } -} diff --git a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/UpdateModelTest.java b/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/UpdateModelTest.java deleted file mode 100644 index 85feda6d8..000000000 --- a/core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/engdep/messages/UpdateModelTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2020 Nordix Foundation. - * ================================================================================ - * 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.protocols.engdep.messages; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.net.UnknownHostException; -import org.junit.Test; -import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; -import org.slf4j.ext.XLogger; -import org.slf4j.ext.XLoggerFactory; - -/** - * The Class UpdateModelTest. - * - * @author Liam Fallon (liam.fallon@ericsson.com) - */ -public class UpdateModelTest { - // Logger for this class - private static final XLogger logger = XLoggerFactory.getXLogger(UpdateModelTest.class); - - UpdateModel message = null; - - /** - * Test register entity. - * - * @throws UnknownHostException the unknown host exception - */ - @Test - public void testRegisterEntity() throws UnknownHostException { - assertNotNull(new UpdateModel(new AxArtifactKey())); - final AxArtifactKey targetKey = new AxArtifactKey("UpdateModelTest", "0.0.1"); - message = new UpdateModel(targetKey, new String("Placeholder for Apex model XML"), false, false); - assertNotNull(message); - logger.debug(message.toString()); - assertTrue((message.toString()).contains("Placeholder for Apex model XML")); - assertFalse(message.isIgnoreConflicts()); - assertFalse(message.isForceInstall()); - - message = new UpdateModel(null, null, false, false); - assertNotEquals(0, message.hashCode()); - message = new UpdateModel(null, null, true, false); - assertNotEquals(0, message.hashCode()); - message = new UpdateModel(null, null, true, true); - assertNotEquals(0, message.hashCode()); - message = new UpdateModel(null, null, false, true); - assertNotEquals(0, message.hashCode()); - // disabling sonar because this code tests the equals() method - assertEquals(message, message); // NOSONAR - assertNotNull(message); - assertNotEquals(message, (Object) new StartEngine(new AxArtifactKey())); - - message = new UpdateModel(null, null, false, false); - UpdateModel otherMessage = new UpdateModel(null, null, false, false); - assertEquals(message, otherMessage); - message = new UpdateModel(null, null, true, false); - assertNotEquals(message, otherMessage); - otherMessage = new UpdateModel(null, null, true, false); - assertEquals(message, otherMessage); - message = new UpdateModel(null, null, false, true); - assertNotEquals(message, otherMessage); - otherMessage = new UpdateModel(null, null, false, true); - assertEquals(message, otherMessage); - } -} |