diff options
author | 2018-09-12 23:29:25 +0100 | |
---|---|---|
committer | 2018-09-12 23:54:51 +0100 | |
commit | 0e23f7634e1e1fb31454c516974613335fcea1a4 (patch) | |
tree | bedf0e52104e62599dd091eb6292de5dc7d57f49 /core/core-infrastructure/src/test | |
parent | 3ccc3d9ecd4bcd8960a2da6ecbdc7f3ac806fc67 (diff) |
Sonar/Checkstyle in model/context/core
Checkstyle and sonar changes in the model, contexot
and core modules.
Issue-ID: POLICY-1034
Change-Id: I2d40bc877f3a548844470fc290fc89d63fa465ae
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'core/core-infrastructure/src/test')
2 files changed, 50 insertions, 17 deletions
diff --git a/core/core-infrastructure/src/test/java/org/onap/policy/apex/core/infrastructure/messaging/EndToEndStringMessagingTest.java b/core/core-infrastructure/src/test/java/org/onap/policy/apex/core/infrastructure/messaging/EndToEndStringMessagingTest.java index 21c5ee984..c9d56ef2c 100644 --- a/core/core-infrastructure/src/test/java/org/onap/policy/apex/core/infrastructure/messaging/EndToEndStringMessagingTest.java +++ b/core/core-infrastructure/src/test/java/org/onap/policy/apex/core/infrastructure/messaging/EndToEndStringMessagingTest.java @@ -24,9 +24,9 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WSStringMessageClient; -import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WSStringMessageListener; -import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WSStringMessageServer; +import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WsStringMessageClient; +import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WsStringMessageListener; +import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WsStringMessageServer; import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; @@ -40,22 +40,22 @@ public class EndToEndStringMessagingTest { // Logger for this class private static final XLogger logger = XLoggerFactory.getXLogger(EndToEndStringMessagingTest.class); - private WSStringMessageServer server; - private WSStringMessageClient client; + private WsStringMessageServer server; + private WsStringMessageClient client; private boolean finished = false; @Test public void testEndToEndMessaging() throws MessagingException { logger.debug("end to end messaging test starting . . ."); - server = new WSStringMessageServer(44441); + server = new WsStringMessageServer(44441); assertNotNull(server); - server.start(new WSStringServerMessageListener()); + server.start(new WsStringServerMessageListener()); try { - client = new WSStringMessageClient("localhost", 44441); + client = new WsStringMessageClient("localhost", 44441); assertNotNull(client); - client.start(new WSStringClientMessageListener()); + client.start(new WsStringClientMessageListener()); client.sendString("Hello, client here"); @@ -74,7 +74,7 @@ public class EndToEndStringMessagingTest { logger.debug("end to end messaging test finished"); } - private class WSStringServerMessageListener implements WSStringMessageListener { + private class WsStringServerMessageListener implements WsStringMessageListener { @Override public void receiveString(final String stringMessage) { logger.debug(stringMessage); @@ -83,7 +83,7 @@ public class EndToEndStringMessagingTest { } } - private class WSStringClientMessageListener implements WSStringMessageListener { + private class WsStringClientMessageListener implements WsStringMessageListener { @Override public void receiveString(final String stringMessage) { logger.debug(stringMessage); diff --git a/core/core-infrastructure/src/test/java/org/onap/policy/apex/core/infrastructure/messaging/StringTestServer.java b/core/core-infrastructure/src/test/java/org/onap/policy/apex/core/infrastructure/messaging/StringTestServer.java index 09fa62d59..30590c0c0 100644 --- a/core/core-infrastructure/src/test/java/org/onap/policy/apex/core/infrastructure/messaging/StringTestServer.java +++ b/core/core-infrastructure/src/test/java/org/onap/policy/apex/core/infrastructure/messaging/StringTestServer.java @@ -22,18 +22,29 @@ package org.onap.policy.apex.core.infrastructure.messaging; import static org.junit.Assert.assertNotNull; -import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WSStringMessageListener; -import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WSStringMessageServer; +import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WsStringMessageListener; +import org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WsStringMessageServer; import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities; +// TODO: Auto-generated Javadoc +/** + * The Class StringTestServer. + */ public class StringTestServer { - private WSStringMessageServer server; + private WsStringMessageServer server; + /** + * Create a string test server. + * + * @param port port to use + * @param timeToLive time to live + * @throws MessagingException exceptions on messages + */ public StringTestServer(final int port, long timeToLive) throws MessagingException { System.out.println("StringTestServer starting on port " + port + " for " + timeToLive + " seconds . . ."); - server = new WSStringMessageServer(port); + server = new WsStringMessageServer(port); assertNotNull(server); - server.start(new WSStringServerMessageListener()); + server.start(new WsStringServerMessageListener()); System.out.println("StringTestServer started on port " + port + " for " + timeToLive + " seconds"); @@ -45,7 +56,23 @@ public class StringTestServer { System.out.println("StringTestServer completed"); } - private class WSStringServerMessageListener implements WSStringMessageListener { + /** + * The listener interface for receiving WSStringServerMessage events. The class that is interested in processing a + * WSStringServerMessage event implements this interface, and the object created with that class is registered with + * a component using the component's <code>addWSStringServerMessageListener</code> method. When the + * WSStringServerMessage event occurs, that object's appropriate method is invoked. + * + * @see WSStringServerMessageEvent + */ + private class WsStringServerMessageListener implements WsStringMessageListener { + + /* + * (non-Javadoc) + * + * @see + * org.onap.policy.apex.core.infrastructure.messaging.stringmessaging.WsStringMessageListener#receiveString(java + * .lang.String) + */ @Override public void receiveString(final String stringMessage) { System.out.println("Server received string \"" + stringMessage + "\""); @@ -53,6 +80,12 @@ public class StringTestServer { } } + /** + * The main method. + * + * @param args the arguments + * @throws MessagingException the messaging exception + */ public static void main(final String[] args) throws MessagingException { if (args.length != 2) { System.err.println("Usage: StringTestServer port timeToLive"); |