From: Robert Varga Date: Fri, 28 Nov 2014 15:03:49 +0000 (+0100) Subject: Remove trailing whitespace X-Git-Tag: release/lithium~73 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=openflowjava.git;a=commitdiff_plain;h=07de1ed897da9d7dc70c6d550f38c59339ed751e Remove trailing whitespace Trailing whitespace generates a lot of warnings -- mass-remove it. Change-Id: I9b73bc873685576daa80a998a58d1ce55e475c35 Signed-off-by: Robert Varga --- diff --git a/openflow-protocol-api/pom.xml b/openflow-protocol-api/pom.xml index 6b580791..894173aa 100644 --- a/openflow-protocol-api/pom.xml +++ b/openflow-protocol-api/pom.xml @@ -60,7 +60,7 @@ - org.eclipse.m2e diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ConnectionAdapter.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ConnectionAdapter.java index 50a85fbc..82b7a896 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ConnectionAdapter.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ConnectionAdapter.java @@ -27,12 +27,12 @@ public interface ConnectionAdapter extends OpenflowProtocolService { * @return future set to true, when disconnect completed */ Future disconnect(); - + /** * @return true, if connection to switch is alive */ boolean isAlive(); - + /** * @return address of the remote end - address of a switch if connected */ @@ -41,7 +41,7 @@ public interface ConnectionAdapter extends OpenflowProtocolService { * @param messageListener here will be pushed all messages from switch */ void setMessageListener(OpenflowProtocolListener messageListener); - + /** * @param systemListener here will be pushed all system messages from library */ @@ -58,7 +58,7 @@ public interface ConnectionAdapter extends OpenflowProtocolService { void fireConnectionReadyNotification(); /** - * set listener for connection became ready-to-use event + * set listener for connection became ready-to-use event * @param connectionReadyListener */ void setConnectionReadyListener(ConnectionReadyListener connectionReadyListener); diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ConnectionConfiguration.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ConnectionConfiguration.java index 243f2d93..cfb04293 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ConnectionConfiguration.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ConnectionConfiguration.java @@ -23,32 +23,32 @@ public interface ConnectionConfiguration { * @return address to bind, if null, all available interfaces will be used */ InetAddress getAddress(); - + /** * @return port to bind */ int getPort(); - + /** * @return transport protocol to use */ Object getTransferProtocol(); - + /** * @return TLS configuration object */ TlsConfiguration getTlsConfiguration(); - + /** - * @return silence time (in milliseconds) - after this time {@link SwitchIdleEvent} message is sent upstream + * @return silence time (in milliseconds) - after this time {@link SwitchIdleEvent} message is sent upstream */ long getSwitchIdleTimeout(); - + /** * @return seed for {@link SSLEngine} */ Object getSslContext(); - + /** * @return thread numbers for TcpHandler's eventloopGroups */ diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ListeningStatusProvider.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ListeningStatusProvider.java index 6de6675b..f54b7c2c 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ListeningStatusProvider.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/ListeningStatusProvider.java @@ -17,7 +17,7 @@ import java.util.concurrent.Future; public interface ListeningStatusProvider { /** - * @return future holding startup result of all library instances under plugin's control + * @return future holding startup result of all library instances under plugin's control */ Future isOnline(); diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/StatisticsConfiguration.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/StatisticsConfiguration.java index e5b25d40..daf87069 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/StatisticsConfiguration.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/StatisticsConfiguration.java @@ -10,7 +10,7 @@ package org.opendaylight.openflowjava.protocol.api.connection; /** * Used for StatisticsCounter configuration - * + * * @author madamjak */ public interface StatisticsConfiguration { diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/SwitchConnectionHandler.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/SwitchConnectionHandler.java index c5f26fc1..363e3245 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/SwitchConnectionHandler.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/SwitchConnectionHandler.java @@ -17,12 +17,12 @@ import java.net.InetAddress; * */ public interface SwitchConnectionHandler { - + /** * @param connection to switch proving message sending/receiving, connection management */ void onSwitchConnected(ConnectionAdapter connection); - + /** * @param switchAddress * @return true, if connection from switch having given address shell be accepted; false otherwise diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/TlsConfiguration.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/TlsConfiguration.java index 84eeab3e..6676dd02 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/TlsConfiguration.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/connection/TlsConfiguration.java @@ -22,17 +22,17 @@ public interface TlsConfiguration { * @return keystore location */ String getTlsKeystore(); - + /** * @return keystore type */ KeystoreType getTlsKeystoreType(); - + /** * @return truststore location */ String getTlsTruststore(); - + /** * @return truststore type */ diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerExtensionProvider.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerExtensionProvider.java index f8f3c1b3..516113b8 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerExtensionProvider.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerExtensionProvider.java @@ -25,7 +25,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 * instructions, match entries, ... ) which are differentiated by * vendor / experimenter subtype, vendor has to switch / choose between * these subtypes.
- * + * * This has to be done in this way because of experimenter headers, which * provide only vendor / experimenter ID. Subtype position may be different * for different vendors (or not present at all) - that's why vendor has to diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerRegistry.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerRegistry.java index 3b647a49..aa92ea08 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerRegistry.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerRegistry.java @@ -30,10 +30,10 @@ public interface DeserializerRegistry { * Registers deserializer. * Throws IllegalStateException when there is * a deserializer already registered under given key. - * + * * If the deserializer implements {@link DeserializerRegistryInjector} interface, * the deserializer is injected with DeserializerRegistry instance. - * + * * @param key used for deserializer lookup * @param deserializer deserializer instance */ diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKey.java index c0f17c6a..1f987218 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKey.java @@ -35,7 +35,7 @@ public class EnhancedMessageTypeKey extends MessageTypeKey { result = prime * result + ((msgType2 == null) ? 0 : msgType2.hashCode()); return result; } - + @Override public boolean equals(Object obj) { if (this == obj) { diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/HeaderDeserializer.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/HeaderDeserializer.java index 855b2f69..1d105f39 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/HeaderDeserializer.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/HeaderDeserializer.java @@ -13,13 +13,13 @@ import org.opendaylight.yangtools.yang.binding.DataObject; /** * @author michal.polkorab - * @param + * @param */ public interface HeaderDeserializer extends OFGeneralDeserializer { /** * Deserializes byte message headers - * + * * @param rawMessage message as bytes in ByteBuf * @return POJO/DTO */ diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKey.java index 2e1d0189..bf45cd10 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKey.java @@ -19,7 +19,7 @@ public class MessageTypeKey { private final Class msgType; private final short msgVersion; - + /** * @param msgVersion protocol version * @param msgType type of message - class of serialized object @@ -28,7 +28,7 @@ public class MessageTypeKey { this.msgType = msgType; this.msgVersion = msgVersion; } - + @Override public String toString() { return "msgVersion: " + msgVersion + " objectType: " + msgType.getName(); diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFDeserializer.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFDeserializer.java index 25a04ac3..a49d84c3 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFDeserializer.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFDeserializer.java @@ -22,7 +22,7 @@ public interface OFDeserializer extends OFGeneralDeseriali /** * Transforms byte message into POJO/DTO (of type E). - * + * * @param message message as bytes in ByteBuf * @return POJO/DTO */ diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerExtensionProvider.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerExtensionProvider.java index b5bb0c2c..f4325cff 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerExtensionProvider.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerExtensionProvider.java @@ -27,7 +27,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 * instructions, match entries, ... ) which are differentiated by * vendor / experimenter subtype, vendor has to switch / choose between * these subtypes.
- * + * * This has to be done in this way because of unknown augmentations * - that's why vendor has to handle it in his own implementations. * @author michal.polkorab diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerRegistry.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerRegistry.java index 30141911..eaa52c3d 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerRegistry.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerRegistry.java @@ -11,7 +11,7 @@ package org.opendaylight.openflowjava.protocol.api.extensibility; /** - * Stores and handles serializers + * Stores and handles serializers * @author michal.polkorab * */ @@ -26,17 +26,17 @@ public interface SerializerRegistry { * @param msgTypeKey lookup key * @return serializer or NullPointerException if no serializer was found */ - SERIALIZERTYPE + SERIALIZERTYPE getSerializer(MessageTypeKey msgTypeKey); /** * Registers serializer * Throws IllegalStateException when there is * a serializer already registered under given key. - * + * * If the serializer implements {@link SerializerRegistryInjector} interface, * the serializer is injected with SerializerRegistry instance. - * + * * @param key used for serializer lookup * @param serializer serializer implementation */ diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKey.java index f7ebcb3c..cb08cd92 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKey.java @@ -21,7 +21,7 @@ public class InstructionDeserializerKey extends MessageCodeKey { /** * @param version protocol wire version * @param type instruction type - * @param experimenterId + * @param experimenterId */ public InstructionDeserializerKey(short version, int type, Long experimenterId) { diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionDeserializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionDeserializerKey.java index 3b599b43..cbb23632 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionDeserializerKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionDeserializerKey.java @@ -15,7 +15,7 @@ import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants; * @author michal.polkorab * */ -public final class ExperimenterActionDeserializerKey extends ActionDeserializerKey +public final class ExperimenterActionDeserializerKey extends ActionDeserializerKey implements ExperimenterDeserializerKey { /** diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionSerializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionSerializerKey.java index e5c9c806..eef5f106 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionSerializerKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionSerializerKey.java @@ -15,7 +15,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1 /** * @author michal.polkorab */ -public final class ExperimenterActionSerializerKey extends ActionSerializerKey +public final class ExperimenterActionSerializerKey extends ActionSerializerKey implements ExperimenterSerializerKey { private Class actionSubType; diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdDeserializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdDeserializerKey.java index cb00362e..cafde379 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdDeserializerKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdDeserializerKey.java @@ -16,7 +16,7 @@ import org.opendaylight.yangtools.yang.binding.DataObject; * @author michal.polkorab * */ -public final class ExperimenterIdDeserializerKey extends MessageCodeKey +public final class ExperimenterIdDeserializerKey extends MessageCodeKey implements ExperimenterDeserializerKey { private Long experimenterId; @@ -32,7 +32,7 @@ public final class ExperimenterIdDeserializerKey extends MessageCodeKey this.experimenterId = experimenterId; } - + @Override public int hashCode() { final int prime = 31; diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterInstructionDeserializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterInstructionDeserializerKey.java index b15a1173..5abe45ee 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterInstructionDeserializerKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterInstructionDeserializerKey.java @@ -20,7 +20,7 @@ public final class ExperimenterInstructionDeserializerKey extends InstructionDes /** * @param version protocol wire version - * @param experimenterId + * @param experimenterId */ public ExperimenterInstructionDeserializerKey(short version, Long experimenterId) { super(version, EncodeConstants.EXPERIMENTER_VALUE, experimenterId); diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/BinContent.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/BinContent.java index 171a684d..aa322f91 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/BinContent.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/BinContent.java @@ -21,7 +21,7 @@ public abstract class BinContent { public static long intToUnsignedLong(int value) { return value & 0x00000000ffffffffL; } - + /** * @param value * @return long cut into int diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/EncodeConstants.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/EncodeConstants.java index bbd881e2..cf857285 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/EncodeConstants.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/EncodeConstants.java @@ -26,7 +26,7 @@ public abstract class EncodeConstants { public static final int OFHEADER_SIZE = 8; /** Zero length - used when the length is updated later */ public static final int EMPTY_LENGTH = 0; - + /** Length of mac address */ public static final byte MAC_ADDRESS_LENGTH = 6; /** Number of groups in ipv4 address */ diff --git a/openflow-protocol-api/src/main/yang/openflow-action.yang b/openflow-protocol-api/src/main/yang/openflow-action.yang index 482c1228..0f579fa0 100644 --- a/openflow-protocol-api/src/main/yang/openflow-action.yang +++ b/openflow-protocol-api/src/main/yang/openflow-action.yang @@ -5,7 +5,7 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - + module openflow-action { namespace "urn:opendaylight:openflow:common:action"; prefix "ofaction"; @@ -92,7 +92,7 @@ container actions-container { uses actions-grouping; } - + grouping actions-grouping { list action { config false; @@ -103,7 +103,7 @@ } } } - + // OF1.0 structures identity set_vlan_vid { description "Set the 802.1q VLAN id (OF v1.0)."; diff --git a/openflow-protocol-api/src/main/yang/openflow-augments.yang b/openflow-protocol-api/src/main/yang/openflow-augments.yang index 9a545416..229d5f5a 100644 --- a/openflow-protocol-api/src/main/yang/openflow-augments.yang +++ b/openflow-protocol-api/src/main/yang/openflow-augments.yang @@ -5,11 +5,11 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - + module openflow-augments { namespace "urn:opendaylight:openflow:augments"; prefix "aug"; - + import yang-ext {prefix ext;} import ietf-inet-types {prefix inet;} import ietf-yang-types {prefix yang;} @@ -21,8 +21,8 @@ import openflow-extensible-match {prefix oxm;} revision "2013-10-02" { - description "OpenFlow 1.3 - augments model. - Please visit + description "OpenFlow 1.3 - augments model. + Please visit https://wiki.opendaylight.org/view/File:OpenFlow_Protocol_Library_-_Project_documentation.pdf - Augmentation Tables chapter"; } @@ -354,7 +354,7 @@ type oft:experimenter-id; } } - + // OFP_QUEUE_PROP AUGMENTS augment "/ofproto:queue-prop-container/ofproto:queue-property" { ext:augment-identifier "rate-queue-property"; @@ -368,7 +368,7 @@ type oft:experimenter-id; } } - + // OFP_ERROR_AUGMENTS (only experimenter till OpenFlow v1.3) augment "/ofproto:error-message" { ext:augment-identifier "experimenter-id-error"; diff --git a/openflow-protocol-api/src/main/yang/openflow-configuration.yang b/openflow-protocol-api/src/main/yang/openflow-configuration.yang index 38d8d58b..790a151b 100644 --- a/openflow-protocol-api/src/main/yang/openflow-configuration.yang +++ b/openflow-protocol-api/src/main/yang/openflow-configuration.yang @@ -5,7 +5,7 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - + module openflow-configuration { namespace "urn:opendaylight:openflow:config"; prefix "of-config"; @@ -17,11 +17,11 @@ typedef path-type { type enumeration { enum CLASSPATH { - value 0; + value 0; description "Keystore file is located on classpath."; } enum PATH { - value 1; + value 1; description "Keystore file is located on absolute or relative path."; } } @@ -30,11 +30,11 @@ typedef keystore-type { type enumeration { enum JKS { - value 0; + value 0; description "Keystore type - JKS."; } enum PKCS12 { - value 1; + value 1; description "Keystore type - PKCS12."; } } diff --git a/openflow-protocol-api/src/main/yang/openflow-extensible-match.yang b/openflow-protocol-api/src/main/yang/openflow-extensible-match.yang index e265eb09..e1f5514f 100644 --- a/openflow-protocol-api/src/main/yang/openflow-extensible-match.yang +++ b/openflow-protocol-api/src/main/yang/openflow-extensible-match.yang @@ -5,7 +5,7 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - + module openflow-extensible-match { namespace "urn:opendaylight:openflow:oxm"; prefix "oxm"; @@ -19,12 +19,12 @@ } identity oxm-match-type { - description + description "The OpenFlow Extensible Match type must be supported by all OpenFlow switches."; base oft:match-type-base; } - + // oxm classes identity oxm-class-base { description "Base identity for OXM classes"; @@ -43,7 +43,7 @@ base oxm-class-base; } identity experimenter-class { - description + description "Marks Experimenter match type class. All experimenter match classes MUST use this class as a base."; base oxm-class-base; @@ -229,7 +229,7 @@ container oxm-container { uses oxm-fields-grouping; } - + grouping oxm-fields-grouping { list match-entries { description "OXM TLV-structures (Type Length Value)"; @@ -246,7 +246,7 @@ } leaf has-mask { type boolean; - } + } } } @@ -330,5 +330,5 @@ } } } - + } \ No newline at end of file diff --git a/openflow-protocol-api/src/main/yang/openflow-instruction.yang b/openflow-protocol-api/src/main/yang/openflow-instruction.yang index 80f74a83..671556e1 100644 --- a/openflow-protocol-api/src/main/yang/openflow-instruction.yang +++ b/openflow-protocol-api/src/main/yang/openflow-instruction.yang @@ -5,7 +5,7 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - + module openflow-instruction { namespace "urn:opendaylight:openflow:common:instruction"; prefix "ofinstruction"; diff --git a/openflow-protocol-api/src/main/yang/openflow-protocol.yang b/openflow-protocol-api/src/main/yang/openflow-protocol.yang index 9330fac6..34f21818 100644 --- a/openflow-protocol-api/src/main/yang/openflow-protocol.yang +++ b/openflow-protocol-api/src/main/yang/openflow-protocol.yang @@ -5,13 +5,13 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - + module openflow-protocol { namespace "urn:opendaylight:openflow:protocol"; prefix "ofproto"; import ietf-yang-types {prefix yang;} - + import openflow-types {prefix oft;} import openflow-extensible-match { prefix oxm;} import openflow-instruction { prefix ofinstruction;} @@ -55,7 +55,7 @@ } leaf peer-features { description "Features advertised by peer."; - type oft:port-features; + type oft:port-features; } leaf curr-speed { description "Current port bitrate in kbps."; @@ -72,7 +72,7 @@ leaf config-v10 { type oft:port-config-v10; } - leaf state-v10 { + leaf state-v10 { type oft:port-state-v10; } leaf current-features-v10 { @@ -87,9 +87,9 @@ description "Features supported by the port."; type oft:port-features-v10; } - leaf peer-features-v10 { + leaf peer-features-v10 { description "Features advertised by peer."; - type oft:port-features-v10; + type oft:port-features-v10; } } @@ -121,7 +121,7 @@ uses ofaction:actions-grouping; } - + container table-features-properties-container { uses table-features-properties-grouping; } @@ -159,10 +159,10 @@ reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"; /* Symmetric message */ uses ofHeader; - + list elements { uses ofHelloElementHeader; - + leaf-list version-bitmap { type boolean; } @@ -172,7 +172,7 @@ reference "OFPT_ERROR message in Openflow Switch 1.3 Spec"; /* Symmetric message */ uses ofHeader; - + leaf type { type uint16; } @@ -186,14 +186,14 @@ type string; } leaf data { - type binary; + type binary; } } grouping echo-request { reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"; /* Symmetric message */ uses ofHeader; - + leaf data { type binary; } @@ -202,7 +202,7 @@ reference "OFPT_ECHO_REPLY message in Openflow Switch 1.3 Spec"; /* Symmetric message */ uses ofHeader; - + leaf data { type binary; } @@ -211,7 +211,7 @@ reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"; /* Symmetric message */ uses ofHeader; - + leaf experimenter { type oft:experimenter-id; } @@ -229,7 +229,7 @@ reference "OFPT_FEATURES_REPLY message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; - + leaf datapathId { type uint64; } @@ -268,7 +268,7 @@ reference "OFPT_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; - + leaf flags { type oft:switch-config-flag; } @@ -279,9 +279,9 @@ grouping set-config { reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ - + uses ofHeader; - + leaf flags { type oft:switch-config-flag; } @@ -293,9 +293,9 @@ grouping packet-in { reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec"; /* Async message */ - + uses ofHeader; - + leaf buffer-id { // ID assigned by datapath. type uint32; @@ -305,7 +305,7 @@ type uint16; } leaf reason { - // Reason packet is being sent (one of OFPR_*) + // Reason packet is being sent (one of OFPR_*) type oft:packet-in-reason; } leaf table-id { @@ -321,7 +321,7 @@ leaf data { type binary; } - + // OF1.0 structures leaf in-port { type uint16; @@ -331,7 +331,7 @@ reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec"; /* Async message */ uses ofHeader; - + leaf cookie { type uint64; } @@ -363,17 +363,17 @@ type uint64; } uses oxm:match-grouping; - + // OF1.0 structures uses oxm:match-v10-grouping; - } + } grouping port-status { reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec"; - + uses ofHeader; - + uses port-grouping; - + leaf reason { type oft:port-reason; } @@ -382,11 +382,11 @@ grouping packet-out { reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ - + uses ofHeader; - + uses ofaction:actions-grouping; - + leaf data { type binary; } @@ -396,13 +396,13 @@ leaf in-port { type oft:port-number; } - } + } grouping flow-mod { reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ - + uses ofHeader; - + leaf cookie { type uint64; } @@ -437,22 +437,22 @@ type oft:flow-mod-flags; } uses oxm:match-grouping; - + uses ofinstruction:instructions-grouping; - + // OF1.0 structures leaf flags-v10 { type oft:flow-mod-flags-v10; } uses oxm:match-v10-grouping; uses ofaction:actions-grouping; - } + } grouping group-mod { reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ - + uses ofHeader; - + leaf command { type oft:group-mod-command; } @@ -462,25 +462,25 @@ leaf group-id { type oft:group-id; } - + uses buckets-grouping; } - + grouping port-mod { reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; - + leaf port-no { type oft:port-number; } leaf hw-address { type yang:mac-address; - } + } leaf config { type oft:port-config; - } + } leaf mask { type oft:port-config; } @@ -497,28 +497,28 @@ leaf advertise-v10 { type oft:port-features-v10; } - } + } grouping table-mod { reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; - + leaf table-id { type oft:table-id; } leaf config { type oft:table-config; } - } - + } + /* Multipart messages. */ grouping multipart-request { reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; - + leaf type { type oft:multipart-type; } @@ -551,7 +551,7 @@ type uint64; } uses oxm:match-grouping; - + // OF1.0 structures uses oxm:match-v10-grouping; } @@ -574,7 +574,7 @@ type uint64; } uses oxm:match-grouping; - + // OF1.0 structures uses oxm:match-v10-grouping; } @@ -683,13 +683,13 @@ } } } - } + } grouping multipart-reply { reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; - + leaf type { type oft:multipart-type; } @@ -750,9 +750,9 @@ type uint64; } uses oxm:match-grouping; - + uses ofinstruction:instructions-grouping; - + // OF1.0 structures uses oxm:match-v10-grouping; uses ofaction:actions-grouping; @@ -787,7 +787,7 @@ leaf matched-count { type uint64; } - + // OF1.0 structures leaf name { type string; @@ -1029,7 +1029,7 @@ } leaf config { type oft:table-config; - } + } leaf max-entries { type uint32; } @@ -1050,35 +1050,35 @@ } } } - } + } /* Barrier messages. */ grouping barrier-request { reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; - } + } grouping barrier-reply { reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; - } + } /* Queue Configuration messages. */ grouping queue-get-config-request { reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ - + uses ofHeader; - + leaf port { type oft:port-number; } - } + } grouping queue-get-config-reply { reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; - + leaf port { type oft:port-number; } @@ -1110,51 +1110,51 @@ grouping role-request { reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ - + uses ofHeader; - + leaf role { type oft:controller-role; } leaf generation-id { type uint64; } - } + } grouping role-reply { reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; - + leaf role { type oft:controller-role; } leaf generation-id { type uint64; } - } + } /* Asynchronous message configuration. */ grouping get-async-request { reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; - } + } grouping get-async-reply { reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ uses ofHeader; uses async-body-grouping; - } + } grouping set-async { reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"; /* Controller/switch message */ - + uses ofHeader; uses async-body-grouping; } - + grouping async-body-grouping { list packet-in-mask { leaf-list mask { @@ -1178,10 +1178,10 @@ /* Controller/switch message */ uses ofHeader; - + leaf command { type oft:meter-mod-command; - } + } leaf flags { type oft:meter-flags; } @@ -1192,7 +1192,7 @@ uses meter-band-header; } } - + container meter-band-container { uses meter-band-header; } @@ -1218,7 +1218,7 @@ } } } - + grouping meter-band-commons { leaf type { type oft:meter-band-type; @@ -1235,19 +1235,19 @@ notification hello-message { uses hello; reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"; - + /* Symmetric message */ } notification error-message { uses error; reference "OFPT_ERROR message in Openflow Switch 1.3 Spec"; - + /* Symmetric message */ } notification echo-request-message { uses echo-request; reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"; - + /* Symmetric message */ } notification experimenter-message { @@ -1267,19 +1267,19 @@ uses echo-reply; } } - + rpc echo-reply { input { uses echo-reply; } } - + rpc hello { input { uses hello; } } - + rpc experimenter { input { uses experimenter; @@ -1296,7 +1296,7 @@ uses features-reply; } } - + rpc get-config { input { uses get-config-request; @@ -1306,27 +1306,27 @@ } /* Controller/switch message */ } - + rpc set-config { input { uses set-config; - } + } /* Controller/switch message */ } /* Asynchronous messages. */ notification packet-in-message { uses packet-in; - + /* Async message */ } notification flow-removed-message { uses flow-removed; - + /* Async message */ - } + } notification port-status-message { uses port-status; - + } /* Async message */ /* Controller command messages. */ @@ -1335,25 +1335,25 @@ uses packet-out; } /* Controller/switch message */ - } + } rpc flow-mod { input { uses flow-mod; } /* Controller/switch message */ - } + } rpc group-mod { input { uses group-mod; } /* Controller/switch message */ - } + } rpc port-mod { input { uses port-mod; } } /* Controller/switch message */ - + rpc table-mod { input { uses table-mod; @@ -1373,7 +1373,7 @@ uses multipart-reply; // notification because of multiple following responses } /* Controller/switch message */ - + /* Barrier messages. */ rpc barrier { @@ -1392,7 +1392,7 @@ output { uses queue-get-config-reply; } - } + } /* Controller role change request messages. */ rpc role-request { @@ -1403,7 +1403,7 @@ uses role-reply; } } /* Controller/switch message */ - + /* Asynchronous message configuration. */ rpc get-async { input { @@ -1412,14 +1412,14 @@ output { uses get-async-reply; } - } + } /* Controller/switch message */ rpc set-async { - input { + input { uses set-async; } - - } + + } /* Meters and rate limiters configuration messages. */ rpc meter-mod { input { diff --git a/openflow-protocol-api/src/main/yang/openflow-types.yang b/openflow-protocol-api/src/main/yang/openflow-types.yang index 1a024089..be0e9f5d 100644 --- a/openflow-protocol-api/src/main/yang/openflow-types.yang +++ b/openflow-protocol-api/src/main/yang/openflow-types.yang @@ -5,7 +5,7 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - + module openflow-types { namespace "urn:opendaylight:openflow:common:types"; prefix "oft"; @@ -19,7 +19,7 @@ supports special / reserved values (in OF v1.3)"; type uint32; } - + typedef port-number-values { description "Reserved OpenFlow Port (fake output \"ports\") (OF v1.3)."; type enumeration { @@ -38,20 +38,20 @@ description "Submit the packet to the first flow table NB: This destination port can only be used in packet-out messages."; - value -7; // 0xfffffff9 + value -7; // 0xfffffff9 } enum NORMAL { description "Process with normal L2/L3 switching."; - value -6; // 0xfffffffa + value -6; // 0xfffffffa } enum FLOOD { description "All physical ports in VLAN, except input port and those blocked or link down."; - value -5; // 0xfffffffb + value -5; // 0xfffffffb } enum ALL { description "All physical ports except input port."; - value -4; // 0xfffffffc + value -4; // 0xfffffffc } enum CONTROLLER { description "Send to controller."; @@ -63,7 +63,7 @@ } enum ANY { description "Wildcard port used only for flow mod - (delete) and flow stats requests. Selects + (delete) and flow stats requests. Selects all flows regardless of output port (including flows with no output port)."; value -1; // 0xffffffff @@ -74,67 +74,67 @@ typedef port-features { description "Features of ports available in datapath."; type bits { - bit _10mb_hd { + bit _10mb_hd { position 0; description "10 Mb half-duplex rate support."; } - bit _10mb-fd { + bit _10mb-fd { position 1; description "10 Mb full-duplex rate support."; } - bit _100mb-hd { + bit _100mb-hd { position 2; description "100 Mb half-duplex rate support."; } - bit _100mb-fd { + bit _100mb-fd { position 3; description "100 Mb full-duplex rate support."; } - bit _1gb-hd { + bit _1gb-hd { position 4; description "1 Gb half-duplex rate support."; } - bit _1gb-fd { + bit _1gb-fd { position 5; description "1 Gb full-duplex rate support."; } - bit _10gb-fd { + bit _10gb-fd { position 6; description "10 Gb full-duplex rate support."; } - bit _40gb-fd { + bit _40gb-fd { position 7; description "40 Gb full-duplex rate support."; } - bit _100gb-fd { + bit _100gb-fd { position 8; description "100 Gb full-duplex rate support."; } - bit _1tb-fd { + bit _1tb-fd { position 9; description "1 Tb full-duplex rate support."; } - bit other { + bit other { position 10; description "Other rate, not in the list."; } - bit copper { + bit copper { position 11; description "Copper medium."; } - bit fiber { + bit fiber { position 12; description "Fiber medium."; } - bit autoneg { + bit autoneg { position 13; description "Auto-negotiation."; } - bit pause { + bit pause { position 14; description "Pause."; } - bit pause-asym { + bit pause-asym { position 15; description "Asymmetric pause."; } @@ -142,24 +142,24 @@ } typedef port-config { - description + description "Flags to indicate behavior of the physical port. These flags are - describe the current configuration and used port_mod message + describe the current configuration and used port_mod message to configure the port's behavior."; type bits { - bit port-down { + bit port-down { //description " Port is administratively down."; position 0; } - bit no-recv { + bit no-recv { //description " Drop all packets received by port."; position 2; } - bit no-fwd { + bit no-fwd { //description " Drop packets forwarded to port."; position 5; } - bit no-packet-in { + bit no-packet-in { //description "Do not send packet-in msgs for port."; position 6; } @@ -167,7 +167,7 @@ } typedef port-state { - description + description "Current state of the physical port. These are not configurable from the controller."; type bits { @@ -187,10 +187,10 @@ } identity match-type-base { - description + description "The match type indicates the match structure (set of fields that compose the match) in use. The match type is placed in the type field at the beginning - of all match structures.Extensions that define match types may be + of all match structures.Extensions that define match types may be published on the ONF wiki. Support for extensions is optional."; } @@ -236,363 +236,363 @@ typedef error-type { type enumeration { enum HELLO_FAILED { - value 0; + value 0; description "Hello Protocol failed."; } enum BAD_REQUEST { - value 1; + value 1; description "Request was not understood."; } enum BAD_ACTION { - value 2; + value 2; description "Error in action description."; } enum BAD_INSTRUCTION { - value 3; + value 3; description "Error in instruction list."; } enum BAD_MATCH { - value 4; + value 4; description "Error in match."; } enum FLOW_MOD_FAILED { - value 5; + value 5; description "Problem modifying flow entry."; } enum GROUP_MOD_FAILED { - value 6; + value 6; description "Problem modifying group entry."; } enum PORT_MOD_FAILED { - value 7; + value 7; description "Port mod request failed."; } enum TABLE_MOD_FAILED { - value 8; + value 8; description "Table mod request failed."; } enum QUEUE_OP_FAILED { - value 9; + value 9; description "Queue operation failed."; } enum SWITCH_CONFIG_FAILED { - value 10; + value 10; description "Switch config request failed."; } enum ROLE_REQUEST_FAILED { - value 11; + value 11; description "Controller Role request failed."; } enum METER_MOD_FAILED { - value 12; + value 12; description "Error in meter."; } enum TABLE_FEATURES_FAILED { - value 13; + value 13; description "Setting table features failed."; } enum EXPERIMENTER { - value 65535; //0xffff + value 65535; //0xffff description "Experimenter error messages."; } } } - + typedef hello-failed-code { type enumeration { enum INCOMPATIBLE { - value 0; + value 0; description "Hello Protocol failed."; } enum EPERM { - value 1; + value 1; description "Request was not understood."; } } } - + typedef bad-request-code { type enumeration { enum BAD_VERSION { - value 0; + value 0; } enum BAD_TYPE { - value 1; + value 1; } enum BAD_MULTIPART { - value 2; + value 2; } enum BAD_EXPERIMENTER { - value 3; + value 3; } enum BAD_EXP_TYPE { - value 4; + value 4; } enum EPERM { - value 5; + value 5; } enum BAD_LEN { - value 6; + value 6; } enum BUFFER_EMPTY { - value 7; + value 7; } enum BUFFER_UNKNOWN { - value 8; + value 8; } enum BAD_TABLE_ID { - value 9; + value 9; } enum IS_SLAVE { - value 10; + value 10; } enum BAD_PORT { - value 11; + value 11; } enum BAD_PACKET { - value 12; + value 12; } enum MULTIPART_BUFFER_OVERFLOW { - value 13; + value 13; } } } - + typedef bad-action-code { type enumeration { enum BAD_TYPE { - value 0; + value 0; } enum BAD_LEN { - value 1; + value 1; } enum BAD_EXPERIMENTER { - value 2; + value 2; } enum BAD_EXP_TYPE { - value 3; + value 3; } enum BAD_OUT_PORT { - value 4; + value 4; } enum BAD_ARGUMENT { - value 5; + value 5; } enum EPERM { - value 6; + value 6; } enum TOO_MANY { - value 7; + value 7; } enum BAD_QUEUE { - value 8; + value 8; } enum BAD_OUT_GROUP { - value 9; + value 9; } enum MATCH_INCONSISTENT { - value 10; + value 10; } enum UNSUPPORTED_ORDER { - value 11; + value 11; } enum BAD_TAG { - value 12; + value 12; } enum BAD_SET_TYPE { - value 13; + value 13; } enum BAD_SET_LEN { - value 14; + value 14; } enum BAD_SET_ARGUMENT { - value 15; + value 15; } } } - + typedef bad-instruction-code { type enumeration { enum UNKNOWN_INST { - value 0; + value 0; } enum UNSUP_INST { - value 1; + value 1; } enum BAD_TABLE_ID { - value 2; + value 2; } enum UNSUP_METADATA { - value 3; + value 3; } enum UNSUP_METADATA_MASK { - value 4; + value 4; } enum BAD_EXPERIMENTER { - value 5; + value 5; } enum BAD_EXP_TYPE { - value 6; + value 6; } enum BAD_LEN { - value 7; + value 7; } enum EPERM { - value 8; + value 8; } } } - + typedef bad-match-code { type enumeration { enum BAD_TYPE { - value 0; + value 0; } enum BAD_LEN { - value 1; + value 1; } enum BAD_TAG { - value 2; + value 2; } enum BAD_DL_ADDR_MASK { - value 3; + value 3; } enum BAD_NW_ADDR_MASK { - value 4; + value 4; } enum BAD_WILDCARDS { - value 5; + value 5; } enum BAD_FIELD { - value 6; + value 6; } enum BAD_VALUE { - value 7; + value 7; } enum BAD_MASK { - value 8; + value 8; } enum BAD_PREREQ { - value 9; + value 9; } enum DUP_FIELD { - value 10; + value 10; } enum EPERM { - value 11; + value 11; } } } - + typedef flow-mod-failed-code { type enumeration { enum UNKNOWN { - value 0; + value 0; } enum TABLE_FULL { - value 1; + value 1; } enum BAD_TABLE_ID { - value 2; + value 2; } enum OVERLAP { - value 3; + value 3; } enum EPERM { - value 4; + value 4; } enum BAD_TIMEOUT { - value 5; + value 5; } enum BAD_COMMAND { - value 6; + value 6; } enum BAD_FLAGS { - value 7; + value 7; } } } - + typedef group-mod-failed-code { type enumeration { enum GROUP_EXISTS { - value 0; + value 0; } enum INVALID_GROUP { - value 1; + value 1; } enum WEIGHT_UNSUPPORTED { - value 2; + value 2; } enum OUT_OF_GROUPS { - value 3; + value 3; } enum OUT_OF_BUCKETS { - value 4; + value 4; } enum CHAINING_UNSUPPORTED { - value 5; + value 5; } enum WATCH_UNSUPPORTED { - value 6; + value 6; } enum LOOP { - value 7; + value 7; } enum UNKNOWN_GROUP { - value 8; + value 8; } enum CHAINED_GROUP { - value 9; + value 9; } enum BAD_TYPE { - value 10; + value 10; } enum BAD_COMMAND { - value 11; + value 11; } enum BAD_BUCKET { - value 12; + value 12; } enum BAD_WATCH { - value 13; + value 13; } enum EPERM { - value 14; + value 14; } } } - + typedef port-mod-failed-code { type enumeration { enum BAD_PORT { - value 0; + value 0; } enum BAD_HW_ADDR { - value 1; + value 1; } enum BAD_CONFIG { - value 2; + value 2; } enum BAD_ADVERTISE { - value 3; + value 3; } enum EPERM { - value 4; + value 4; } } } - + typedef table-mod-failed-code { type enumeration { enum BAD_TABLE { - value 0; + value 0; } enum BAD_CONFIG { - value 1; + value 1; } enum EPERM { - value 2; + value 2; } } } @@ -600,125 +600,125 @@ typedef queue-op-failed-code { type enumeration { enum BAD_PORT { - value 0; + value 0; } enum BAD_QUEUE { - value 1; + value 1; } enum EPERM { - value 2; + value 2; } } } - + typedef switch-config-failed-code { type enumeration { enum BAD_FLAGS { - value 0; + value 0; } enum BAD_LEN { - value 1; + value 1; } enum EPERM { - value 2; + value 2; } } } - + typedef role-request-failed-code { type enumeration { enum STALE { - value 0; + value 0; } enum UNSUP { - value 1; + value 1; } enum BAD_ROLE { - value 2; + value 2; } } } - + typedef meter-mod-failed-code { type enumeration { enum UNKNOWN { - value 0; + value 0; } enum METER_EXISTS { - value 1; + value 1; } enum INVALID_METER { - value 2; + value 2; } enum UNKNOWN_METER { - value 3; + value 3; } enum BAD_COMMAND { - value 4; + value 4; } enum BAD_FLAGS { - value 5; + value 5; } enum BAD_RATE { - value 6; + value 6; } enum BAD_BURST { - value 7; + value 7; } enum BAD_BAND { - value 8; + value 8; } enum BAD_BAND_VALUE { - value 9; + value 9; } enum OUT_OF_METERS { - value 10; + value 10; } enum OUT_OF_BANDS { - value 11; + value 11; } } } - + typedef table-features-failed-code { type enumeration { enum BAD_TABLE { - value 0; + value 0; } enum BAD_METADATA { - value 1; + value 1; } enum BAD_TYPE { - value 2; + value 2; } enum BAD_LEN { - value 3; + value 3; } enum BAD_ARGUMENT { - value 4; + value 4; } enum EPERM { - value 5; + value 5; } } } - + typedef hello-element-type { type enumeration { enum VERSIONBITMAP { - value 1; + value 1; description "Bitmap of version supported."; } } } - + typedef capabilities { description "Capabilities supported by the datapath."; type bits { bit OFPC_FLOW_STATS { position 0; /* Flow statistics. */ - } + } bit OFPC_TABLE_STATS { position 1; /* Table statistics. */ @@ -750,19 +750,19 @@ description " Handling of IP fragments. "; type enumeration { enum FRAG_NORMAL { - value 0; + value 0; description "No special handling for fragments."; } enum OFPC_FRAG_DROP { - value 1; + value 1; description "Drop fragments."; } enum OFPC_FRAG_REASM { - value 2; + value 2; description "Reassemble (only if OFPC_IP_REASM set)."; } enum OFPC_FRAG_MASK { - value 3; + value 3; } } } @@ -908,7 +908,7 @@ } enum OFPTT_ALL { value 255; // 0xff - description "Wildcard table used for table config, + description "Wildcard table used for table config, flow stats and flow deletes."; } } @@ -928,7 +928,7 @@ } enum OFPG_ANY { value -1; //0xffffffff - description "Wildcard group used only for flow stats requests. + description "Wildcard group used only for flow stats requests. Selects all flows regardless of group (including flows with no group)"; } } @@ -1059,7 +1059,7 @@ description "Maximum datarate."; } enum OFPQT_EXPERIMENTER { - value 65535; // 0xffff + value 65535; // 0xffff description "Experimenter defined property."; } } @@ -1104,7 +1104,7 @@ } } } - + typedef action-type { /* ofp_action_type */ type bits { @@ -1232,7 +1232,7 @@ } } } - + typedef meter-band-type-bitmap { /* ofp_meter_band_type */ type bits { @@ -1283,67 +1283,67 @@ typedef table-features-prop-type { type enumeration { enum OFPTFPT_INSTRUCTIONS { - value 0; + value 0; description "Instructions property."; } enum OFPTFPT_INSTRUCTIONS_MISS { - value 1; + value 1; description "Instructions for table-miss."; } enum OFPTFPT_NEXT_TABLES { - value 2; + value 2; description "Next Table property."; } enum OFPTFPT_NEXT_TABLES_MISS { - value 3; + value 3; description "Next Table for table-miss."; } enum OFPTFPT_WRITE_ACTIONS { - value 4; + value 4; description "Write Actions property."; } enum OFPTFPT_WRITE_ACTIONS_MISS { - value 5; + value 5; description "Write Actions for table-miss."; } enum OFPTFPT_APPLY_ACTIONS { - value 6; + value 6; description "Apply Actions property."; } enum OFPTFPT_APPLY_ACTIONS_MISS { - value 7; + value 7; description "Apply Actions for table-miss."; } enum OFPTFPT_MATCH { - value 8; + value 8; description "Match property."; } enum OFPTFPT_WILDCARDS { - value 10; + value 10; description "Wildcards property."; } enum OFPTFPT_WRITE_SETFIELD { - value 12; + value 12; description "Write Set-Field property."; } enum OFPTFPT_WRITE_SETFIELD_MISS { - value 13; + value 13; description "Write Set-Field for table-miss."; } enum OFPTFPT_APPLY_SETFIELD { - value 14; + value 14; description "Apply Set-Field property."; } enum OFPTFPT_APPLY_SETFIELD_MISS { - value 15; + value 15; description "Apply Set-Field for table-miss."; } enum OFPTFPT_EXPERIMENTER { - value 65534; + value 65534; description "Experimenter property."; } enum OFPTFPT_EXPERIMENTER_MISS { - value 65535; //0xffff + value 65535; //0xffff description "Experimenter for table-miss."; } } @@ -1392,7 +1392,7 @@ } } } - + typedef ipv6-exthdr-flags { description "Bit definitions for IPv6 Extension Header pseudo-field."; type bits { @@ -1434,170 +1434,170 @@ } } } - + // OPENFLOW v1.0 STRUCTURES - // Structures under this line are needed to support OpenFlow version 1.0 + // Structures under this line are needed to support OpenFlow version 1.0 // wire protocol 0x01; - + typedef error-type-v10 { type enumeration { enum HELLO_FAILED { - value 0; + value 0; description "Hello Protocol failed."; } enum BAD_REQUEST { - value 1; + value 1; description "Request was not understood."; } enum BAD_ACTION { - value 2; + value 2; description "Error in action description."; } enum FLOW_MOD_FAILED { - value 3; + value 3; description "Problem modifying flow entry."; } enum PORT_MOD_FAILED { - value 4; + value 4; description "Port mod request failed."; } enum QUEUE_OP_FAILED { - value 5; + value 5; description "Queue operation failed."; } } } - + typedef hello-failed-code-v10 { type enumeration { enum INCOMPATIBLE { - value 0; + value 0; description "Hello Protocol failed."; } enum EPERM { - value 1; + value 1; description "Request was not understood."; } } } - + typedef bad-request-code-v10 { type enumeration { enum BAD_VERSION { - value 0; + value 0; } enum BAD_TYPE { - value 1; + value 1; } enum BAD_STAT { - value 2; + value 2; } enum BAD_VENDOR { - value 3; + value 3; } enum BAD_SUBTYPE { - value 4; + value 4; } enum EPERM { - value 5; + value 5; } enum BAD_LEN { - value 6; + value 6; } enum BUFFER_EMPTY { - value 7; + value 7; } enum BUFFER_UNKNOWN { - value 8; + value 8; } } } - + typedef bad-action-code-v10 { type enumeration { enum BAD_TYPE { - value 0; + value 0; } enum BAD_LEN { - value 1; + value 1; } enum VENDOR { - value 2; + value 2; } enum BAD_VENDOR_TYPE { - value 3; + value 3; } enum BAD_OUT_PORT { - value 4; + value 4; } enum BAD_ARGUMENT { - value 5; + value 5; } enum EPERM { - value 6; + value 6; } enum TOO_MANY { - value 7; + value 7; } enum BAD_QUEUE { - value 8; + value 8; } } } - + typedef flow-mod-failed-code-v10 { type enumeration { enum ALL_TABLES_FULL { - value 0; + value 0; } enum OVERLAP { - value 1; + value 1; } enum EPERM { - value 2; + value 2; } enum BAD_EMERG_TIMEOUT { - value 3; + value 3; } enum BAD_COMMAND { - value 4; + value 4; } enum UNSUPPORTED { - value 5; + value 5; } } } - + typedef port-mod-failed-code-v10 { type enumeration { enum BAD_PORT { - value 0; + value 0; } enum BAD_HW_ADDR { - value 1; + value 1; } } } - + typedef queue-op-failed-code-v10 { type enumeration { enum BAD_PORT { - value 0; + value 0; } enum BAD_QUEUE { - value 1; + value 1; } enum EPERM { - value 2; + value 2; } } } - + typedef port-number-values-v10 { description "Port numbering. Physical ports are numbered starting from 1."; type enumeration { enum MAX { - value 65280; // 0xff00 + value 65280; // 0xff00 } enum IN_PORT { description "Send the packet out the input port. This @@ -1610,20 +1610,20 @@ description "Perform actions in flow table. NB: This can only be the destination port for packet-out messages."; - value 65529; // 0xfff9 + value 65529; // 0xfff9 } enum NORMAL { description "Process with normal L2/L3 switching."; - value 65530; // 0xfffa + value 65530; // 0xfffa } enum FLOOD { description "All physical ports except input port and those disabled by STP."; - value 65531; // 0xfffb + value 65531; // 0xfffb } enum ALL { description "All physical ports except input port."; - value 65532; // 0xfffc + value 65532; // 0xfffc } enum CONTROLLER { description "Send to controller."; @@ -1639,14 +1639,14 @@ } } } - + typedef port-config-v10 { - description + description "Flags to indicate behavior of the physical port. These flags are - describe the current configuration and used port_mod message + describe the current configuration and used port_mod message to configure the port's behavior."; type bits { - bit port-down { + bit port-down { description " Port is administratively down."; position 0; } @@ -1654,29 +1654,29 @@ description "Disable 802.1D spanning tree on port."; position 1; } - bit no-recv { + bit no-recv { description " Drop all packets received by port."; position 2; } - bit no-recv-stp { + bit no-recv-stp { description " Drop received 802.1D STP packets."; position 3; } - bit no-flood { + bit no-flood { description " Do not include this port when flooding."; position 4; } - bit no-fwd { + bit no-fwd { description " Drop packets forwarded to port."; position 5; } - bit no-packet-in { + bit no-packet-in { description "Do not send packet-in msgs for port."; position 6; } } } - + typedef port-state-v10 { description "Current state of the physical port. These are not configurable from the controller."; @@ -1710,68 +1710,68 @@ } } } - + typedef port-features-v10 { description "Features of ports available in datapath."; reference "ofp_port_features"; type bits { - bit _10mb-hd { + bit _10mb-hd { position 0; description "10 Mb half-duplex rate support."; } - bit _10mb-fd { + bit _10mb-fd { position 1; description "10 Mb full-duplex rate support."; } - bit _100mb-hd { + bit _100mb-hd { position 2; description "100 Mb half-duplex rate support."; } - bit _100mb-fd { + bit _100mb-fd { position 3; description "100 Mb full-duplex rate support."; } - bit _1gb-hd { + bit _1gb-hd { position 4; description "1 Gb half-duplex rate support."; } - bit _1gb-fd { + bit _1gb-fd { position 5; description "1 Gb full-duplex rate support."; } - bit _10gb-fd { + bit _10gb-fd { position 6; description "10 Gb full-duplex rate support."; } - bit copper { + bit copper { position 7; description "Copper medium."; } - bit fiber { + bit fiber { position 8; description "Fiber medium."; } - bit autoneg { + bit autoneg { position 9; description "Auto-negotiation."; } - bit pause { + bit pause { position 10; description "Pause."; } - bit pause-asym { + bit pause-asym { position 11; description "Asymmetric pause."; } } } - + typedef capabilities-v10 { type bits { bit OFPC_FLOW_STATS { position 0; description "Flow statistics."; - } + } bit OFPC_TABLE_STATS { position 1; description "Table statistics."; @@ -1802,7 +1802,7 @@ } } } - + typedef flow-mod-flags-v10 { /* ofp_flow_mod_flags */ type bits { @@ -1820,7 +1820,7 @@ } } } - + typedef action-type-v10 { /* ofp_action_type */ type bits { @@ -1878,7 +1878,7 @@ } } } - + typedef flow-wildcards-v10 { /* ofp_flow_wildcards */ description "Flow wildcards - NW_SRC_MASK & NW_DST_MASK are handled separately"; @@ -1925,5 +1925,5 @@ } } } - + } diff --git a/openflow-protocol-api/src/main/yang/system-notifications.yang b/openflow-protocol-api/src/main/yang/system-notifications.yang index 4cbe17e7..b31dd02b 100644 --- a/openflow-protocol-api/src/main/yang/system-notifications.yang +++ b/openflow-protocol-api/src/main/yang/system-notifications.yang @@ -5,7 +5,7 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - + module system-notifications { namespace "urn:opendaylight:openflow:system"; prefix "ofs"; diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKeyTest.java index 82377828..edfa5721 100644 --- a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKeyTest.java +++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKeyTest.java @@ -47,7 +47,7 @@ public class EnhancedMessageCodeKeyTest { Assert.assertFalse("Wrong equals", key1.equals(key2)); Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode()); } - + /** * Test EnhancedMessageTypeKey equals - additional test */ @@ -55,7 +55,7 @@ public class EnhancedMessageCodeKeyTest { public void testEquals() { EnhancedMessageCodeKey key1 = new EnhancedMessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, 8, BarrierInput.class); - + Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1)); Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object())); } diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKeyTest.java index 40ff08cc..483597c6 100644 --- a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKeyTest.java +++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKeyTest.java @@ -49,7 +49,7 @@ public class EnhancedMessageTypeKeyTest { Assert.assertFalse("Wrong equals", key1.equals(key2)); Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode()); } - + /** * Test EnhancedMessageTypeKey equals - additional test */ @@ -59,10 +59,10 @@ public class EnhancedMessageTypeKeyTest { EnhancedMessageTypeKey key2; key1 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, Output.class); key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, Output.class); - + Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1)); Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object())); - + key1 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, null); Assert.assertFalse("Wrong equal by msgType2.", key1.equals(key2)); key1 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, Output.class); diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKeyTest.java index 83f426c4..18a4a1e7 100644 --- a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKeyTest.java +++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKeyTest.java @@ -48,7 +48,7 @@ public class MessageTypeKeyTest { @Test public void testEquals() { MessageTypeKey key1; - MessageTypeKey key2; + MessageTypeKey key2; key1 = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, BarrierInput.class); Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1)); diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/ActionDeserializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/ActionDeserializerKeyTest.java index 6ba052b7..3b2be12c 100644 --- a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/ActionDeserializerKeyTest.java +++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/ActionDeserializerKeyTest.java @@ -40,7 +40,7 @@ public class ActionDeserializerKeyTest { Assert.assertFalse("Wrong equals", key1.equals(key2)); Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode()); } - + /** * Test ActionDeserializerKey equals - additional test */ diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/ActionSerializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/ActionSerializerKeyTest.java index 043a3cfb..1a1021a1 100644 --- a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/ActionSerializerKeyTest.java +++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/ActionSerializerKeyTest.java @@ -47,7 +47,7 @@ public class ActionSerializerKeyTest { Assert.assertFalse("Wrong equals", key1.equals(key2)); Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode()); } - + /** * Test ActionSerializerKey equals - additional test */ @@ -55,10 +55,10 @@ public class ActionSerializerKeyTest { public void testEquals(){ ActionSerializerKey key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, 42L); ActionSerializerKey key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlIn.class, 42L); - + Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1)); Assert.assertFalse("Wrong equal by actionType", key1.equals(key2)); - + key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, 42L); Assert.assertTrue("Wrong equal by action type", key1.equals(key2)); key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlIn.class, null); diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKeyTest.java index 208b4ff7..6b501a1c 100644 --- a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKeyTest.java +++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKeyTest.java @@ -40,7 +40,7 @@ public class InstructionDeserializerKeyTest { Assert.assertFalse("Wrong equals", key1.equals(key2)); Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode()); } - + /** * Test InstructionDeserializerKey equals - additional test */ diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKeyTest.java index 23aecd79..a51a2d70 100644 --- a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKeyTest.java +++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKeyTest.java @@ -47,7 +47,7 @@ public class InstructionSerializerKeyTest { Assert.assertFalse("Wrong equals", key1.equals(key2)); Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode()); } - + /** * Test InstructionSerializerKey equals - additional test */ diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/KeysTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/KeysTest.java index f270bd92..927ec5d5 100644 --- a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/KeysTest.java +++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/KeysTest.java @@ -42,7 +42,7 @@ public class KeysTest { EncodeConstants.OF13_VERSION_ID, 1L); Assert.assertEquals(instructionDeserializerKey, experimenterInstructionDeserializerKey); Assert.assertEquals(instructionDeserializerKey.hashCode(), experimenterInstructionDeserializerKey.hashCode()); - + MatchEntryDeserializerKey matchKey = new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_OP); MatchEntryDeserializerKey matchKey2 = new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, @@ -78,7 +78,7 @@ public class KeysTest { Assert.assertEquals(matchKey, matchKey2); Assert.assertEquals(matchKey.hashCode(), matchKey2.hashCode()); } - + private static class ExpSubType extends ExperimenterActionSubType { // empty class - only used in test for comparation } diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntryDeserializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntryDeserializerKeyTest.java index 5c69cc65..c3d9cf90 100644 --- a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntryDeserializerKeyTest.java +++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntryDeserializerKeyTest.java @@ -46,7 +46,7 @@ public class MatchEntryDeserializerKeyTest { Assert.assertTrue("Wrong equals", key1.equals(key2)); Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode()); } - + /** * Test MatchEntryDeserializerKey equals - additional test */ @@ -54,16 +54,16 @@ public class MatchEntryDeserializerKeyTest { public void testEquals() { MatchEntryDeserializerKey key1 = new MatchEntryDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0x8000, 42); MatchEntryDeserializerKey key2 = new MatchEntryDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0x8000, 42); - + Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1)); Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object())); - + Long expId1=123456L; Long expId2=654321L; key1.setExperimenterId(null); key2.setExperimenterId(expId2); Assert.assertFalse("Wrong equal by experimeterId.", key1.equals(key2)); - + key1.setExperimenterId(expId1); Assert.assertFalse("Wrong equal by experimeterId.", key1.equals(key2)); Assert.assertFalse("Wrong equals with different object class", key1.equals(key2)); diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntrySerializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntrySerializerKeyTest.java index 0863db37..8bf98fda 100644 --- a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntrySerializerKeyTest.java +++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntrySerializerKeyTest.java @@ -56,9 +56,9 @@ public class MatchEntrySerializerKeyTest { key2.setExperimenterId(42L); Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode()); } - + /** - * Test MatchEntrySerializerKey equals - additional test + * Test MatchEntrySerializerKey equals - additional test */ @Test public void testEquals(){ @@ -68,10 +68,10 @@ public class MatchEntrySerializerKeyTest { key2 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, InPort.class); Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1)); Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object())); - + Long expId1 = 987654331L; Long expId2 = 123456789L; - + key1.setExperimenterId(null); key2.setExperimenterId(expId2); Assert.assertFalse("Wrong equal by experimenterId", key1.equals(key2)); diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionSerializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionSerializerKeyTest.java index c8111fbd..f287d3a3 100644 --- a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionSerializerKeyTest.java +++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionSerializerKeyTest.java @@ -60,7 +60,7 @@ public class ExperimenterActionSerializerKeyTest { Assert.assertFalse("Wrong equal by actionSubType.", key1.equals(key2)); } - + private static class TestSubType extends ExperimenterActionSubType { // empty class - only used in test for comparation } @@ -68,6 +68,6 @@ public class ExperimenterActionSerializerKeyTest { private static class TestSubType2 extends ExperimenterActionSubType { // empty class - only used in test for comparation } - + } \ No newline at end of file diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdSerializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdSerializerKeyTest.java index 06f06cbf..e931d6a7 100644 --- a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdSerializerKeyTest.java +++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdSerializerKeyTest.java @@ -48,7 +48,7 @@ public class ExperimenterIdSerializerKeyTest { Assert.assertFalse("Wrong equals", key1.equals(key2)); Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode()); } - + /** * Test ExperimenterIdSerializerKey equals - additional test */ @@ -63,5 +63,5 @@ public class ExperimenterIdSerializerKeyTest { new ExperimenterIdSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, ExperimenterMessage.class); Assert.assertFalse("Wrong equal by experimenterId.", key1.equals(key2)); } - + } \ No newline at end of file diff --git a/openflow-protocol-impl/pom.xml b/openflow-protocol-impl/pom.xml index 8cc54c09..ba83903a 100644 --- a/openflow-protocol-impl/pom.xml +++ b/openflow-protocol-impl/pom.xml @@ -18,7 +18,7 @@ 0.7.0-SNAPSHOT 0.7.0-SNAPSHOT - + @@ -98,7 +98,7 @@ - + ${project.groupId} diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ChannelInitializerFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ChannelInitializerFactory.java index 7328f8c7..042d4640 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ChannelInitializerFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ChannelInitializerFactory.java @@ -24,7 +24,7 @@ public class ChannelInitializerFactory { private SerializationFactory serializationFactory; private TlsConfiguration tlsConfig; private SwitchConnectionHandler switchConnectionHandler; - + /** * @return PublishingChannelInitializer that initializes new channels */ diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketHandler.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketHandler.java index 74e9c3a3..685985ec 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketHandler.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketHandler.java @@ -79,7 +79,7 @@ public class OFDatagramPacketHandler extends MessageToMessageDecoder { private static final Logger LOGGER = LoggerFactory.getLogger(OFEncoder.class); private SerializationFactory serializationFactory; private StatisticsCounters statisticsCounters; - + /** Constructor of class */ public OFEncoder() { statisticsCounters = StatisticsCounters.getInstance(); diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFFrameDecoder.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFFrameDecoder.java index 4bc5ce87..5c3b7616 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFFrameDecoder.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFFrameDecoder.java @@ -72,10 +72,10 @@ public class OFFrameDecoder extends ByteToMessageDecoder { } return; } - + int length = bb.getUnsignedShort(bb.readerIndex() + LENGTH_INDEX_IN_HEADER); LOGGER.debug("length of actual message: {}", length); - + if (readableBytes < length) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("skipping bytebuf - too few bytes for msg: " + @@ -85,7 +85,7 @@ public class OFFrameDecoder extends ByteToMessageDecoder { return; } LOGGER.debug("OF Protocol message received, type:{}", bb.getByte(bb.readerIndex() + 1)); - + ByteBuf messageBuffer = bb.slice(bb.readerIndex(), length); list.add(messageBuffer); messageBuffer.retain(); diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/PipelineHandlers.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/PipelineHandlers.java index 26dad6d1..51ac5482 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/PipelineHandlers.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/PipelineHandlers.java @@ -10,7 +10,7 @@ package org.opendaylight.openflowjava.protocol.impl.core; /** * Stores names of handlers used in pipeline. - * + * * @author michal.polkorab */ public enum PipelineHandlers { diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ShutdownProvider.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ShutdownProvider.java index a3372ef8..15978def 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ShutdownProvider.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ShutdownProvider.java @@ -18,7 +18,7 @@ import com.google.common.util.concurrent.ListenableFuture; public interface ShutdownProvider { /** - * @return shutdown future + * @return shutdown future */ ListenableFuture shutdown(); diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SslContextFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SslContextFactory.java index 965cab3d..b2c5a199 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SslContextFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SslContextFactory.java @@ -24,7 +24,7 @@ import org.slf4j.LoggerFactory; /** * Class for setting up TLS connection. - * + * * @author michal.polkorab */ public class SslContextFactory { diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpChannelInitializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpChannelInitializer.java index 6b974825..07aab354 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpChannelInitializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpChannelInitializer.java @@ -45,13 +45,13 @@ public class TcpChannelInitializer extends ProtocolChannelInitializer> l = h.takeListener(); - + final ChannelFuture p; if (address == null) { p = channel.write(new MessageListenerWrapper(h.takeMessage(), l)); diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/MessageListenerWrapper.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/MessageListenerWrapper.java index ec415b38..4b98fd8c 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/MessageListenerWrapper.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/MessageListenerWrapper.java @@ -16,7 +16,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 /** * Wraps outgoing message and includes listener attached to this message. This object * is sent to OFEncoder. When OFEncoder fails to serialize the message, - * listener is filled with exception. The exception is then delegated to upper ODL layers. + * listener is filled with exception. The exception is then delegated to upper ODL layers. * @author michal.polkorab */ public class MessageListenerWrapper { @@ -40,7 +40,7 @@ public class MessageListenerWrapper { return msg; } - + /** * @return listener listening on message sending success / failure */ diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKey.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKey.java index 067c5603..2463f3f2 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKey.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKey.java @@ -15,7 +15,7 @@ package org.opendaylight.openflowjava.protocol.impl.core.connection; * @author mirehak */ public class RpcResponseKey { - + private final long xid; private final String outputClazz; /** @@ -26,7 +26,7 @@ public class RpcResponseKey { this.xid = xid; this.outputClazz = outputClazz; } - + /** * @return the xid */ @@ -40,7 +40,7 @@ public class RpcResponseKey { public String getOutputClazz() { return outputClazz; } - + @Override public int hashCode() { final int prime = 31; diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpMessageListenerWrapper.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpMessageListenerWrapper.java index a946cf54..e783dc42 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpMessageListenerWrapper.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpMessageListenerWrapper.java @@ -18,7 +18,7 @@ import java.net.InetSocketAddress; * is sent to OFEncoder. When OFEncoder fails to serialize the message, * listener is filled with exception. The exception is then delegated to upper ODL layers. * This object is used for UDP communication - it also carries recipient address - + * @author michal.polkorab */ public class UdpMessageListenerWrapper extends MessageListenerWrapper { diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/ActionDeserializerInitializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/ActionDeserializerInitializer.java index e946f30f..1c6c5d20 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/ActionDeserializerInitializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/ActionDeserializerInitializer.java @@ -56,7 +56,7 @@ public final class ActionDeserializerInitializer { */ public static void registerDeserializers(DeserializerRegistry registry) { // register OF v1.0 action deserializers - ActionDeserializerRegistryHelper helper = + ActionDeserializerRegistryHelper helper = new ActionDeserializerRegistryHelper(EncodeConstants.OF10_VERSION_ID, registry); helper.registerDeserializer(0, new OF10OutputActionDeserializer()); helper.registerDeserializer(1, new OF10SetVlanVidActionDeserializer()); diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassMapInitializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassMapInitializer.java index b0b4d047..9ed52140 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassMapInitializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassMapInitializer.java @@ -44,7 +44,7 @@ public final class TypeToClassMapInitializer { */ public static void initializeTypeToClassMap(Map> messageClassMap) { // init OF v1.0 mapping - TypeToClassInitHelper helper = + TypeToClassInitHelper helper = new TypeToClassInitHelper(EncodeConstants.OF10_VERSION_ID, messageClassMap); helper.registerTypeToClass((short) 0, HelloMessage.class); helper.registerTypeToClass((short) 1, ErrorMessage.class); diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ErrorMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ErrorMessageFactory.java index 8e341bd0..daae3634 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ErrorMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ErrorMessageFactory.java @@ -68,7 +68,7 @@ public class ErrorMessageFactory implements OFDeserializer, } return builder.build(); } - + private static void decodeType(ErrorMessageBuilder builder, ErrorType type, int readValue) { if (type != null) { builder.setType(type.getIntValue()); @@ -232,12 +232,12 @@ public class ErrorMessageFactory implements OFDeserializer, setUnknownCode(builder, code); } } - + private static void setUnknownCode(ErrorMessageBuilder builder, int readValue) { builder.setCode(readValue); builder.setCodeString(UNKNOWN_CODE); } - + private static void setCode(ErrorMessageBuilder builder, int code, String codeString) { builder.setCode(code); builder.setCodeString(codeString); diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/GetAsyncReplyMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/GetAsyncReplyMessageFactory.java index d565fa63..39d757cc 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/GetAsyncReplyMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/GetAsyncReplyMessageFactory.java @@ -46,18 +46,18 @@ public class GetAsyncReplyMessageFactory implements OFDeserializer decodePacketInMask(ByteBuf input) { List inMasks = new ArrayList<>(); PacketInMaskBuilder maskBuilder; for (int i = 0; i < SEPARATE_ROLES; i++) { maskBuilder = new PacketInMaskBuilder(); maskBuilder.setMask(decodePacketInReasons(input.readUnsignedInt())); - inMasks.add(maskBuilder.build()); + inMasks.add(maskBuilder.build()); } return inMasks; } - + private static List decodePortStatusMask(ByteBuf input) { List inMasks = new ArrayList<>(); PortStatusMaskBuilder maskBuilder; @@ -68,7 +68,7 @@ public class GetAsyncReplyMessageFactory implements OFDeserializer decodeFlowRemovedMask(ByteBuf input) { List inMasks = new ArrayList<>(); FlowRemovedMaskBuilder maskBuilder; @@ -79,7 +79,7 @@ public class GetAsyncReplyMessageFactory implements OFDeserializer decodePacketInReasons(long input) { List reasons = new ArrayList<>(); if ((input & (1 << 0)) != 0) { @@ -93,7 +93,7 @@ public class GetAsyncReplyMessageFactory implements OFDeserializer decodePortReasons(long input) { List reasons = new ArrayList<>(); if ((input & (1 << 0)) != 0) { @@ -107,7 +107,7 @@ public class GetAsyncReplyMessageFactory implements OFDeserializer decodeFlowRemovedReasons(long input) { List reasons = new ArrayList<>(); if ((input & (1 << 0)) != 0) { diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/HelloMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/HelloMessageFactory.java index 5fafb5e3..ca0a79c8 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/HelloMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/HelloMessageFactory.java @@ -39,7 +39,7 @@ public class HelloMessageFactory implements OFDeserializer { } return builder.build(); } - + private static List readElement(ByteBuf input) { List elementsList = new ArrayList<>(); while (input.readableBytes() > 0) { @@ -64,7 +64,7 @@ public class HelloMessageFactory implements OFDeserializer { } return elementsList; } - + private static List readVersionBitmap(int[] input){ List versionBitmapList = new ArrayList<>(); for (int i = 0; i < input.length; i++) { diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactory.java index b27712f5..7d7f7524 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactory.java @@ -196,11 +196,11 @@ public class MultipartReplyMessageFactory implements OFDeserializer createTableFeaturesProperties(ByteBuf input, int length) { List properties = new ArrayList<>(); int tableFeaturesLength = length; @@ -446,7 +446,7 @@ public class MultipartReplyMessageFactory implements OFDeserializer { } return builder.build(); } - + private static void decodeType(ErrorMessageBuilder builder, ErrorTypeV10 type, int readValue) { if (type != null) { builder.setType(type.getIntValue()); @@ -129,12 +129,12 @@ public class OF10ErrorMessageFactory implements OFDeserializer { setUnknownCode(builder, code); } } - + private static void setUnknownCode(ErrorMessageBuilder builder, int readValue) { builder.setCode(readValue); builder.setCodeString(UNKNOWN_CODE); } - + private static void setCode(ErrorMessageBuilder builder, int code, String codeString) { builder.setCode(code); builder.setCodeString(codeString); diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10FeaturesReplyMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10FeaturesReplyMessageFactory.java index f8f967e4..469f920e 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10FeaturesReplyMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10FeaturesReplyMessageFactory.java @@ -31,7 +31,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 * @author michal.polkorab */ public class OF10FeaturesReplyMessageFactory implements OFDeserializer { - + private static final byte PADDING_IN_FEATURES_REPLY_HEADER = 3; @Override @@ -67,7 +67,7 @@ public class OF10FeaturesReplyMessageFactory implements OFDeserializer createQueuesList(ByteBuf input){ List queuesList = new ArrayList<>(); while (input.readableBytes() > 0) { @@ -59,10 +59,10 @@ public class OF10QueueGetConfigReplyMessageFactory implements OFDeserializer createPropertiesList(ByteBuf input, int length){ int propertiesLength = length; List propertiesList = new ArrayList<>(); @@ -82,4 +82,4 @@ public class OF10QueueGetConfigReplyMessageFactory implements OFDeserializer createQueuesList(ByteBuf input){ List queuesList = new ArrayList<>(); while (input.readableBytes() > 0) { @@ -66,10 +66,10 @@ public class QueueGetConfigReplyMessageFactory implements OFDeserializer createPropertiesList(ByteBuf input, int length){ int propertiesLength = length; List propertiesList = new ArrayList<>(); diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/instruction/ClearActionsInstructionDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/instruction/ClearActionsInstructionDeserializer.java index 9fd7cec9..75bf6f50 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/instruction/ClearActionsInstructionDeserializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/instruction/ClearActionsInstructionDeserializer.java @@ -32,7 +32,7 @@ public class ClearActionsInstructionDeserializer extends AbstractInstructionDese InstructionBuilder builder = super.processHeader(input); input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); input.skipBytes(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION); - ActionsInstructionBuilder actionsBuilder = + ActionsInstructionBuilder actionsBuilder = new ActionsInstructionBuilder(); List actions = new ArrayList<>(); actionsBuilder.setAction(actions); diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/AbstractOxmMatchEntryDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/AbstractOxmMatchEntryDeserializer.java index 1d737b09..5b9c6ba5 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/AbstractOxmMatchEntryDeserializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/AbstractOxmMatchEntryDeserializer.java @@ -40,7 +40,7 @@ public abstract class AbstractOxmMatchEntryDeserializer implements HeaderDeseria /** * Prepares match entry header - sets oxm_class, oxm_field, hasMask - * + sets the buffer.readerIndex() to the end of match entry + * + sets the buffer.readerIndex() to the end of match entry * - where augmentation starts * @param oxmClass oxm class type * @param oxmField oxm field type @@ -60,5 +60,5 @@ public abstract class AbstractOxmMatchEntryDeserializer implements HeaderDeseria input.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES); return builder; } - + } diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/SerializationFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/SerializationFactory.java index e318c683..90cb34d7 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/SerializationFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/SerializationFactory.java @@ -22,7 +22,7 @@ import org.opendaylight.yangtools.yang.binding.DataObject; public class SerializationFactory { private SerializerRegistry registry; - + /** * Transforms POJO message into ByteBuf * @param version version used for encoding received message diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF13SetMplsTtlActionSerializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF13SetMplsTtlActionSerializer.java index aacebf2f..db740a4a 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF13SetMplsTtlActionSerializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/action/OF13SetMplsTtlActionSerializer.java @@ -21,7 +21,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1 public class OF13SetMplsTtlActionSerializer extends AbstractActionSerializer { - + @Override public void serialize(Action action, ByteBuf outBuffer) { super.serialize(action, outBuffer); diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/HelloInputMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/HelloInputMessageFactory.java index 3d95646b..bd87e16f 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/HelloInputMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/HelloInputMessageFactory.java @@ -46,7 +46,7 @@ public class HelloInputMessageFactory implements OFSerializer{ output.writeZero(padding); output.setShort(elementLengthIndex, output.writerIndex() - elementStartIndex); } - } + } } } diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigInputMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigInputMessageFactory.java index 606a98c5..7afa4bc2 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigInputMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigInputMessageFactory.java @@ -20,7 +20,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 * @author michal.polkorab */ public class OF10QueueGetConfigInputMessageFactory implements OFSerializer { - + private static final byte MESSAGE_TYPE = 20; private static final byte PADDING_IN_GET_QUEUE_CONFIG_MESSAGE = 2; diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetAsyncInputMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetAsyncInputMessageFactory.java index 44a089d3..65cb07e3 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetAsyncInputMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetAsyncInputMessageFactory.java @@ -62,7 +62,7 @@ public class SetAsyncInputMessageFactory implements OFSerializer } } } - + private static void serializePortStatusMask(List portStatusMask, ByteBuf outBuffer) { if (portStatusMask != null) { for (PortStatusMask currentPortStatusMask : portStatusMask) { @@ -83,7 +83,7 @@ public class SetAsyncInputMessageFactory implements OFSerializer } } } - + private static void serializerFlowRemovedMask(List flowRemovedMask, ByteBuf outBuffer) { if (flowRemovedMask != null) { for (FlowRemovedMask currentFlowRemovedMask : flowRemovedMask) { diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/AbstractCodeKeyMaker.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/AbstractCodeKeyMaker.java index 05812e8b..45f521e1 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/AbstractCodeKeyMaker.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/AbstractCodeKeyMaker.java @@ -11,7 +11,7 @@ package org.opendaylight.openflowjava.protocol.impl.util; /** * @author michal.polkorab - * @param type the key maker is based on + * @param type the key maker is based on */ public abstract class AbstractCodeKeyMaker implements CodeKeyMaker { @@ -22,7 +22,7 @@ public abstract class AbstractCodeKeyMaker implements CodeKeyMaker { */ public AbstractCodeKeyMaker(short version) { this.version = version; - + } /** diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/AbstractTypeKeyMaker.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/AbstractTypeKeyMaker.java index f2e736fa..70c7a155 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/AbstractTypeKeyMaker.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/AbstractTypeKeyMaker.java @@ -11,7 +11,7 @@ package org.opendaylight.openflowjava.protocol.impl.util; /** * @author michal.polkorab - * @param type the key maker is based on + * @param type the key maker is based on */ public abstract class AbstractTypeKeyMaker implements TypeKeyMaker { @@ -22,7 +22,7 @@ public abstract class AbstractTypeKeyMaker implements TypeKeyMaker { */ public AbstractTypeKeyMaker(short version) { this.version = version; - + } /** diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/InstructionSerializerRegistryHelper.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/InstructionSerializerRegistryHelper.java index f89fd0a1..62e019ad 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/InstructionSerializerRegistryHelper.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/InstructionSerializerRegistryHelper.java @@ -31,7 +31,7 @@ public class InstructionSerializerRegistryHelper { /** * Registers given serializer - * @param instructionType + * @param instructionType * @param serializer */ public void registerSerializer(Class instructionType, diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ListSerializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ListSerializer.java index f085377f..f69c25b6 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ListSerializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ListSerializer.java @@ -20,7 +20,7 @@ import org.opendaylight.yangtools.yang.binding.DataObject; /** * Serializes list items and their headers * @author michal.polkorab - * @param + * @param */ public abstract class ListSerializer { diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/MatchEntrySerializerRegistryHelper.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/MatchEntrySerializerRegistryHelper.java index e3f49e30..e722a93e 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/MatchEntrySerializerRegistryHelper.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/MatchEntrySerializerRegistryHelper.java @@ -37,8 +37,8 @@ public class MatchEntrySerializerRegistryHelper /** * Registers given serializer - * @param specificClass - * @param serializer + * @param specificClass + * @param serializer */ public void registerSerializer( Class specificClass, OFGeneralSerializer serializer) { diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer.java index ceb5963f..c5b07583 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer.java @@ -76,7 +76,7 @@ public class OF13MatchSerializer implements OFSerializer, SerializerRegis return; } for (MatchEntries entry : matchEntries) { - + MatchEntrySerializerKey key = new MatchEntrySerializerKey<>( EncodeConstants.OF13_VERSION_ID, entry.getOxmClass(), entry.getOxmMatchField()); if (entry.getOxmClass().equals(ExperimenterClass.class)) { diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OpenflowUtils.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OpenflowUtils.java index 9a608b2d..f865ac3d 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OpenflowUtils.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OpenflowUtils.java @@ -14,7 +14,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13 /** * Used for common structures translation / conversion - * + * * @author michal.polkorab */ public abstract class OpenflowUtils { diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/TypeKeyMaker.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/TypeKeyMaker.java index 02b0307b..ad1b2f42 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/TypeKeyMaker.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/TypeKeyMaker.java @@ -12,13 +12,13 @@ import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey; /** * @author michal.polkorab - * @param + * @param */ public interface TypeKeyMaker { /** * @param entry - * @return key that will be used for serializer lookup in + * @return key that will be used for serializer lookup in * the serializer registry */ abstract MessageTypeKey make(T entry); diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/TypeToClassInitHelper.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/TypeToClassInitHelper.java index 0484ea83..672cdea6 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/TypeToClassInitHelper.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/TypeToClassInitHelper.java @@ -23,7 +23,7 @@ public class TypeToClassInitHelper { * @param version protocol wire version * @param messageClassMap map which stores type to class mapping */ - public TypeToClassInitHelper(short version, Map> messageClassMap) { this.version = version; this.messageClassMap = messageClassMap; diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/statistics/Counter.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/statistics/Counter.java index aea5890e..077bfe64 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/statistics/Counter.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/statistics/Counter.java @@ -11,7 +11,7 @@ package org.opendaylight.openflowjava.statistics; import java.util.concurrent.atomic.AtomicLong; /** * Counts statistics - * + * * @author madamjak */ public class Counter { @@ -35,7 +35,7 @@ public class Counter { } /** - * return the last read value of counter. This value can be set during the reading of current counter value, + * return the last read value of counter. This value can be set during the reading of current counter value, * for detail see method getCounterValue(boolean modifyLastReadValue). * @return the counterLastReadValue */ diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/statistics/StatisticsCounters.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/statistics/StatisticsCounters.java index 951969ab..1f4d7ca3 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/statistics/StatisticsCounters.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/statistics/StatisticsCounters.java @@ -41,14 +41,14 @@ public final class StatisticsCounters implements StatisticsHandler { private boolean runCounting; // array to hold enabled counter types private CounterEventTypes[] enabledCounters = { - CounterEventTypes.DS_ENCODE_FAIL, + CounterEventTypes.DS_ENCODE_FAIL, CounterEventTypes.DS_ENCODE_SUCCESS, CounterEventTypes.DS_ENTERED_OFJAVA, CounterEventTypes.DS_FLOW_MODS_ENTERED, CounterEventTypes.DS_FLOW_MODS_SENT, - CounterEventTypes.US_DECODE_FAIL, - CounterEventTypes.US_DECODE_SUCCESS, - CounterEventTypes.US_MESSAGE_PASS, + CounterEventTypes.US_DECODE_FAIL, + CounterEventTypes.US_DECODE_SUCCESS, + CounterEventTypes.US_MESSAGE_PASS, CounterEventTypes.US_RECEIVED_IN_OFJAVA}; /** diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/_switch/connection/provider/impl/rev140328/SwitchConnectionProviderModule.java b/openflow-protocol-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/_switch/connection/provider/impl/rev140328/SwitchConnectionProviderModule.java index fd5cf8aa..68edb2a3 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/_switch/connection/provider/impl/rev140328/SwitchConnectionProviderModule.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/_switch/connection/provider/impl/rev140328/SwitchConnectionProviderModule.java @@ -29,7 +29,7 @@ import com.google.common.base.Objects; */ public final class SwitchConnectionProviderModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.provider.impl.rev140328.AbstractSwitchConnectionProviderModule { - + private static Logger LOG = LoggerFactory .getLogger(SwitchConnectionProviderModule.class); @@ -72,7 +72,7 @@ public final class SwitchConnectionProviderModule extends org.opendaylight.yang. /** * @return instance configuration object - * @throws UnknownHostException + * @throws UnknownHostException */ private ConnectionConfiguration createConnectionConfiguration() throws UnknownHostException { final InetAddress address = extractIpAddressBin(getAddress()); @@ -154,12 +154,12 @@ public final class SwitchConnectionProviderModule extends org.opendaylight.yang. return null; } return new ThreadConfiguration() { - + @Override public int getWorkerThreadCount() { return threads.getWorkerThreads(); } - + @Override public int getBossThreadCount() { return threads.getBossThreads(); @@ -172,7 +172,7 @@ public final class SwitchConnectionProviderModule extends org.opendaylight.yang. /** * @param address * @return - * @throws UnknownHostException + * @throws UnknownHostException */ private static InetAddress extractIpAddressBin(IpAddress address) throws UnknownHostException { byte[] addressBin = null; @@ -183,7 +183,7 @@ public final class SwitchConnectionProviderModule extends org.opendaylight.yang. addressBin = address2bin(address.getIpv6Address().getValue()); } } - + if (addressBin == null) { return null; } else { diff --git a/openflow-protocol-impl/src/main/yang/openflow-switch-connection-provider-impl.yang b/openflow-protocol-impl/src/main/yang/openflow-switch-connection-provider-impl.yang index cb714d6b..2f80d957 100644 --- a/openflow-protocol-impl/src/main/yang/openflow-switch-connection-provider-impl.yang +++ b/openflow-protocol-impl/src/main/yang/openflow-switch-connection-provider-impl.yang @@ -146,7 +146,7 @@ module openflow-switch-connection-provider-impl { identity reset-ofjava-statistics-rpc; rpc print-ofjava-statistics { - description + description "Shortcut JMX call to printOfjavaStatistics."; input { uses rpcx:rpc-context-ref { @@ -163,7 +163,7 @@ module openflow-switch-connection-provider-impl { } rpc reset-ofjava-statistics { - description + description "Shortcut JMX call to resetOfjavaStatistics."; input { uses rpcx:rpc-context-ref { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/DelegatingInboundHandlerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/DelegatingInboundHandlerTest.java index 5e365b86..27aac9ce 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/DelegatingInboundHandlerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/DelegatingInboundHandlerTest.java @@ -41,7 +41,7 @@ public class DelegatingInboundHandlerTest { } /** - * + * */ @Test public void testChannelReadSuccess() { @@ -51,7 +51,7 @@ public class DelegatingInboundHandlerTest { verify( mockMsgConsumer, times(1)).consume(mockDataObject); } /** - * + * */ @Test public void testChannelInactive() { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/DummyDecoder.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/DummyDecoder.java index d22196a9..fcab9887 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/DummyDecoder.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/DummyDecoder.java @@ -25,7 +25,7 @@ public class DummyDecoder extends ByteToMessageDecoder { private static final Logger LOGGER = LoggerFactory .getLogger(DummyDecoder.class); - + @Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/IdleHandlerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/IdleHandlerTest.java index aa08feb5..b3462e98 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/IdleHandlerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/IdleHandlerTest.java @@ -34,7 +34,7 @@ public class IdleHandlerTest { /** * Sets up test environment - * + * */ @Before public void setUp() { @@ -96,15 +96,15 @@ public class IdleHandlerTest { try { idleHandler.readTimedOut(mockChHndlrCtx); verify(mockChHndlrCtx, times(1)).fireChannelRead(any(Object.class)) ; - + idleHandler.channelRead(mockChHndlrCtx, new String() ); verify(mockChHndlrCtx, times(2)).fireChannelRead(any(Object.class)) ; - + idleHandler.readTimedOut(mockChHndlrCtx); verify(mockChHndlrCtx, times(3)).fireChannelRead(any(Object.class)) ; } catch (Exception e) { Assert.fail(); } } - + } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFDecoderStatisticsTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFDecoderStatisticsTest.java index 2b30d846..409e475d 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFDecoderStatisticsTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFDecoderStatisticsTest.java @@ -31,7 +31,7 @@ import org.opendaylight.yangtools.yang.binding.DataObject; /** * Test to count decoder events (counters US_DECODE_SUCCESS, US_DECODE_FAIL and * US_RECEIVED_IN_OFJAVA have to be enabled) - * + * * @author madamjak * */ @@ -100,7 +100,7 @@ public class OFDecoderStatisticsTest { Assert.assertEquals( "Wrong - different between RECEIVED_IN_OFJAVA and (US_DECODE_SUCCESS + US_DECODE_FAIL)", statCounters.getCounter(CounterEventTypes.US_RECEIVED_IN_OFJAVA).getCounterValue(), - statCounters.getCounter(CounterEventTypes.US_DECODE_SUCCESS).getCounterValue() + statCounters.getCounter(CounterEventTypes.US_DECODE_SUCCESS).getCounterValue() + statCounters.getCounter(CounterEventTypes.US_DECODE_FAIL).getCounterValue()); } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFDecoderTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFDecoderTest.java index af8a0102..917f9b92 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFDecoderTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFDecoderTest.java @@ -44,7 +44,7 @@ public class OFDecoderTest { /** * Sets up test environment - * + * */ @Before public void setUp() { @@ -57,7 +57,7 @@ public class OFDecoderTest { } /** - * + * */ @Test public void testDecode() { @@ -74,7 +74,7 @@ public class OFDecoderTest { } /** - * + * */ @Test public void testDecodeDeserializeException() { @@ -93,7 +93,7 @@ public class OFDecoderTest { } /** - * + * */ @Test public void testDecodeDeserializeNull() { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFFrameDecoderTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFFrameDecoderTest.java index 69fc393e..41d692c8 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFFrameDecoderTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFFrameDecoderTest.java @@ -27,7 +27,7 @@ import org.opendaylight.openflowjava.util.ByteBufUtils; /** * Testing class of {@link OFFrameDecoder} - * + * * @author michal.polkorab */ @RunWith(MockitoJUnitRunner.class) diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFVersionDetectorTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFVersionDetectorTest.java index 1a3a3244..35b44977 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFVersionDetectorTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFVersionDetectorTest.java @@ -24,7 +24,7 @@ import org.mockito.runners.MockitoJUnitRunner; import org.opendaylight.openflowjava.util.ByteBufUtils; /** - * + * * @author michal.polkorab */ @RunWith(MockitoJUnitRunner.class) @@ -49,7 +49,7 @@ public class OFVersionDetectorTest { * Test of decode * {@link OFVersionDetector#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List) * } - * + * * @throws Exception */ @Test @@ -94,12 +94,12 @@ public class OFVersionDetectorTest { assertEquals( 0, byteBuffer.refCnt() ) ; } - + /** * Test of decode * {@link OFVersionDetector#decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List) * } - * + * * @throws Exception */ @Test diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/PublishingChannelInitializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/PublishingChannelInitializerTest.java index aa7a6e4a..3d8717c7 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/PublishingChannelInitializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/PublishingChannelInitializerTest.java @@ -66,7 +66,7 @@ public class PublishingChannelInitializerTest { /** * Sets up test environment - * @throws Exception + * @throws Exception */ @Before public void setUp() throws Exception { @@ -89,7 +89,7 @@ public class PublishingChannelInitializerTest { when(mockSocketCh.remoteAddress()).thenReturn(inetSockAddr) ; when(mockSwConnHandler.accept(eq(InetAddress.getLocalHost()))).thenReturn(true) ; when(mockSocketCh.pipeline()).thenReturn(mockChPipeline) ; - + tlsConfiguration = new TlsConfigurationImpl(KeystoreType.JKS, "/selfSignedSwitch", PathType.CLASSPATH, KeystoreType.JKS, "/selfSignedController", PathType.CLASSPATH); } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/SslContextFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/SslContextFactoryTest.java index 652e086c..a52f44c6 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/SslContextFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/SslContextFactoryTest.java @@ -41,7 +41,7 @@ public class SslContextFactoryTest { } /** - * @throws Exception + * @throws Exception */ @Test public void testGetServerContext() throws Exception { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/SslKeyStoreTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/SslKeyStoreTest.java index ca6826f0..c2a13df8 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/SslKeyStoreTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/SslKeyStoreTest.java @@ -33,7 +33,7 @@ public class SslKeyStoreTest { /** * Test keystore file access - via classpath - * @throws Exception + * @throws Exception */ @Test public void testAsInputStream() throws Exception { @@ -44,7 +44,7 @@ public class SslKeyStoreTest { /** * Test keystore file access - via relative path - * @throws Exception + * @throws Exception */ @Test public void testAsInputStream2() throws Exception { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/VersionMessageUdpWrapperTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/VersionMessageUdpWrapperTest.java index 8cdca399..be616030 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/VersionMessageUdpWrapperTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/VersionMessageUdpWrapperTest.java @@ -17,7 +17,7 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; /** - * + * * @author madamjak * */ @@ -29,7 +29,7 @@ public class VersionMessageUdpWrapperTest { public void startUp(){ MockitoAnnotations.initMocks(this); } - + @Test public void test(){ short version = 35; diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ChannelOutboundQueue02Test.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ChannelOutboundQueue02Test.java index 80a58df2..ccc24e55 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ChannelOutboundQueue02Test.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ChannelOutboundQueue02Test.java @@ -141,7 +141,7 @@ public class ChannelOutboundQueue02Test { } /** - * Class for testing - channel can change state to read only or writable + * Class for testing - channel can change state to read only or writable * @author madamjak * */ diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterFactoryImplTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterFactoryImplTest.java index cf5796e7..a7e9904e 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterFactoryImplTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterFactoryImplTest.java @@ -21,14 +21,14 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; /** - * + * * @author madamjak * */ public class ConnectionAdapterFactoryImplTest { @Mock ChannelPipeline channnelPipe; - @Mock Channel channel; + @Mock Channel channel; @Mock InetSocketAddress address; @Before diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterImp02lTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterImp02lTest.java index 0e561fdc..7088bc09 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterImp02lTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterImp02lTest.java @@ -105,7 +105,7 @@ public class ConnectionAdapterImp02lTest { } } /** - * Test Rpc Calls + * Test Rpc Calls */ @Test public void testRcp() { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionConfigurationImpl.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionConfigurationImpl.java index 6f199328..76936754 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionConfigurationImpl.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionConfigurationImpl.java @@ -30,9 +30,9 @@ public class ConnectionConfigurationImpl implements ConnectionConfiguration { /** * Creates {@link ConnectionConfigurationImpl} - * @param address + * @param address * @param port - * @param tlsConfig + * @param tlsConfig * @param switchIdleTimeout */ public ConnectionConfigurationImpl(InetAddress address, int port, TlsConfiguration tlsConfig, long switchIdleTimeout) { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKeyTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKeyTest.java index 62b4613d..0b816c25 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKeyTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/RpcResponseKeyTest.java @@ -13,7 +13,7 @@ import org.junit.Assert; import org.opendaylight.openflowjava.protocol.impl.core.connection.RpcResponseKey; /** - * + * * @author madamjak * */ @@ -24,7 +24,7 @@ public class RpcResponseKeyTest { */ @Test public void testEquals(){ - + long xid1 = 12L; long xid2 = 66L; String outputClazz1 = "Clazz01"; @@ -48,7 +48,7 @@ public class RpcResponseKeyTest { */ @Test public void testGetters(){ - + long xid1 = 12L; String outputClazz1 = "Clazz01"; RpcResponseKey key1 = new RpcResponseKey(xid1, outputClazz1); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java index 282087c4..2a82ddf0 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java @@ -100,10 +100,10 @@ public class SwitchConnectionProviderImpl02Test { config = new ConnectionConfigurationImpl(startupAddress, 0, tlsConfiguration, SWITCH_IDLE_TIMEOUT); config.setTransferProtocol(protocol); } - + /** - * Test getServerFacade + * Test getServerFacade */ @Test public void testServerFacade(){ @@ -129,7 +129,7 @@ public class SwitchConnectionProviderImpl02Test { public void testUnregisterWrongKeys(){ startUp(TransportProtocol.TCP); provider.setConfiguration(config); - ExperimenterInstructionSerializerKey testSerKey + ExperimenterInstructionSerializerKey testSerKey = new ExperimenterInstructionSerializerKey(EncodeConstants.OF10_VERSION_ID,42L); Assert.assertFalse("Wrong -- unregisterSerializer",provider.unregisterSerializer(testSerKey)); ExperimenterInstructionDeserializerKey tesDeserKey @@ -140,36 +140,36 @@ public class SwitchConnectionProviderImpl02Test { /** * Test register and unregister method */ - @Test + @Test public void testUnregisterExistingKeys(){ startUp(TransportProtocol.TCP); provider.setConfiguration(config); // -- registerActionSerializer - ExperimenterActionSerializerKey key1 + ExperimenterActionSerializerKey key1 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 42L, TestSubType.class); provider.registerActionSerializer(key1, serializer); Assert.assertTrue("Wrong -- unregister ActionSerializer", provider.unregisterSerializer(key1)); Assert.assertFalse("Wrong -- unregister ActionSerializer by not existing key", provider.unregisterSerializer(key1)); // -- registerActionDeserializer - ExperimenterActionDeserializerKey key2 + ExperimenterActionDeserializerKey key2 = new ExperimenterActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L); provider.registerActionDeserializer(key2, deserializer); Assert.assertTrue("Wrong -- unregister ActionDeserializer", provider.unregisterDeserializer(key2)); Assert.assertFalse("Wrong -- unregister ActionDeserializer by not existing key", provider.unregisterDeserializer(key2)); // -- registerInstructionSerializer - ExperimenterInstructionSerializerKey key3 + ExperimenterInstructionSerializerKey key3 = new ExperimenterInstructionSerializerKey(EncodeConstants.OF10_VERSION_ID,42L); provider.registerInstructionSerializer(key3, serializer); Assert.assertTrue("Wrong -- unregister InstructionSerializer", provider.unregisterSerializer(key3)); Assert.assertFalse("Wrong -- unregister InstructionSerializer by not existing key", provider.unregisterSerializer(key3)); // -- registerInstructionDeserializer - ExperimenterInstructionDeserializerKey key4 + ExperimenterInstructionDeserializerKey key4 = new ExperimenterInstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID,42L); provider.registerInstructionDeserializer(key4, deserializer); Assert.assertTrue("Wrong -- unregister InstructionDeserializer", provider.unregisterDeserializer(key4)); Assert.assertFalse("Wrong -- unregister InstructionDeserializer by not existing key", provider.unregisterDeserializer(key4)); // -- registerMatchEntryDeserializer - MatchEntryDeserializerKey key5 + MatchEntryDeserializerKey key5 = new MatchEntryDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0x8000, 42); provider.registerMatchEntryDeserializer(key5, deserializer); Assert.assertTrue("Wrong -- unregister MatchEntryDeserializer", provider.unregisterDeserializer(key5)); @@ -205,7 +205,7 @@ public class SwitchConnectionProviderImpl02Test { Assert.assertTrue("Wrong -- unregister QueuePropertyDeserializer", provider.unregisterDeserializer(key10)); Assert.assertFalse("Wrong -- unregister QueuePropertyDeserializer by not existing key", provider.unregisterDeserializer(key10)); // -- registerMeterBandDeserializer - ExperimenterIdDeserializerKey key11 + ExperimenterIdDeserializerKey key11 = new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, MeterBandExperimenterCase.class); provider.registerMeterBandDeserializer(key11, deserializerMeterBandExpCase); Assert.assertTrue("Wrong -- unregister MeterBandDeserializer", provider.unregisterDeserializer(key11)); @@ -235,7 +235,7 @@ public class SwitchConnectionProviderImpl02Test { Assert.assertTrue("Wrong -- unregister MeterBandSerializer", provider.unregisterSerializer(key15)); Assert.assertFalse("Wrong -- unregister MeterBandSerializer by not existing key", provider.unregisterSerializer(key15)); // -- registerMatchEntrySerializer - MatchEntrySerializerKey key16 + MatchEntrySerializerKey key16 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, InPort.class); provider.registerMatchEntrySerializer(key16, serializer); Assert.assertTrue("Wrong -- unregister MatchEntrySerializer", provider.unregisterSerializer(key16)); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpMessageListenerWrapperTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpMessageListenerWrapperTest.java index 0bf79017..df4c7e98 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpMessageListenerWrapperTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpMessageListenerWrapperTest.java @@ -22,7 +22,7 @@ import org.opendaylight.openflowjava.protocol.impl.core.connection.UdpMessageLis import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader; /** - * + * * @author madamjak * */ @@ -30,7 +30,7 @@ public class UdpMessageListenerWrapperTest { @Mock GenericFutureListener> listener; @Mock OfHeader msg; - + @Before public void startUp(){ MockitoAnnotations.initMocks(this); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/DeserializerRegistryImplTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/DeserializerRegistryImplTest.java index aec3df43..49e41fc8 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/DeserializerRegistryImplTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/DeserializerRegistryImplTest.java @@ -15,7 +15,7 @@ import org.opendaylight.openflowjava.protocol.impl.util.MatchDeserializer; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10; /** - * + * * @author madamjak * */ diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/MessageTypeCodeKeyTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/MessageTypeCodeKeyTest.java index 337d3d36..165d613b 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/MessageTypeCodeKeyTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/MessageTypeCodeKeyTest.java @@ -13,7 +13,7 @@ import org.junit.Test; /** - * + * * @author madamjak * */ diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassKeyTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassKeyTest.java index 08cd1a4f..a9ebcf43 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassKeyTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassKeyTest.java @@ -13,7 +13,7 @@ import org.junit.Test; import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants; import org.opendaylight.openflowjava.protocol.impl.util.TypeToClassKey; /** - * + * * @author madamjak * */ diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/EchoReplyMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/EchoReplyMessageFactoryTest.java index abd1d1d5..801d47a6 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/EchoReplyMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/EchoReplyMessageFactoryTest.java @@ -50,7 +50,7 @@ public class EchoReplyMessageFactoryTest { BufferHelper.checkHeaderV13(builtByFactory); } - + /** * Testing {@link EchoReplyMessageFactory} for correct translation into POJO */ @@ -59,7 +59,7 @@ public class EchoReplyMessageFactoryTest { byte[] data = new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}; ByteBuf bb = BufferHelper.buildBuffer(data); EchoOutput builtByFactory = BufferHelper.deserialize(echoFactory, bb); - + BufferHelper.checkHeaderV13(builtByFactory); Assert.assertArrayEquals("Wrong data", data, builtByFactory.getData()); } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/EchoRequestMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/EchoRequestMessageFactoryTest.java index 04fa4ddb..8aff8b75 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/EchoRequestMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/EchoRequestMessageFactoryTest.java @@ -50,7 +50,7 @@ public class EchoRequestMessageFactoryTest { BufferHelper.checkHeaderV13(builtByFactory); } - + /** * Testing {@link EchoRequestMessageFactory} for correct translation into POJO */ diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ErrorMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ErrorMessageFactoryTest.java index 367062f5..55a90b81 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ErrorMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ErrorMessageFactoryTest.java @@ -351,7 +351,7 @@ public class ErrorMessageFactoryTest { Assert.assertEquals("Wrong code string", "EPERM", builtByFactory.getCodeString()); Assert.assertArrayEquals("Wrong data", new byte[]{0x00, 0x01, 0x02, 0x03}, builtByFactory.getData()); } - + /** * Test of {@link ErrorMessageFactory} for correct translation into POJO */ @@ -367,7 +367,7 @@ public class ErrorMessageFactoryTest { Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); Assert.assertArrayEquals("Wrong data", new byte[]{0x00, 0x01, 0x02, 0x03}, builtByFactory.getData()); } - + /** * Test of {@link ErrorMessageFactory} for correct translation into POJO */ diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ExperimenterMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ExperimenterMessageFactoryTest.java index b05730f2..3b71c37e 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ExperimenterMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ExperimenterMessageFactoryTest.java @@ -48,7 +48,7 @@ public class ExperimenterMessageFactoryTest { public void test() { when(registry.getDeserializer(any(ExperimenterIdDeserializerKey.class))).thenReturn(deserializer); when(deserializer.deserialize(any(ByteBuf.class))).thenReturn(message); - + ByteBuf buffer = ByteBufUtils.hexStringToByteBuf("00 01 02 03 00 00 00 10"); ExperimenterMessageFactory factory = new ExperimenterMessageFactory(); factory.injectDeserializerRegistry(registry); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/FlowRemovedMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/FlowRemovedMessageFactoryTest.java index 22b7df56..cc0f35d8 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/FlowRemovedMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/FlowRemovedMessageFactoryTest.java @@ -51,7 +51,7 @@ public class FlowRemovedMessageFactoryTest { FlowRemovedMessage builtByFactory = BufferHelper.deserialize(flowFactory, bb); BufferHelper.checkHeaderV13(builtByFactory); - + Assert.assertTrue(builtByFactory.getCookie().longValue() == 0x0001020304050607L); Assert.assertTrue(builtByFactory.getPriority() == 0x03); Assert.assertEquals("Wrong reason", 0x02, builtByFactory.getReason().getIntValue()); @@ -63,5 +63,5 @@ public class FlowRemovedMessageFactoryTest { Assert.assertEquals("Wrong packetCount", 0x0001020304050607L, builtByFactory.getPacketCount().longValue()); Assert.assertEquals("Wrong byteCount", 0x0001020304050607L, builtByFactory.getByteCount().longValue()); } - + } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/GetAsyncReplyMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/GetAsyncReplyMessageFactoryTest.java index 937f7d8c..c9dabd87 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/GetAsyncReplyMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/GetAsyncReplyMessageFactoryTest.java @@ -57,7 +57,7 @@ public class GetAsyncReplyMessageFactoryTest { */ @Test public void testGetAsyncReplyMessage() { - ByteBuf bb = BufferHelper.buildBuffer("00 00 00 07 "+ + ByteBuf bb = BufferHelper.buildBuffer("00 00 00 07 "+ "00 00 00 00 "+ "00 00 00 07 "+ "00 00 00 00 "+ diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/GetConfigReplyMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/GetConfigReplyMessageFactoryTest.java index e30fb02c..16826620 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/GetConfigReplyMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/GetConfigReplyMessageFactoryTest.java @@ -49,8 +49,8 @@ public class GetConfigReplyMessageFactoryTest { GetConfigOutput builtByFactory = BufferHelper.deserialize(configFactory, bb); BufferHelper.checkHeaderV13(builtByFactory); - Assert.assertEquals("Wrong switchConfigFlag", 0x01, builtByFactory.getFlags().getIntValue()); + Assert.assertEquals("Wrong switchConfigFlag", 0x01, builtByFactory.getFlags().getIntValue()); Assert.assertEquals("Wrong missSendLen", 0x03, builtByFactory.getMissSendLen().intValue()); } - + } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/HelloMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/HelloMessageFactoryTest.java index 89f10225..47bd8ddf 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/HelloMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/HelloMessageFactoryTest.java @@ -80,7 +80,7 @@ public class HelloMessageFactoryTest { Assert.assertEquals("Wrong type", element.get(0).getType(), builtByFactory.getElements().get(0).getType()); Assert.assertEquals("Wrong versionBitmap", element.get(0).getVersionBitmap(), builtByFactory.getElements().get(0).getVersionBitmap()); } - + /** * Testing {@link HelloMessageFactory} if incorrect version is set */ diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactoryTest.java index 11322641..ded6a326 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartReplyMessageFactoryTest.java @@ -96,7 +96,7 @@ public class MultipartReplyMessageFactoryTest { private static final Logger LOGGER = LoggerFactory .getLogger(MultipartReplyMessageFactoryTest.class); - + /** * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO */ @@ -105,39 +105,39 @@ public class MultipartReplyMessageFactoryTest { final int DESC_STR_LEN = 256; final int SERIAL_NUM_LEN = 32; ByteBuf bb = BufferHelper.buildBuffer("00 00 00 01 00 00 00 00"); - + String mfrDesc = "Manufacturer description"; byte[] mfrDescBytes = new byte[256]; mfrDescBytes = mfrDesc.getBytes(); bb.writeBytes(mfrDescBytes); bb.writeZero(DESC_STR_LEN - mfrDescBytes.length); - + String hwDesc = "Hardware description"; byte[] hwDescBytes = new byte[256]; hwDescBytes = hwDesc.getBytes(); bb.writeBytes(hwDescBytes); bb.writeZero(DESC_STR_LEN - hwDescBytes.length); - + String swDesc = "Software description"; byte[] swDescBytes = new byte[256]; swDescBytes = swDesc.getBytes(); bb.writeBytes(swDescBytes); bb.writeZero(DESC_STR_LEN - swDescBytes.length); - + String serialNum = "SN0123456789"; byte[] serialNumBytes = new byte[32]; serialNumBytes = serialNum.getBytes(); bb.writeBytes(serialNumBytes); bb.writeZero(SERIAL_NUM_LEN - serialNumBytes.length); - + String dpDesc = "switch3 in room 3120"; byte[] dpDescBytes = new byte[256]; dpDescBytes = dpDesc.getBytes(); bb.writeBytes(dpDescBytes); bb.writeZero(DESC_STR_LEN - dpDescBytes.length); - + MultipartReplyMessage builtByFactory = BufferHelper.deserialize(multipartFactory, bb); - + BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 0x00, builtByFactory.getType().getIntValue()); Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE()); @@ -161,25 +161,25 @@ public class MultipartReplyMessageFactoryTest { "00 00 00 08 "+//flowCount "00 00 00 00"//pad ); - + MultipartReplyMessage builtByFactory = BufferHelper.deserialize(multipartFactory, bb); - + BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 0x02, builtByFactory.getType().getIntValue()); Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE()); MultipartReplyAggregateCase messageCase = (MultipartReplyAggregateCase) builtByFactory.getMultipartReplyBody(); MultipartReplyAggregate message = messageCase.getMultipartReplyAggregate(); - Assert.assertEquals("Wrong packetCount", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong packetCount", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getPacketCount()); - Assert.assertEquals("Wrong byteCount", - new BigInteger(1, new byte[]{(byte) 0x0F, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong byteCount", + new BigInteger(1, new byte[]{(byte) 0x0F, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getByteCount()); - Assert.assertEquals("Wrong flowCount", - 8, + Assert.assertEquals("Wrong flowCount", + 8, message.getFlowCount().intValue()); } - + /** * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO */ @@ -192,25 +192,25 @@ public class MultipartReplyMessageFactoryTest { "FF 01 01 01 01 01 01 01 "+//lookupCount "AF 01 01 01 01 01 01 01"//matchedCount ); - + MultipartReplyMessage builtByFactory = BufferHelper.deserialize(multipartFactory, bb); - + BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 0x03, builtByFactory.getType().getIntValue()); Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE()); - + MultipartReplyTableCase messageCase = (MultipartReplyTableCase) builtByFactory.getMultipartReplyBody(); MultipartReplyTable message = messageCase.getMultipartReplyTable(); Assert.assertEquals("Wrong tableId", 8, message.getTableStats().get(0).getTableId().intValue()); Assert.assertEquals("Wrong activeCount", 16, message.getTableStats().get(0).getActiveCount().longValue()); - Assert.assertEquals("Wrong lookupCount", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong lookupCount", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getTableStats().get(0).getLookupCount()); - Assert.assertEquals("Wrong matchedCount", - new BigInteger(1, new byte[]{(byte) 0xAF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong matchedCount", + new BigInteger(1, new byte[]{(byte) 0xAF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getTableStats().get(0).getMatchedCount()); } - + /** * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO */ @@ -234,55 +234,55 @@ public class MultipartReplyMessageFactoryTest { "00 00 00 02 "+//durationSec "00 00 00 04"//durationNsec ); - + MultipartReplyMessage builtByFactory = BufferHelper.deserialize(multipartFactory, bb); - + BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 0x04, builtByFactory.getType().getIntValue()); Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE()); MultipartReplyPortStatsCase messageCase = (MultipartReplyPortStatsCase) builtByFactory.getMultipartReplyBody(); MultipartReplyPortStats message = messageCase.getMultipartReplyPortStats(); Assert.assertEquals("Wrong portNo", 255, message.getPortStats().get(0).getPortNo().intValue()); - Assert.assertEquals("Wrong rxPackets", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong rxPackets", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getPortStats().get(0).getRxPackets()); - Assert.assertEquals("Wrong txPackets", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), + Assert.assertEquals("Wrong txPackets", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), message.getPortStats().get(0).getTxPackets()); - Assert.assertEquals("Wrong rxBytes", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong rxBytes", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getRxBytes()); - Assert.assertEquals("Wrong txBytes", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong txBytes", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getTxBytes()); - Assert.assertEquals("Wrong rxDropped", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong rxDropped", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getRxDropped()); - Assert.assertEquals("Wrong txDropped", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong txDropped", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getTxDropped()); - Assert.assertEquals("Wrong rxErrors", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong rxErrors", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getRxErrors()); - Assert.assertEquals("Wrong txErrors", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong txErrors", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getTxErrors()); - Assert.assertEquals("Wrong rxFrameErr", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong rxFrameErr", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getRxFrameErr()); - Assert.assertEquals("Wrong rxOverErr", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong rxOverErr", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getRxOverErr()); - Assert.assertEquals("Wrong rxCrcErr", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong rxCrcErr", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getRxCrcErr()); - Assert.assertEquals("Wrong collisions", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong collisions", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getCollisions()); Assert.assertEquals("Wrong durationSec", 2, message.getPortStats().get(0).getDurationSec().intValue()); Assert.assertEquals("Wrong durationNsec", 4, message.getPortStats().get(0).getDurationNsec().intValue()); } - + /** * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO */ @@ -297,9 +297,9 @@ public class MultipartReplyMessageFactoryTest { "00 00 00 02 "+//durationSec "00 00 00 04"//durationNsec ); - + MultipartReplyMessage builtByFactory = BufferHelper.deserialize(multipartFactory, bb); - + BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 0x05, builtByFactory.getType().getIntValue()); Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE()); @@ -307,19 +307,19 @@ public class MultipartReplyMessageFactoryTest { MultipartReplyQueue message = messageCase.getMultipartReplyQueue(); Assert.assertEquals("Wrong portNo", 255, message.getQueueStats().get(0).getPortNo().intValue()); Assert.assertEquals("Wrong queueId", 16, message.getQueueStats().get(0).getQueueId().intValue()); - Assert.assertEquals("Wrong txBytes", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong txBytes", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getQueueStats().get(0).getTxBytes()); - Assert.assertEquals("Wrong txPackets", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), + Assert.assertEquals("Wrong txPackets", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), message.getQueueStats().get(0).getTxPackets()); - Assert.assertEquals("Wrong txErrors", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong txErrors", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getQueueStats().get(0).getTxErrors()); Assert.assertEquals("Wrong durationSec", 2, message.getQueueStats().get(0).getDurationSec().intValue()); Assert.assertEquals("Wrong durationNsec", 4, message.getQueueStats().get(0).getDurationNsec().intValue()); } - + /** * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO */ @@ -353,9 +353,9 @@ public class MultipartReplyMessageFactoryTest { "FF 02 02 02 02 02 02 02 "+//packetCountBucket_2.2 "FF 02 02 02 02 02 02 02"//byteCountBucket_2.2 ); - + MultipartReplyMessage builtByFactory = BufferHelper.deserialize(multipartFactory, bb); - + BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 0x06, builtByFactory.getType().getIntValue()); Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE()); @@ -363,48 +363,48 @@ public class MultipartReplyMessageFactoryTest { MultipartReplyGroup message = messageCase.getMultipartReplyGroup(); Assert.assertEquals("Wrong groupId", 16, message.getGroupStats().get(0).getGroupId().getValue().intValue()); Assert.assertEquals("Wrong refCount", 18, message.getGroupStats().get(0).getRefCount().intValue()); - Assert.assertEquals("Wrong packetCount", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong packetCount", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getGroupStats().get(0).getPacketCount()); - Assert.assertEquals("Wrong byteCount", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong byteCount", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getGroupStats().get(0).getByteCount()); Assert.assertEquals("Wrong durationSec", 8, message.getGroupStats().get(0).getDurationSec().intValue()); Assert.assertEquals("Wrong durationNsec", 9, message.getGroupStats().get(0).getDurationNsec().intValue()); - Assert.assertEquals("Wrong packetCountBucket", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong packetCountBucket", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getGroupStats().get(0).getBucketStats().get(0).getPacketCount()); - Assert.assertEquals("Wrong byteCountBucket", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong byteCountBucket", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getGroupStats().get(0).getBucketStats().get(0).getByteCount()); - Assert.assertEquals("Wrong packetCountBucket_2", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), + Assert.assertEquals("Wrong packetCountBucket_2", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), message.getGroupStats().get(0).getBucketStats().get(1).getPacketCount()); - Assert.assertEquals("Wrong byteCountBucket_2", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), + Assert.assertEquals("Wrong byteCountBucket_2", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), message.getGroupStats().get(0).getBucketStats().get(1).getByteCount()); - + Assert.assertEquals("Wrong groupId_2", 16, message.getGroupStats().get(1).getGroupId().getValue().intValue()); Assert.assertEquals("Wrong refCount_2", 18, message.getGroupStats().get(1).getRefCount().intValue()); - Assert.assertEquals("Wrong packetCount_2", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong packetCount_2", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getGroupStats().get(1).getPacketCount()); - Assert.assertEquals("Wrong byteCount_2", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong byteCount_2", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getGroupStats().get(1).getByteCount()); Assert.assertEquals("Wrong durationSec_2", 8, message.getGroupStats().get(1).getDurationSec().intValue()); Assert.assertEquals("Wrong durationNsec_2", 9, message.getGroupStats().get(1).getDurationNsec().intValue()); - Assert.assertEquals("Wrong packetCountBucket_1.2", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong packetCountBucket_1.2", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getGroupStats().get(1).getBucketStats().get(0).getPacketCount()); - Assert.assertEquals("Wrong byteCountBucket_1.2", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong byteCountBucket_1.2", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getGroupStats().get(1).getBucketStats().get(0).getByteCount()); - Assert.assertEquals("Wrong packetCountBucket_2.2", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), + Assert.assertEquals("Wrong packetCountBucket_2.2", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), message.getGroupStats().get(1).getBucketStats().get(1).getPacketCount()); - Assert.assertEquals("Wrong byteCountBucket_2.2", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), + Assert.assertEquals("Wrong byteCountBucket_2.2", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), message.getGroupStats().get(1).getBucketStats().get(1).getByteCount()); } @@ -429,48 +429,48 @@ public class MultipartReplyMessageFactoryTest { "FF 03 03 03 03 03 03 03 "+//packetBandCount_03 "FF 03 03 03 03 03 03 03"//byteBandCount_03 ); - + MultipartReplyMessage builtByFactory = BufferHelper.deserialize(multipartFactory, bb); - + BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 9, builtByFactory.getType().getIntValue()); Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE()); MultipartReplyMeterCase messageCase = (MultipartReplyMeterCase) builtByFactory.getMultipartReplyBody(); MultipartReplyMeter message = messageCase.getMultipartReplyMeter(); - Assert.assertEquals("Wrong meterId", 9, + Assert.assertEquals("Wrong meterId", 9, message.getMeterStats().get(0).getMeterId().getValue().intValue()); - Assert.assertEquals("Wrong flowCount", 7, + Assert.assertEquals("Wrong flowCount", 7, message.getMeterStats().get(0).getFlowCount().intValue()); - Assert.assertEquals("Wrong packetInCount", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong packetInCount", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getMeterStats().get(0).getPacketInCount()); - Assert.assertEquals("Wrong byteInCount", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong byteInCount", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getMeterStats().get(0).getByteInCount()); - Assert.assertEquals("Wrong durationSec", 5, + Assert.assertEquals("Wrong durationSec", 5, message.getMeterStats().get(0).getDurationSec().intValue()); - Assert.assertEquals("Wrong durationNsec", 5, + Assert.assertEquals("Wrong durationNsec", 5, message.getMeterStats().get(0).getDurationNsec().intValue()); - Assert.assertEquals("Wrong packetBandCount_01", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong packetBandCount_01", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getMeterStats().get(0).getMeterBandStats().get(0).getPacketBandCount()); - Assert.assertEquals("Wrong byteBandCount_01", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong byteBandCount_01", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getMeterStats().get(0).getMeterBandStats().get(0).getByteBandCount()); - Assert.assertEquals("Wrong packetBandCount_02", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), + Assert.assertEquals("Wrong packetBandCount_02", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), message.getMeterStats().get(0).getMeterBandStats().get(1).getPacketBandCount()); - Assert.assertEquals("Wrong byteBandCount_02", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), + Assert.assertEquals("Wrong byteBandCount_02", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), message.getMeterStats().get(0).getMeterBandStats().get(1).getByteBandCount()); - Assert.assertEquals("Wrong packetBandCount_03", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), + Assert.assertEquals("Wrong packetBandCount_03", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), message.getMeterStats().get(0).getMeterBandStats().get(2).getPacketBandCount()); - Assert.assertEquals("Wrong byteBandCount_03", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), + Assert.assertEquals("Wrong byteBandCount_03", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), message.getMeterStats().get(0).getMeterBandStats().get(2).getByteBandCount()); } - + /** * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO */ @@ -506,81 +506,81 @@ public class MultipartReplyMessageFactoryTest { "FF 03 03 03 03 03 03 03 "+//packetBandCount_13 "FF 03 03 03 03 03 03 03"//byteBandCount_13 ); - + MultipartReplyMessage builtByFactory = BufferHelper.deserialize(multipartFactory, bb); - + BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 9, builtByFactory.getType().getIntValue()); Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE()); MultipartReplyMeterCase messageCase = (MultipartReplyMeterCase) builtByFactory.getMultipartReplyBody(); - MultipartReplyMeter message = messageCase.getMultipartReplyMeter(); - Assert.assertEquals("Wrong meterId", 9, + MultipartReplyMeter message = messageCase.getMultipartReplyMeter(); + Assert.assertEquals("Wrong meterId", 9, message.getMeterStats().get(0).getMeterId().getValue().intValue()); - Assert.assertEquals("Wrong flowCount", 7, + Assert.assertEquals("Wrong flowCount", 7, message.getMeterStats().get(0).getFlowCount().intValue()); - Assert.assertEquals("Wrong packetInCount", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong packetInCount", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getMeterStats().get(0).getPacketInCount()); - Assert.assertEquals("Wrong byteInCount", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong byteInCount", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getMeterStats().get(0).getByteInCount()); - Assert.assertEquals("Wrong durationSec", 5, + Assert.assertEquals("Wrong durationSec", 5, message.getMeterStats().get(0).getDurationSec().intValue()); - Assert.assertEquals("Wrong durationNsec", 5, + Assert.assertEquals("Wrong durationNsec", 5, message.getMeterStats().get(0).getDurationNsec().intValue()); - Assert.assertEquals("Wrong packetBandCount_01", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong packetBandCount_01", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getMeterStats().get(0).getMeterBandStats().get(0).getPacketBandCount()); - Assert.assertEquals("Wrong byteBandCount_01", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong byteBandCount_01", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getMeterStats().get(0).getMeterBandStats().get(0).getByteBandCount()); - Assert.assertEquals("Wrong packetBandCount_02", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), + Assert.assertEquals("Wrong packetBandCount_02", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), message.getMeterStats().get(0).getMeterBandStats().get(1).getPacketBandCount()); - Assert.assertEquals("Wrong byteBandCount_02", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), + Assert.assertEquals("Wrong byteBandCount_02", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), message.getMeterStats().get(0).getMeterBandStats().get(1).getByteBandCount()); - Assert.assertEquals("Wrong packetBandCount_03", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), + Assert.assertEquals("Wrong packetBandCount_03", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), message.getMeterStats().get(0).getMeterBandStats().get(2).getPacketBandCount()); - Assert.assertEquals("Wrong byteBandCount_03", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), + Assert.assertEquals("Wrong byteBandCount_03", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), message.getMeterStats().get(0).getMeterBandStats().get(2).getByteBandCount()); - - Assert.assertEquals("Wrong meterId", 8, + + Assert.assertEquals("Wrong meterId", 8, message.getMeterStats().get(1).getMeterId().getValue().intValue()); - Assert.assertEquals("Wrong flowCount", 7, + Assert.assertEquals("Wrong flowCount", 7, message.getMeterStats().get(1).getFlowCount().intValue()); - Assert.assertEquals("Wrong packetInCount", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong packetInCount", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getMeterStats().get(1).getPacketInCount()); - Assert.assertEquals("Wrong byteInCount", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong byteInCount", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getMeterStats().get(1).getByteInCount()); - Assert.assertEquals("Wrong durationSec", 5, + Assert.assertEquals("Wrong durationSec", 5, message.getMeterStats().get(1).getDurationSec().intValue()); - Assert.assertEquals("Wrong durationNsec", 5, + Assert.assertEquals("Wrong durationNsec", 5, message.getMeterStats().get(1).getDurationNsec().intValue()); - Assert.assertEquals("Wrong packetBandCount_01", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong packetBandCount_01", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getMeterStats().get(1).getMeterBandStats().get(0).getPacketBandCount()); - Assert.assertEquals("Wrong byteBandCount_01", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong byteBandCount_01", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getMeterStats().get(1).getMeterBandStats().get(0).getByteBandCount()); - Assert.assertEquals("Wrong packetBandCount_02", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), + Assert.assertEquals("Wrong packetBandCount_02", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), message.getMeterStats().get(1).getMeterBandStats().get(1).getPacketBandCount()); - Assert.assertEquals("Wrong byteBandCount_02", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), + Assert.assertEquals("Wrong byteBandCount_02", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), message.getMeterStats().get(1).getMeterBandStats().get(1).getByteBandCount()); - Assert.assertEquals("Wrong packetBandCount_03", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), + Assert.assertEquals("Wrong packetBandCount_03", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), message.getMeterStats().get(1).getMeterBandStats().get(2).getPacketBandCount()); - Assert.assertEquals("Wrong byteBandCount_03", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), + Assert.assertEquals("Wrong byteBandCount_03", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}), message.getMeterStats().get(1).getMeterBandStats().get(2).getByteBandCount()); } - + /** * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO */ @@ -601,33 +601,33 @@ public class MultipartReplyMessageFactoryTest { "00 00 00 20 "+//meterBandDscp.burstSize "04 "+//meterBandDscp.precLevel "00 00 00");//meterBandDscp.pad - + MultipartReplyMessage builtByFactory = BufferHelper.deserialize(multipartFactory, bb); - + BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 10, builtByFactory.getType().getIntValue()); Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE()); MultipartReplyMeterConfigCase messageCase = (MultipartReplyMeterConfigCase) builtByFactory.getMultipartReplyBody(); - MultipartReplyMeterConfig message = messageCase.getMultipartReplyMeterConfig(); + MultipartReplyMeterConfig message = messageCase.getMultipartReplyMeterConfig(); Assert.assertEquals("Wrong flags", new MeterFlags(false, false, true, true), message.getMeterConfig().get(0).getFlags()); - Assert.assertEquals("Wrong meterId", 9, + Assert.assertEquals("Wrong meterId", 9, message.getMeterConfig().get(0).getMeterId().getValue().intValue()); - - MeterBandDropCase dropCase = (MeterBandDropCase) message.getMeterConfig().get(0).getBands().get(0).getMeterBand(); + + MeterBandDropCase dropCase = (MeterBandDropCase) message.getMeterConfig().get(0).getBands().get(0).getMeterBand(); MeterBandDrop meterBandDrop = dropCase.getMeterBandDrop(); - Assert.assertEquals("Wrong meterBandDrop.type", 1, meterBandDrop.getType().getIntValue()); + Assert.assertEquals("Wrong meterBandDrop.type", 1, meterBandDrop.getType().getIntValue()); Assert.assertEquals("Wrong meterBandDrop.rate", 17, meterBandDrop.getRate().intValue()); Assert.assertEquals("Wrong meterBandDrop.burstSize", 32, meterBandDrop.getBurstSize().intValue()); - - MeterBandDscpRemarkCase dscpCase = (MeterBandDscpRemarkCase) message.getMeterConfig().get(0).getBands().get(1).getMeterBand(); + + MeterBandDscpRemarkCase dscpCase = (MeterBandDscpRemarkCase) message.getMeterConfig().get(0).getBands().get(1).getMeterBand(); MeterBandDscpRemark meterBandDscp = dscpCase.getMeterBandDscpRemark(); - Assert.assertEquals("Wrong meterBandDscp.type", 2, meterBandDscp.getType().getIntValue()); + Assert.assertEquals("Wrong meterBandDscp.type", 2, meterBandDscp.getType().getIntValue()); Assert.assertEquals("Wrong meterBandDscp.rate", 17, meterBandDscp.getRate().intValue()); Assert.assertEquals("Wrong meterBandDscp.burstSize", 32, meterBandDscp.getBurstSize().intValue()); Assert.assertEquals("Wrong meterBandDscp.precLevel", 4, meterBandDscp.getPrecLevel().intValue()); } - + /** * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO */ @@ -648,7 +648,7 @@ public class MultipartReplyMessageFactoryTest { "00 00 00 20 "+//meterBandDscp.burstSize "04 "+//meterBandDscp.precLevel "00 00 00 "+//meterBandDscp.pad - + "00 18 "+//len01 "00 03 "+//flags01 "00 00 00 07 "+//meterId01 @@ -659,45 +659,45 @@ public class MultipartReplyMessageFactoryTest { "04 "+//meterBandDscp01.precLevel "00 00 00"//meterBandDscp01.pad ); - + MultipartReplyMessage builtByFactory = BufferHelper.deserialize(multipartFactory, bb); - + BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 10, builtByFactory.getType().getIntValue()); Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE()); MultipartReplyMeterConfigCase messageCase = (MultipartReplyMeterConfigCase) builtByFactory.getMultipartReplyBody(); - MultipartReplyMeterConfig message = messageCase.getMultipartReplyMeterConfig(); - Assert.assertEquals("Wrong flags", new MeterFlags(true, false, true, false), + MultipartReplyMeterConfig message = messageCase.getMultipartReplyMeterConfig(); + Assert.assertEquals("Wrong flags", new MeterFlags(true, false, true, false), message.getMeterConfig().get(0).getFlags()); - Assert.assertEquals("Wrong meterId", 9, + Assert.assertEquals("Wrong meterId", 9, message.getMeterConfig().get(0).getMeterId().getValue().intValue()); - - MeterBandDropCase dropCase = (MeterBandDropCase) message.getMeterConfig().get(0).getBands().get(0).getMeterBand(); - MeterBandDrop meterBandDrop = dropCase.getMeterBandDrop(); - Assert.assertEquals("Wrong meterBandDrop.type", 1, meterBandDrop.getType().getIntValue()); + + MeterBandDropCase dropCase = (MeterBandDropCase) message.getMeterConfig().get(0).getBands().get(0).getMeterBand(); + MeterBandDrop meterBandDrop = dropCase.getMeterBandDrop(); + Assert.assertEquals("Wrong meterBandDrop.type", 1, meterBandDrop.getType().getIntValue()); Assert.assertEquals("Wrong meterBandDrop.rate", 17, meterBandDrop.getRate().intValue()); Assert.assertEquals("Wrong meterBandDrop.burstSize", 32, meterBandDrop.getBurstSize().intValue()); - - MeterBandDscpRemarkCase dscpCase = (MeterBandDscpRemarkCase) message.getMeterConfig().get(0).getBands().get(1).getMeterBand(); + + MeterBandDscpRemarkCase dscpCase = (MeterBandDscpRemarkCase) message.getMeterConfig().get(0).getBands().get(1).getMeterBand(); MeterBandDscpRemark meterBandDscp = dscpCase.getMeterBandDscpRemark(); - Assert.assertEquals("Wrong meterBandDscp.type", 2, meterBandDscp.getType().getIntValue()); + Assert.assertEquals("Wrong meterBandDscp.type", 2, meterBandDscp.getType().getIntValue()); Assert.assertEquals("Wrong meterBandDscp.rate", 17, meterBandDscp.getRate().intValue()); Assert.assertEquals("Wrong meterBandDscp.burstSize", 32, meterBandDscp.getBurstSize().intValue()); Assert.assertEquals("Wrong meterBandDscp.precLevel", 4, meterBandDscp.getPrecLevel().intValue()); - + LOGGER.info(message.getMeterConfig().get(0).getFlags().toString()); Assert.assertEquals("Wrong flags01", new MeterFlags(false, true, true, false), message.getMeterConfig().get(1).getFlags()); - Assert.assertEquals("Wrong meterId01", 7, + Assert.assertEquals("Wrong meterId01", 7, message.getMeterConfig().get(1).getMeterId().getValue().intValue()); - - MeterBandDscpRemarkCase dscpCase01 = (MeterBandDscpRemarkCase) message.getMeterConfig().get(1).getBands().get(0).getMeterBand(); + + MeterBandDscpRemarkCase dscpCase01 = (MeterBandDscpRemarkCase) message.getMeterConfig().get(1).getBands().get(0).getMeterBand(); MeterBandDscpRemark meterBandDscp01 = dscpCase01.getMeterBandDscpRemark(); - Assert.assertEquals("Wrong meterBandDscp01.type", 2, meterBandDscp01.getType().getIntValue()); + Assert.assertEquals("Wrong meterBandDscp01.type", 2, meterBandDscp01.getType().getIntValue()); Assert.assertEquals("Wrong meterBandDscp01.rate", 17, meterBandDscp01.getRate().intValue()); Assert.assertEquals("Wrong meterBandDscp01.burstSize", 32, meterBandDscp01.getBurstSize().intValue()); Assert.assertEquals("Wrong meterBandDscp01.precLevel", 4, meterBandDscp01.getPrecLevel().intValue()); - + } /** @@ -729,47 +729,47 @@ public class MultipartReplyMessageFactoryTest { "00 00 00 00"//copyTTLInPad ); MultipartReplyMessage builtByFactory = BufferHelper.deserialize(multipartFactory, bb); - + BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 7, builtByFactory.getType().getIntValue()); Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE()); MultipartReplyGroupDescCase messageCase = (MultipartReplyGroupDescCase) builtByFactory.getMultipartReplyBody(); MultipartReplyGroupDesc message = messageCase.getMultipartReplyGroupDesc(); - Assert.assertEquals("Wrong type", 1, + Assert.assertEquals("Wrong type", 1, message.getGroupDesc().get(0).getType().getIntValue()); - Assert.assertEquals("Wrong groupId", 8, + Assert.assertEquals("Wrong groupId", 8, message.getGroupDesc().get(0).getGroupId().getValue().intValue()); - Assert.assertEquals("Wrong bucketWeight", 6, + Assert.assertEquals("Wrong bucketWeight", 6, message.getGroupDesc().get(0).getBucketsList().get(0).getWeight().intValue()); - Assert.assertEquals("Wrong bucketWatchPort", 5, + Assert.assertEquals("Wrong bucketWatchPort", 5, message.getGroupDesc().get(0).getBucketsList().get(0).getWatchPort(). getValue().intValue()); - Assert.assertEquals("Wrong bucketWatchGroup", 4, + Assert.assertEquals("Wrong bucketWatchGroup", 4, message.getGroupDesc().get(0).getBucketsList().get(0).getWatchGroup().intValue()); - - Assert.assertEquals("Wrong outputType", Output.class, + + Assert.assertEquals("Wrong outputType", Output.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0) .getType()); - - Assert.assertEquals("Wrong outputPort", 4351, + + Assert.assertEquals("Wrong outputPort", 4351, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0) .getAugmentation(PortAction.class). getPort().getValue().intValue()); - - Assert.assertEquals("Wrong outputMaxLen", 65535, + + Assert.assertEquals("Wrong outputMaxLen", 65535, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0) .getAugmentation(MaxLengthAction.class). getMaxLength().intValue()); - - Assert.assertEquals("Wrong copyTtlOutType", CopyTtlOut.class, + + Assert.assertEquals("Wrong copyTtlOutType", CopyTtlOut.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1) .getType()); - - Assert.assertEquals("Wrong copyTtlInType", CopyTtlIn.class, + + Assert.assertEquals("Wrong copyTtlInType", CopyTtlIn.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(2) .getType()); } - + /** * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO * Test covers bodies of actions Set MPLS TTL , Dec MPLS TTL, Push VLAN. Push MPLS, Push PBB @@ -806,57 +806,57 @@ public class MultipartReplyMessageFactoryTest { "0F FF "+//pushPbbEthertype "00 00"//pushPbbPad ); - + MultipartReplyMessage builtByFactory = BufferHelper.deserialize(multipartFactory, bb); - + BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 7, builtByFactory.getType().getIntValue()); Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE()); MultipartReplyGroupDescCase messageCase = (MultipartReplyGroupDescCase) builtByFactory.getMultipartReplyBody(); - MultipartReplyGroupDesc message = messageCase.getMultipartReplyGroupDesc(); - Assert.assertEquals("Wrong type", 1, + MultipartReplyGroupDesc message = messageCase.getMultipartReplyGroupDesc(); + Assert.assertEquals("Wrong type", 1, message.getGroupDesc().get(0).getType().getIntValue()); - Assert.assertEquals("Wrong groupId", 8, + Assert.assertEquals("Wrong groupId", 8, message.getGroupDesc().get(0).getGroupId().getValue().intValue()); - Assert.assertEquals("Wrong bucketWeight", 6, + Assert.assertEquals("Wrong bucketWeight", 6, message.getGroupDesc().get(0).getBucketsList().get(0).getWeight().intValue()); - Assert.assertEquals("Wrong bucketWatchPort", 5, + Assert.assertEquals("Wrong bucketWatchPort", 5, message.getGroupDesc().get(0).getBucketsList().get(0).getWatchPort().getValue().intValue()); - Assert.assertEquals("Wrong bucketWatchGroup", 4, + Assert.assertEquals("Wrong bucketWatchGroup", 4, message.getGroupDesc().get(0).getBucketsList().get(0).getWatchGroup().intValue()); - Assert.assertEquals("Wrong setMplsTtlType", SetMplsTtl.class, + Assert.assertEquals("Wrong setMplsTtlType", SetMplsTtl.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0) .getType()); - Assert.assertEquals("Wrong setMplsTtlMPLS_TTL", 9, + Assert.assertEquals("Wrong setMplsTtlMPLS_TTL", 9, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0) .getAugmentation(MplsTtlAction.class). getMplsTtl().intValue()); - Assert.assertEquals("Wrong decMplsTtlType", DecMplsTtl.class, + Assert.assertEquals("Wrong decMplsTtlType", DecMplsTtl.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1) .getType()); - Assert.assertEquals("Wrong pushVlanType", PushVlan.class, + Assert.assertEquals("Wrong pushVlanType", PushVlan.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(2) .getType()); - Assert.assertEquals("Wrong pushVlanEthertype", 32, + Assert.assertEquals("Wrong pushVlanEthertype", 32, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(2) .getAugmentation(EthertypeAction.class). getEthertype().getValue().intValue()); - Assert.assertEquals("Wrong pushMplsType", PushMpls.class, + Assert.assertEquals("Wrong pushMplsType", PushMpls.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(3) .getType()); - Assert.assertEquals("Wrong pushMplsEthertype", 255, + Assert.assertEquals("Wrong pushMplsEthertype", 255, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(3). getAugmentation(EthertypeAction.class). getEthertype().getValue().intValue()); - Assert.assertEquals("Wrong pushPbbType", PushPbb.class, + Assert.assertEquals("Wrong pushPbbType", PushPbb.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(4) .getType()); - Assert.assertEquals("Wrong pushPbbEthertype", 4095, + Assert.assertEquals("Wrong pushPbbEthertype", 4095, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(4) .getAugmentation(EthertypeAction.class). getEthertype().getValue().intValue()); } - + /** * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO * Test covers bodies of actions Pop VLAN, Pop PBB, Pop MPLS, Group, Dec NW TTL @@ -893,54 +893,54 @@ public class MultipartReplyMessageFactoryTest { "00 08 "+//decNwTtlLen "00 00 00 00"//decNwTtlPad ); - + MultipartReplyMessage builtByFactory = BufferHelper.deserialize(multipartFactory, bb); - + BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 7, builtByFactory.getType().getIntValue()); Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE()); MultipartReplyGroupDescCase messageCase = (MultipartReplyGroupDescCase) builtByFactory.getMultipartReplyBody(); - MultipartReplyGroupDesc message = messageCase.getMultipartReplyGroupDesc(); + MultipartReplyGroupDesc message = messageCase.getMultipartReplyGroupDesc(); Assert.assertEquals("Wrong type", 1, message.getGroupDesc().get(0).getType().getIntValue()); Assert.assertEquals("Wrong groupId", 8, message.getGroupDesc().get(0).getGroupId().getValue().intValue()); - Assert.assertEquals("Wrong bucketWeight", 6, + Assert.assertEquals("Wrong bucketWeight", 6, message.getGroupDesc().get(0).getBucketsList().get(0).getWeight().intValue()); - Assert.assertEquals("Wrong bucketWatchPort", 5, + Assert.assertEquals("Wrong bucketWatchPort", 5, message.getGroupDesc().get(0).getBucketsList().get(0).getWatchPort().getValue().intValue()); - Assert.assertEquals("Wrong bucketWatchGroup", 4, + Assert.assertEquals("Wrong bucketWatchGroup", 4, message.getGroupDesc().get(0).getBucketsList().get(0).getWatchGroup().intValue()); - Assert.assertEquals("Wrong popVlanType", PopVlan.class, + Assert.assertEquals("Wrong popVlanType", PopVlan.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0) .getType()); - Assert.assertEquals("Wrong popPbbType", PopPbb.class, + Assert.assertEquals("Wrong popPbbType", PopPbb.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1) .getType()); - Assert.assertEquals("Wrong popMplsType", PopMpls.class, + Assert.assertEquals("Wrong popMplsType", PopMpls.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(2) .getType()); - Assert.assertEquals("Wrong popMplsEthertype", 207, + Assert.assertEquals("Wrong popMplsEthertype", 207, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(2) .getAugmentation(EthertypeAction.class). getEthertype().getValue().intValue()); - Assert.assertEquals("Wrong setQueueType", SetQueue.class, + Assert.assertEquals("Wrong setQueueType", SetQueue.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(3) .getType()); - Assert.assertEquals("Wrong setQueueQueueId", 13565952, + Assert.assertEquals("Wrong setQueueQueueId", 13565952, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(3) .getAugmentation(QueueIdAction.class). getQueueId().intValue()); - Assert.assertEquals("Wrong groupType", Group.class, + Assert.assertEquals("Wrong groupType", Group.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(4) .getType()); - Assert.assertEquals("Wrong groupGroupId", 13565952, + Assert.assertEquals("Wrong groupGroupId", 13565952, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(4) .getAugmentation(GroupIdAction.class). getGroupId().intValue()); - Assert.assertEquals("Wrong decNwTtlType", DecNwTtl.class, + Assert.assertEquals("Wrong decNwTtlType", DecNwTtl.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(5) .getType()); } - + /** * Testing {@link MultipartReplyMessageFactory} for correct translation into POJO * Test covers bodies of actions NW TTL, Experimenter @@ -969,47 +969,47 @@ public class MultipartReplyMessageFactoryTest { "00 00 00 FF "+ //setFieldPort "00 00 00 00" ); - + MultipartReplyMessage builtByFactory = BufferHelper.deserialize(multipartFactory, bb); - + BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 7, builtByFactory.getType().getIntValue()); Assert.assertEquals("Wrong flag", true, builtByFactory.getFlags().isOFPMPFREQMORE()); MultipartReplyGroupDescCase messageCase = (MultipartReplyGroupDescCase) builtByFactory.getMultipartReplyBody(); MultipartReplyGroupDesc message = messageCase.getMultipartReplyGroupDesc(); - Assert.assertEquals("Wrong type", 1, + Assert.assertEquals("Wrong type", 1, message.getGroupDesc().get(0).getType().getIntValue()); - Assert.assertEquals("Wrong groupId", 8, + Assert.assertEquals("Wrong groupId", 8, message.getGroupDesc().get(0).getGroupId().getValue().intValue()); - Assert.assertEquals("Wrong bucketWeight", 6, + Assert.assertEquals("Wrong bucketWeight", 6, message.getGroupDesc().get(0).getBucketsList().get(0).getWeight().intValue()); - Assert.assertEquals("Wrong bucketWatchPort", 5, + Assert.assertEquals("Wrong bucketWatchPort", 5, message.getGroupDesc().get(0).getBucketsList().get(0).getWatchPort(). getValue().intValue()); - Assert.assertEquals("Wrong bucketWatchGroup", 4, + Assert.assertEquals("Wrong bucketWatchGroup", 4, message.getGroupDesc().get(0).getBucketsList().get(0).getWatchGroup().intValue()); - - Assert.assertEquals("Wrong nwTTlType", SetNwTtl.class, + + Assert.assertEquals("Wrong nwTTlType", SetNwTtl.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0) .getType()); - - Assert.assertEquals("Wrong nwTTlnwTTL", 14, + + Assert.assertEquals("Wrong nwTTlnwTTL", 14, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0) .getAugmentation(NwTtlAction.class).getNwTtl().intValue()); - - Assert.assertEquals("Wrong setFieldType", SetField.class, + + Assert.assertEquals("Wrong setFieldType", SetField.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1) .getType()); - - Assert.assertEquals("Wrong setFieldOXMClass", OpenflowBasicClass.class, + + Assert.assertEquals("Wrong setFieldOXMClass", OpenflowBasicClass.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1) .getAugmentation(OxmFieldsAction.class).getMatchEntries().get(0).getOxmClass()); - - Assert.assertEquals("Wrong setFieldOXMField", InPort.class, + + Assert.assertEquals("Wrong setFieldOXMField", InPort.class, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1) .getAugmentation(OxmFieldsAction.class).getMatchEntries().get(0).getOxmMatchField()); - - Assert.assertEquals("Wrong setFieldOXMValue", 255, + + Assert.assertEquals("Wrong setFieldOXMValue", 255, message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1) .getAugmentation(OxmFieldsAction.class).getMatchEntries().get(0). getAugmentation(PortNumberMatchEntry.class).getPortNumber().getValue().intValue()); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10EchoReplyMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10EchoReplyMessageFactoryTest.java index 92197425..336710d5 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10EchoReplyMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10EchoReplyMessageFactoryTest.java @@ -50,7 +50,7 @@ public class OF10EchoReplyMessageFactoryTest { BufferHelper.checkHeaderV10(builtByFactory); } - + /** * Testing {@link OF10EchoReplyMessageFactory} for correct translation into POJO */ @@ -59,7 +59,7 @@ public class OF10EchoReplyMessageFactoryTest { byte[] data = new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}; ByteBuf bb = BufferHelper.buildBuffer(data); EchoOutput builtByFactory = BufferHelper.deserialize(echoFactory, bb); - + BufferHelper.checkHeaderV10(builtByFactory); Assert.assertArrayEquals("Wrong data", data, builtByFactory.getData()); } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10EchoRequestMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10EchoRequestMessageFactoryTest.java index 96fd0335..7684e850 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10EchoRequestMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10EchoRequestMessageFactoryTest.java @@ -50,7 +50,7 @@ public class OF10EchoRequestMessageFactoryTest { BufferHelper.checkHeaderV10(builtByFactory); } - + /** * Testing {@link OF10EchoReplyMessageFactoryTest} for correct translation into POJO */ diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10FeaturesReplyMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10FeaturesReplyMessageFactoryTest.java index 9530eaba..f5ec8f23 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10FeaturesReplyMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10FeaturesReplyMessageFactoryTest.java @@ -83,7 +83,7 @@ public class OF10FeaturesReplyMessageFactoryTest { Assert.assertEquals("Wrong port - peer", new PortFeaturesV10(true, false, false, false, false, false, false, false, true, false, false, true), port.getPeerFeaturesV10()); } - + /** * Testing {@link OF10FeaturesReplyMessageFactory} for correct translation into POJO */ diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10GetConfigReplyMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10GetConfigReplyMessageFactoryTest.java index c0d795a6..fc63e70c 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10GetConfigReplyMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10GetConfigReplyMessageFactoryTest.java @@ -49,8 +49,8 @@ public class OF10GetConfigReplyMessageFactoryTest { GetConfigOutput builtByFactory = BufferHelper.deserialize(configFactory, bb); BufferHelper.checkHeaderV10(builtByFactory); - Assert.assertEquals("Wrong switchConfigFlag", 0x01, builtByFactory.getFlags().getIntValue()); + Assert.assertEquals("Wrong switchConfigFlag", 0x01, builtByFactory.getFlags().getIntValue()); Assert.assertEquals("Wrong missSendLen", 0x03, builtByFactory.getMissSendLen().intValue()); } - + } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10PacketInMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10PacketInMessageFactoryTest.java index 62387806..57d73cb7 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10PacketInMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10PacketInMessageFactoryTest.java @@ -46,8 +46,8 @@ public class OF10PacketInMessageFactoryTest { @Test public void test(){ ByteBuf bb = BufferHelper.buildBuffer("00 01 02 03 01 02 01 02 00 00 01 02 03 04"); - PacketInMessage builtByFactory = BufferHelper.deserialize(packetInFactory, bb); - + PacketInMessage builtByFactory = BufferHelper.deserialize(packetInFactory, bb); + BufferHelper.checkHeaderV10(builtByFactory); Assert.assertEquals("Wrong bufferID", 0x00010203L, builtByFactory.getBufferId().longValue()); Assert.assertEquals("Wrong totalLength", 0x0102, builtByFactory.getTotalLen().intValue()); @@ -62,7 +62,7 @@ public class OF10PacketInMessageFactoryTest { @Test public void testWithNoAdditionalData(){ ByteBuf bb = BufferHelper.buildBuffer("00 01 02 03 01 02 01 02 00 00"); - PacketInMessage builtByFactory = BufferHelper.deserialize(packetInFactory, bb); + PacketInMessage builtByFactory = BufferHelper.deserialize(packetInFactory, bb); Assert.assertNull("Wrong data", builtByFactory.getData()); } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10PortStatusMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10PortStatusMessageFactoryTest.java index 6b451872..0d637522 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10PortStatusMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10PortStatusMessageFactoryTest.java @@ -54,7 +54,7 @@ public class OF10PortStatusMessageFactoryTest { + "00 10 01 01 05 01 04 02 41 4C 4F 48 41 00 00 00 00 00 00 00 00 00 00 " + "00 00 00 00 15 00 00 00 01 00 00 00 31 00 00 04 42 00 00 03 0C 00 00 08 88"); PortStatusMessage builtByFactory = BufferHelper.deserialize(statusFactory, bb); - + BufferHelper.checkHeaderV10(builtByFactory); Assert.assertEquals("Wrong reason", PortReason.OFPPRADD, builtByFactory.getReason()); Assert.assertEquals("Wrong port - port-no", 16, builtByFactory.getPortNo().intValue()); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10StatsReplyMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10StatsReplyMessageFactoryTest.java index 0e8813ea..a4740621 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10StatsReplyMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10StatsReplyMessageFactoryTest.java @@ -68,39 +68,39 @@ public class OF10StatsReplyMessageFactoryTest { final int DESC_STR_LEN = 256; final int SERIAL_NUM_LEN = 32; ByteBuf bb = BufferHelper.buildBuffer("00 00 00 00"); - + String mfrDesc = "Manufacturer description"; byte[] mfrDescBytes = new byte[256]; mfrDescBytes = mfrDesc.getBytes(); bb.writeBytes(mfrDescBytes); bb.writeZero(DESC_STR_LEN - mfrDescBytes.length); - + String hwDesc = "Hardware description"; byte[] hwDescBytes = new byte[256]; hwDescBytes = hwDesc.getBytes(); bb.writeBytes(hwDescBytes); bb.writeZero(DESC_STR_LEN - hwDescBytes.length); - + String swDesc = "Software description"; byte[] swDescBytes = new byte[256]; swDescBytes = swDesc.getBytes(); bb.writeBytes(swDescBytes); bb.writeZero(DESC_STR_LEN - swDescBytes.length); - + String serialNum = "SN0123456789"; byte[] serialNumBytes = new byte[32]; serialNumBytes = serialNum.getBytes(); bb.writeBytes(serialNumBytes); bb.writeZero(SERIAL_NUM_LEN - serialNumBytes.length); - + String dpDesc = "switch3 in room 3120"; byte[] dpDescBytes = new byte[256]; dpDescBytes = dpDesc.getBytes(); bb.writeBytes(dpDescBytes); bb.writeZero(DESC_STR_LEN - dpDescBytes.length); - + MultipartReplyMessage builtByFactory = BufferHelper.deserialize(statsFactory, bb); - + BufferHelper.checkHeaderV10(builtByFactory); Assert.assertEquals("Wrong type", 0, builtByFactory.getType().getIntValue()); Assert.assertEquals("Wrong flag", false, builtByFactory.getFlags().isOFPMPFREQMORE().booleanValue()); @@ -113,7 +113,7 @@ public class OF10StatsReplyMessageFactoryTest { Assert.assertEquals("Wrong dpDesc", "switch3 in room 3120", message.getDpDesc()); Assert.assertTrue("Unread data", bb.readableBytes() == 0); } - + /** * Testing OF10StatsReplyMessageFactory (Flow) for correct deserialization */ @@ -125,7 +125,7 @@ public class OF10StatsReplyMessageFactoryTest { + "00 00 00 02 00 00 00 03 00 04 00 05 00 06 00 00 00 00 00 00 " + "FF 01 02 03 04 05 06 07 FF 01 02 03 04 05 06 07 FF 00 00 00 00 00 00 20 " + "00 00 00 08 00 01 00 02 00 01 00 08 00 03 00 00"); - + MultipartReplyMessage builtByFactory = BufferHelper.deserialize(statsFactory, bb); BufferHelper.checkHeaderV10(builtByFactory); @@ -140,13 +140,13 @@ public class OF10StatsReplyMessageFactoryTest { Assert.assertEquals("Wrong idleTimeOut", 5, message.getFlowStats().get(0).getIdleTimeout().intValue()); Assert.assertEquals("Wrong hardTimeOut", 6, message.getFlowStats().get(0).getHardTimeout().intValue()); Assert.assertEquals("Wrong cookie", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}), + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}), message.getFlowStats().get(0).getCookie()); Assert.assertEquals("Wrong packetCount", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}), + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}), message.getFlowStats().get(0).getPacketCount()); Assert.assertEquals("Wrong byteCount", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20}), + new BigInteger(1, new byte[]{(byte) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20}), message.getFlowStats().get(0).getByteCount()); Action action1 = message.getFlowStats().get(0).getAction().get(0); Assert.assertEquals("Wrong action type", Output.class, action1.getType()); @@ -160,7 +160,7 @@ public class OF10StatsReplyMessageFactoryTest { .getVlanVid().intValue()); Assert.assertTrue("Unread data", bb.readableBytes() == 0); } - + /** * Testing OF10StatsReplyMessageFactory (Aggregate) for correct deserialization */ @@ -168,7 +168,7 @@ public class OF10StatsReplyMessageFactoryTest { public void testAggregate() { ByteBuf bb = BufferHelper.buildBuffer("00 02 00 01 " + "FF 01 02 03 04 05 06 07 FF 00 00 00 00 00 00 20 00 00 00 30 00 00 00 00"); - + MultipartReplyMessage builtByFactory = BufferHelper.deserialize(statsFactory, bb); BufferHelper.checkHeaderV10(builtByFactory); @@ -177,15 +177,15 @@ public class OF10StatsReplyMessageFactoryTest { MultipartReplyAggregateCase messageCase = (MultipartReplyAggregateCase) builtByFactory.getMultipartReplyBody(); MultipartReplyAggregate message = messageCase.getMultipartReplyAggregate(); Assert.assertEquals("Wrong packet-count", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}), + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}), message.getPacketCount()); Assert.assertEquals("Wrong byte-count", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20}), + new BigInteger(1, new byte[]{(byte) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20}), message.getByteCount()); Assert.assertEquals("Wrong flow-count", 48, message.getFlowCount().intValue()); Assert.assertTrue("Unread data", bb.readableBytes() == 0); } - + /** * Testing OF10StatsReplyMessageFactory (Table) for correct deserialization */ @@ -212,15 +212,15 @@ public class OF10StatsReplyMessageFactoryTest { Assert.assertEquals("Wrong dst-mask", 32, message.getTableStats().get(0).getNwDstMask().intValue()); Assert.assertEquals("Wrong max-entries", 48, message.getTableStats().get(0).getMaxEntries().longValue()); Assert.assertEquals("Wrong activeCount", 16, message.getTableStats().get(0).getActiveCount().longValue()); - Assert.assertEquals("Wrong lookupCount", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong lookupCount", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getTableStats().get(0).getLookupCount()); - Assert.assertEquals("Wrong matchedCount", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00}), + Assert.assertEquals("Wrong matchedCount", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00}), message.getTableStats().get(0).getMatchedCount()); Assert.assertTrue("Unread data", bb.readableBytes() == 0); } - + /** * Testing OF10StatsReplyMessageFactory (Port) for correct deserialization */ @@ -243,45 +243,45 @@ public class OF10StatsReplyMessageFactoryTest { MultipartReplyPortStatsCase messageCase = (MultipartReplyPortStatsCase) builtByFactory.getMultipartReplyBody(); MultipartReplyPortStats message = messageCase.getMultipartReplyPortStats(); Assert.assertEquals("Wrong portNo", 255, message.getPortStats().get(0).getPortNo().intValue()); - Assert.assertEquals("Wrong rxPackets", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), + Assert.assertEquals("Wrong rxPackets", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}), message.getPortStats().get(0).getRxPackets()); - Assert.assertEquals("Wrong txPackets", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), + Assert.assertEquals("Wrong txPackets", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), message.getPortStats().get(0).getTxPackets()); - Assert.assertEquals("Wrong rxBytes", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong rxBytes", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getRxBytes()); - Assert.assertEquals("Wrong txBytes", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong txBytes", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getTxBytes()); - Assert.assertEquals("Wrong rxDropped", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong rxDropped", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getRxDropped()); - Assert.assertEquals("Wrong txDropped", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong txDropped", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getTxDropped()); - Assert.assertEquals("Wrong rxErrors", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong rxErrors", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getRxErrors()); - Assert.assertEquals("Wrong txErrors", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong txErrors", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getTxErrors()); - Assert.assertEquals("Wrong rxFrameErr", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong rxFrameErr", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getRxFrameErr()); - Assert.assertEquals("Wrong rxOverErr", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong rxOverErr", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getRxOverErr()); - Assert.assertEquals("Wrong rxCrcErr", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong rxCrcErr", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getRxCrcErr()); - Assert.assertEquals("Wrong collisions", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong collisions", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getPortStats().get(0).getCollisions()); Assert.assertTrue("Unread data", bb.readableBytes() == 0); } - + /** * Testing OF10StatsReplyMessageFactory (Queue) for correct deserialization */ @@ -302,14 +302,14 @@ public class OF10StatsReplyMessageFactoryTest { MultipartReplyQueue message = messageCase.getMultipartReplyQueue(); Assert.assertEquals("Wrong portNo", 255, message.getQueueStats().get(0).getPortNo().intValue()); Assert.assertEquals("Wrong queueId", 16, message.getQueueStats().get(0).getQueueId().intValue()); - Assert.assertEquals("Wrong txBytes", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong txBytes", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getQueueStats().get(0).getTxBytes()); - Assert.assertEquals("Wrong txPackets", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), + Assert.assertEquals("Wrong txPackets", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}), message.getQueueStats().get(0).getTxPackets()); - Assert.assertEquals("Wrong txErrors", - new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), + Assert.assertEquals("Wrong txErrors", + new BigInteger(1, new byte[]{(byte) 0xFF, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02}), message.getQueueStats().get(0).getTxErrors()); Assert.assertTrue("Unread data", bb.readableBytes() == 0); } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/PacketInMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/PacketInMessageFactoryTest.java index a154ad4b..b30df2f8 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/PacketInMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/PacketInMessageFactoryTest.java @@ -50,10 +50,10 @@ public class PacketInMessageFactoryTest { public void test(){ ByteBuf bb = BufferHelper.buildBuffer("00 01 02 03 01 02 01 04 00 01 02 03 04 05 06 07 00 01 00 0C" + " 80 00 02 04 00 00 00 01 00 00 00 00 00 00 01 02 03 04"); - PacketInMessage builtByFactory = BufferHelper.deserialize(packetInFactory, bb); - + PacketInMessage builtByFactory = BufferHelper.deserialize(packetInFactory, bb); + BufferHelper.checkHeaderV13(builtByFactory); - + Assert.assertEquals("Wrong bufferID", 0x00010203L, builtByFactory.getBufferId().longValue()); Assert.assertEquals("Wrong totalLength", 0x0102, builtByFactory.getTotalLen().intValue()); Assert.assertEquals("Wrong reason", PacketInReason.OFPRACTION, builtByFactory.getReason()); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/PortStatusMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/PortStatusMessageFactoryTest.java index cf0499ae..79ee3fd9 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/PortStatusMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/PortStatusMessageFactoryTest.java @@ -50,7 +50,7 @@ public class PortStatusMessageFactoryTest { */ @Test public void test(){ - ByteBuf bb = BufferHelper.buildBuffer("01 " + //reason + ByteBuf bb = BufferHelper.buildBuffer("01 " + //reason "00 00 00 00 00 00 00 " + //padding "00 01 02 03 " + //port no "00 00 00 00 " + //padding in ofp_port1 @@ -66,9 +66,9 @@ public class PortStatusMessageFactoryTest { "00 00 00 81 " + //curr speed "00 00 00 80" //max speed ); - + PortStatusMessage builtByFactory = BufferHelper.deserialize(statusFactory, bb); - + BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong reason", 0x01, builtByFactory.getReason().getIntValue()); Assert.assertEquals("Wrong portNumber", 66051L, builtByFactory.getPortNo().longValue()); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/QueueGetConfigReplyMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/QueueGetConfigReplyMessageFactoryTest.java index ab4ef3a6..cc2f4eab 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/QueueGetConfigReplyMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/QueueGetConfigReplyMessageFactoryTest.java @@ -63,7 +63,7 @@ public class QueueGetConfigReplyMessageFactoryTest { Assert.assertEquals("Wrong port", 3L, builtByFactory.getPort().getValue().longValue()); Assert.assertEquals("Wrong queues", builtByFactory.getQueues(), createQueuesList()); } - + private static List createQueuesList(){ List queuesList = new ArrayList<>(); QueuesBuilder qb = new QueuesBuilder(); @@ -71,10 +71,10 @@ public class QueueGetConfigReplyMessageFactoryTest { qb.setPort(new PortNumber(3L)); qb.setQueueProperty(createPropertiesList()); queuesList.add(qb.build()); - + return queuesList; } - + private static List createPropertiesList(){ List propertiesList = new ArrayList<>(); QueuePropertyBuilder pb = new QueuePropertyBuilder(); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/RoleReplyMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/RoleReplyMessageFactoryTest.java index e41e53b6..2f7a81d8 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/RoleReplyMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/RoleReplyMessageFactoryTest.java @@ -49,7 +49,7 @@ public class RoleReplyMessageFactoryTest { RoleRequestOutput builtByFactory = BufferHelper.deserialize(roleFactory, bb); BufferHelper.checkHeaderV13(builtByFactory); - + Assert.assertEquals("Wrong role", 0x02, builtByFactory.getRole().getIntValue()); Assert.assertEquals("Wrong generationId", 0x01020304050607L, builtByFactory.getGenerationId().longValue()); } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmIpv6FlabelDeserializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmIpv6FlabelDeserializerTest.java index 2c29dce1..17bc3abd 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmIpv6FlabelDeserializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmIpv6FlabelDeserializerTest.java @@ -38,7 +38,7 @@ public class OxmIpv6FlabelDeserializerTest { Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry.getOxmClass()); Assert.assertEquals("Wrong entry field", Ipv6Flabel.class, entry.getOxmMatchField()); Assert.assertEquals("Wrong entry hasMask", false, entry.isHasMask()); - Assert.assertEquals("Wrong entry value", 2, + Assert.assertEquals("Wrong entry value", 2, entry.getAugmentation(Ipv6FlabelMatchEntry.class).getIpv6Flabel().getValue().intValue()); } } \ No newline at end of file diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmMetadataDeserializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmMetadataDeserializerTest.java index d0983876..c2f61840 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmMetadataDeserializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmMetadataDeserializerTest.java @@ -39,7 +39,7 @@ public class OxmMetadataDeserializerTest { Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry.getOxmClass()); Assert.assertEquals("Wrong entry field", Metadata.class, entry.getOxmMatchField()); Assert.assertEquals("Wrong entry hasMask", false, entry.isHasMask()); - Assert.assertArrayEquals("Wrong entry value", ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 03"), + Assert.assertArrayEquals("Wrong entry value", ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 03"), entry.getAugmentation(MetadataMatchEntry.class).getMetadata()); } } \ No newline at end of file diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmVlanVidDeserializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmVlanVidDeserializerTest.java index e765ba65..5962ac37 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmVlanVidDeserializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/match/OxmVlanVidDeserializerTest.java @@ -40,7 +40,7 @@ public class OxmVlanVidDeserializerTest { Assert.assertEquals("Wrong entry hasMask", false, entry.isHasMask()); Assert.assertEquals("Wrong entry value", 10, entry.getAugmentation(VlanVidMatchEntry.class).getVlanVid().intValue()); - Assert.assertEquals("Wrong entry value", false, + Assert.assertEquals("Wrong entry value", false, entry.getAugmentation(VlanVidMatchEntry.class).isCfiBit()); } } \ No newline at end of file diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/SerializerRegistryImplTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/SerializerRegistryImplTest.java index c398e47d..df7e83bf 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/SerializerRegistryImplTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/SerializerRegistryImplTest.java @@ -15,12 +15,12 @@ import org.opendaylight.openflowjava.protocol.impl.util.OF13MatchSerializer; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match; /** - * + * * @author madamjak * */ public class SerializerRegistryImplTest { - + private static final short OF13 = EncodeConstants.OF13_VERSION_ID; private static final short OF10 = EncodeConstants.OF10_VERSION_ID; @@ -46,7 +46,7 @@ public class SerializerRegistryImplTest { } /** - * Test - unregister serializer + * Test - unregister serializer */ @Test public void testUnRegisterSerializer(){ diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/BarrierInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/BarrierInputMessageFactoryTest.java index 9584bf62..1e5f475c 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/BarrierInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/BarrierInputMessageFactoryTest.java @@ -45,17 +45,17 @@ public class BarrierInputMessageFactoryTest { /** * Testing of {@link BarrierInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void test() throws Exception { BarrierInputBuilder bib = new BarrierInputBuilder(); BufferHelper.setupHeader(bib, EncodeConstants.OF13_VERSION_ID); BarrierInput bi = bib.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); barrierFactory.serialize(bi, out); - + BufferHelper.checkHeaderV13(out, BARRIER_REQUEST_MESSAGE_CODE_TYPE, 8); } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoInputMessageFactoryTest.java index f9df80d2..cf00e1c2 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoInputMessageFactoryTest.java @@ -46,7 +46,7 @@ public class EchoInputMessageFactoryTest { /** * Testing of {@link EchoInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testV13() throws Exception { @@ -57,10 +57,10 @@ public class EchoInputMessageFactoryTest { echoFactory.serialize(ei, out); BufferHelper.checkHeaderV13(out, ECHO_REQUEST_MESSAGE_CODE_TYPE, 8); } - + /** * Testing of {@link EchoInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testV10() throws Exception { @@ -74,7 +74,7 @@ public class EchoInputMessageFactoryTest { /** * Testing of {@link EchoInputMessageFactory} for correct data serialization - * @throws Exception + * @throws Exception */ @Test public void testData() throws Exception{ diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoReplyInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoReplyInputMessageFactoryTest.java index 64a5f078..be4130a0 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoReplyInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/EchoReplyInputMessageFactoryTest.java @@ -45,7 +45,7 @@ public class EchoReplyInputMessageFactoryTest { /** * Testing of {@link EchoReplyInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testV13() throws Exception { @@ -56,10 +56,10 @@ public class EchoReplyInputMessageFactoryTest { echoFactory.serialize(eri, out); BufferHelper.checkHeaderV13(out, ECHO_REPLY_MESSAGE_CODE_TYPE, 8); } - + /** * Testing of {@link EchoReplyInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testV10() throws Exception { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/ExperimenterInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/ExperimenterInputMessageFactoryTest.java index 77cc5c32..47235595 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/ExperimenterInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/ExperimenterInputMessageFactoryTest.java @@ -56,7 +56,7 @@ public class ExperimenterInputMessageFactoryTest { /** * Testing of {@link ExperimenterInputMessageFactory} for correct serializer * lookup and serialization - * @throws Exception + * @throws Exception */ @Test(expected=IllegalStateException.class) public void testV10Real() throws Exception { @@ -65,7 +65,7 @@ public class ExperimenterInputMessageFactoryTest { BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID); builder.setExperimenter(new ExperimenterId(42L)); ExperimenterInput input = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); expFactory.serialize(input, out); } @@ -73,7 +73,7 @@ public class ExperimenterInputMessageFactoryTest { /** * Testing of {@link ExperimenterInputMessageFactory} for correct serializer * lookup and serialization - * @throws Exception + * @throws Exception */ @Test(expected=IllegalStateException.class) public void testV13Real() throws Exception { @@ -82,7 +82,7 @@ public class ExperimenterInputMessageFactoryTest { BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID); builder.setExperimenter(new ExperimenterId(42L)); ExperimenterInput input = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); expFactory.serialize(input, out); } @@ -90,7 +90,7 @@ public class ExperimenterInputMessageFactoryTest { /** * Testing of {@link ExperimenterInputMessageFactory} for correct serializer * lookup and serialization - * @throws Exception + * @throws Exception */ @Test public void testV10() throws Exception { @@ -110,7 +110,7 @@ public class ExperimenterInputMessageFactoryTest { /** * Testing of {@link ExperimenterInputMessageFactory} for correct serializer * lookup and serialization - * @throws Exception + * @throws Exception */ @Test public void testV13() throws Exception { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactoryTest.java index 3c5ba034..bfa59857 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactoryTest.java @@ -81,7 +81,7 @@ public class FlowModInputMessageFactoryTest { } /** - * @throws Exception + * @throws Exception * Testing of {@link FlowModInputMessageFactory} for correct translation from POJO */ @Test @@ -211,11 +211,11 @@ public class FlowModInputMessageFactoryTest { out.skipBytes(6); Assert.assertTrue("Unread data", out.readableBytes() == 0); } - + private static FlowModFlags createFlowModFlagsFromBitmap(int input){ final Boolean _oFPFFSENDFLOWREM = (input & (1 << 0)) > 0; final Boolean _oFPFFCHECKOVERLAP = (input & (1 << 1)) > 0; - final Boolean _oFPFFRESETCOUNTS = (input & (1 << 2)) > 0; + final Boolean _oFPFFRESETCOUNTS = (input & (1 << 2)) > 0; final Boolean _oFPFFNOPKTCOUNTS = (input & (1 << 3)) > 0; final Boolean _oFPFFNOBYTCOUNTS = (input & (1 << 4)) > 0; return new FlowModFlags(_oFPFFCHECKOVERLAP, _oFPFFNOBYTCOUNTS, _oFPFFNOPKTCOUNTS, _oFPFFRESETCOUNTS, _oFPFFSENDFLOWREM); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetConfigInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetConfigInputMessageFactoryTest.java index bf5a3c36..a050b299 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetConfigInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetConfigInputMessageFactoryTest.java @@ -45,33 +45,33 @@ public class GetConfigInputMessageFactoryTest { /** * Testing of {@link GetConfigInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testV13() throws Exception { GetConfigInputBuilder gcib = new GetConfigInputBuilder(); BufferHelper.setupHeader(gcib, EncodeConstants.OF13_VERSION_ID); GetConfigInput gci = gcib.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); getConfigFactory.serialize(gci, out); BufferHelper.checkHeaderV13(out, GET_CONFIG_REQUEST_MESSAGE_CODE_TYPE, 8); } - + /** * Testing of {@link GetConfigInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testV10() throws Exception { GetConfigInputBuilder gcib = new GetConfigInputBuilder(); BufferHelper.setupHeader(gcib, EncodeConstants.OF10_VERSION_ID); GetConfigInput gci = gcib.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); getConfigFactory.serialize(gci, out); - + BufferHelper.checkHeaderV10(out, GET_CONFIG_REQUEST_MESSAGE_CODE_TYPE, 8); } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetFeaturesInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetFeaturesInputMessageFactoryTest.java index 62ab4bf1..1f4a400f 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetFeaturesInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetFeaturesInputMessageFactoryTest.java @@ -45,14 +45,14 @@ public class GetFeaturesInputMessageFactoryTest { /** * Testing of {@link GetFeaturesInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testV13() throws Exception { GetFeaturesInputBuilder gfib = new GetFeaturesInputBuilder(); BufferHelper.setupHeader(gfib, EncodeConstants.OF13_VERSION_ID); GetFeaturesInput gfi = gfib.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); featuresFactory.serialize(gfi, out); @@ -61,14 +61,14 @@ public class GetFeaturesInputMessageFactoryTest { /** * Testing of {@link GetFeaturesInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testV10() throws Exception { GetFeaturesInputBuilder gfib = new GetFeaturesInputBuilder(); BufferHelper.setupHeader(gfib, EncodeConstants.OF10_VERSION_ID); GetFeaturesInput gfi = gfib.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); featuresFactory.serialize(gfi, out); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetQueueConfigInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetQueueConfigInputMessageFactoryTest.java index f1da495a..0d94cf6b 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetQueueConfigInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetQueueConfigInputMessageFactoryTest.java @@ -46,7 +46,7 @@ public class GetQueueConfigInputMessageFactoryTest { /** * Testing of {@link GetQueueConfigInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testGetQueueConfigInputMessage() throws Exception { @@ -54,7 +54,7 @@ public class GetQueueConfigInputMessageFactoryTest { BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID); builder.setPort(new PortNumber(0x00010203L)); GetQueueConfigInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); getQueueFactory.serialize(message, out); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetaAsyncRequestMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetaAsyncRequestMessageFactoryTest.java index 5cc956ac..a660f37c 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetaAsyncRequestMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetaAsyncRequestMessageFactoryTest.java @@ -45,17 +45,17 @@ public class GetaAsyncRequestMessageFactoryTest { /** * Testing of {@link GetAsyncRequestMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testGetAsyncReques() throws Exception { GetAsyncInputBuilder builder = new GetAsyncInputBuilder(); BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID); GetAsyncInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); getAsyncFactory.serialize(message, out); - + BufferHelper.checkHeaderV13(out, MESSAGE_TYPE, MESSAGE_LENGTH); } } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GroupModInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GroupModInputMessageFactoryTest.java index c5d41114..c158b706 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GroupModInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GroupModInputMessageFactoryTest.java @@ -67,7 +67,7 @@ public class GroupModInputMessageFactoryTest { List exp = createBucketsList(); builder.setBucketsList(exp); GroupModInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); groupModFactory.serialize(message, out); @@ -79,7 +79,7 @@ public class GroupModInputMessageFactoryTest { List rec = createBucketsListFromBufer(out); Assert.assertArrayEquals("Wrong bucketList", exp.toArray(), rec.toArray()); } - + private static List createBucketsList(){ List bucketsList = new ArrayList<>(); BucketsListBuilder bucketsBuilder = new BucketsListBuilder(); @@ -91,7 +91,7 @@ public class GroupModInputMessageFactoryTest { bucketsList.add(bucket); return bucketsList; } - + private static List createBucketsListFromBufer(ByteBuf out){ List bucketsList = new ArrayList<>(); BucketsListBuilder bucketsBuilder = new BucketsListBuilder(); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/HelloInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/HelloInputMessageFactoryTest.java index f971c026..e2ea0f86 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/HelloInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/HelloInputMessageFactoryTest.java @@ -55,23 +55,23 @@ public class HelloInputMessageFactoryTest { /** * Testing of {@link HelloInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testWithoutElementsSet() throws Exception { HelloInputBuilder hib = new HelloInputBuilder(); BufferHelper.setupHeader(hib, EncodeConstants.OF13_VERSION_ID); HelloInput hi = hib.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); helloFactory.serialize(hi, out); - + BufferHelper.checkHeaderV13(out,(byte) 0, EncodeConstants.OFHEADER_SIZE); } - + /** * Testing of {@link HelloInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testWith4BitVersionBitmap() throws Exception { @@ -81,21 +81,21 @@ public class HelloInputMessageFactoryTest { List expectedElement = createElement(lengthOfBitmap); builder.setElements(expectedElement); HelloInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); helloFactory.serialize(message, out); LOGGER.debug("bytebuf: " + ByteBufUtils.byteBufToHexString(out)); - + BufferHelper.checkHeaderV13(out, (byte) 0, 16); Elements element = readElement(out).get(0); Assert.assertEquals("Wrong element type", expectedElement.get(0).getType(), element.getType()); Elements comparation = createComparationElement(lengthOfBitmap).get(0); Assert.assertArrayEquals("Wrong element bitmap", comparation.getVersionBitmap().toArray(), element.getVersionBitmap().toArray()); } - + /** * Testing of {@link HelloInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testWith64BitVersionBitmap() throws Exception { @@ -105,18 +105,18 @@ public class HelloInputMessageFactoryTest { List expectedElement = createElement(lengthOfBitmap); builder.setElements(expectedElement); HelloInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); helloFactory.serialize(message, out); LOGGER.debug("bytebuf: " + ByteBufUtils.byteBufToHexString(out)); - + BufferHelper.checkHeaderV13(out, (byte) 0, 24); Elements element = readElement(out).get(0); Assert.assertEquals("Wrong element type", expectedElement.get(0).getType(), element.getType()); Elements comparation = createComparationElement(lengthOfBitmap).get(0); Assert.assertArrayEquals("Wrong element bitmap", comparation.getVersionBitmap().toArray(), element.getVersionBitmap().toArray()); } - + private static List createElement(int lengthOfBitmap) { ElementsBuilder elementsBuilder = new ElementsBuilder(); List elementsList = new ArrayList<>(); @@ -129,7 +129,7 @@ public class HelloInputMessageFactoryTest { elementsList.add(elementsBuilder.build()); return elementsList; } - + private static List createComparationElement(int lengthOfBitmap) { ElementsBuilder elementsBuilder = new ElementsBuilder(); List elementsList = new ArrayList<>(); @@ -148,7 +148,7 @@ public class HelloInputMessageFactoryTest { elementsList.add(elementsBuilder.build()); return elementsList; } - + private static List readElement(ByteBuf input) { List elementsList = new ArrayList<>(); while (input.readableBytes() > 0) { @@ -171,7 +171,7 @@ public class HelloInputMessageFactoryTest { } return elementsList; } - + private static List readVersionBitmap(int[] input){ List versionBitmapList = new ArrayList<>(); for (int i = 0; i < input.length; i++) { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactoryTest.java index 7ac417a4..4884643b 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactoryTest.java @@ -57,7 +57,7 @@ public class MeterModInputMessageFactoryTest { } /** - * @throws Exception + * @throws Exception * Testing of {@link MeterModInputMessageFactory} for correct translation from POJO */ @Test @@ -69,25 +69,25 @@ public class MeterModInputMessageFactoryTest { builder.setMeterId(new MeterId(2248L)); builder.setBands(createBandsList()); MeterModInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); meterModFactory.serialize(message, out); - + BufferHelper.checkHeaderV13(out, (byte) 29, 48); Assert.assertEquals("Wrong meterModCommand", message.getCommand().getIntValue(), out.readUnsignedShort()); Assert.assertEquals("Wrong meterFlags", message.getFlags(), decodeMeterModFlags(out.readShort())); Assert.assertEquals("Wrong meterId", message.getMeterId().getValue().intValue(), out.readUnsignedInt()); Assert.assertEquals("Wrong bands", message.getBands(), decodeBandsList(out)); } - + private static MeterFlags decodeMeterModFlags(short input){ final Boolean _oFPMFKBPS = (input & (1 << 0)) > 0; final Boolean _oFPMFPKTPS = (input & (1 << 1)) > 0; - final Boolean _oFPMFBURST = (input & (1 << 2)) > 0; + final Boolean _oFPMFBURST = (input & (1 << 2)) > 0; final Boolean _oFPMFSTATS = (input & (1 << 3)) > 0; return new MeterFlags(_oFPMFBURST, _oFPMFKBPS, _oFPMFPKTPS, _oFPMFSTATS); } - + private static List createBandsList(){ List bandsList = new ArrayList<>(); BandsBuilder bandsBuilder = new BandsBuilder(); @@ -108,7 +108,7 @@ public class MeterModInputMessageFactoryTest { bandsList.add(bandsBuilder.setMeterBand(dscpCaseBuilder.build()).build()); return bandsList; } - + private static List decodeBandsList(ByteBuf input){ List bandsList = new ArrayList<>(); BandsBuilder bandsBuilder = new BandsBuilder(); @@ -135,7 +135,7 @@ public class MeterModInputMessageFactoryTest { } /** - * @throws Exception + * @throws Exception * Testing of {@link MeterModInputMessageFactory} for correct translation from POJO */ @Test @@ -147,10 +147,10 @@ public class MeterModInputMessageFactoryTest { builder.setMeterId(new MeterId(2248L)); builder.setBands(null); MeterModInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); meterModFactory.serialize(message, out); - + BufferHelper.checkHeaderV13(out, (byte) 29, 16); Assert.assertEquals("Wrong meterModCommand", message.getCommand().getIntValue(), out.readUnsignedShort()); Assert.assertEquals("Wrong meterFlags", message.getFlags(), decodeMeterModFlags(out.readShort())); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10BarrierInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10BarrierInputMessageFactoryTest.java index 4ddb02cc..ae752b6a 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10BarrierInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10BarrierInputMessageFactoryTest.java @@ -44,17 +44,17 @@ public class OF10BarrierInputMessageFactoryTest { /** * Testing of {@link OF10BarrierInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void test() throws Exception { BarrierInputBuilder bib = new BarrierInputBuilder(); BufferHelper.setupHeader(bib, EncodeConstants.OF10_VERSION_ID); BarrierInput bi = bib.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); barrierFactory.serialize(bi, out); - + BufferHelper.checkHeaderV10(out, (byte) 18, 8); } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowModInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowModInputMessageFactoryTest.java index 24449825..e4b3af1b 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowModInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowModInputMessageFactoryTest.java @@ -64,7 +64,7 @@ public class OF10FlowModInputMessageFactoryTest { } /** - * @throws Exception + * @throws Exception * Testing of {@link OF10FlowModInputMessageFactory} for correct translation from POJO */ @Test @@ -112,10 +112,10 @@ public class OF10FlowModInputMessageFactoryTest { actions.add(actionBuilder.build()); builder.setAction(actions); FlowModInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); flowModFactory.serialize(message, out); - + BufferHelper.checkHeaderV10(out, (byte) 14, 88); Assert.assertEquals("Wrong wildcards", 3678463, out.readUnsignedInt()); Assert.assertEquals("Wrong inPort", 58, out.readUnsignedShort()); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10HelloInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10HelloInputMessageFactoryTest.java index c4807192..e8591d4a 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10HelloInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10HelloInputMessageFactoryTest.java @@ -44,17 +44,17 @@ public class OF10HelloInputMessageFactoryTest { /** * Testing of {@link OF10HelloInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testWithoutElementsSet() throws Exception { HelloInputBuilder hib = new HelloInputBuilder(); BufferHelper.setupHeader(hib, EncodeConstants.OF10_VERSION_ID); HelloInput hi = hib.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); helloFactory.serialize(hi, out); - + BufferHelper.checkHeaderV10(out, (byte) 0, 8); } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PacketOutInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PacketOutInputMessageFactoryTest.java index d98a8364..791d5681 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PacketOutInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PacketOutInputMessageFactoryTest.java @@ -58,7 +58,7 @@ public class OF10PacketOutInputMessageFactoryTest { /** * Testing of {@link OF10PacketOutInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testPacketOutInputMessage() throws Exception { @@ -83,10 +83,10 @@ public class OF10PacketOutInputMessageFactoryTest { builder.setAction(actions); builder.setData(ByteBufUtils.hexStringToBytes("00 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14")); PacketOutInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); packetOutFactory.serialize(message, out); - + BufferHelper.checkHeaderV10(out, (byte) 13, 48); Assert.assertEquals("Wrong BufferId", 256, out.readUnsignedInt()); Assert.assertEquals("Wrong PortNumber", 257, out.readUnsignedShort()); @@ -104,7 +104,7 @@ public class OF10PacketOutInputMessageFactoryTest { /** * Testing of {@link OF10PacketOutInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testPacketOutInputWithNoData() throws Exception { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortModInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortModInputMessageFactoryTest.java index b64d6c5c..39276ba3 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortModInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortModInputMessageFactoryTest.java @@ -49,7 +49,7 @@ public class OF10PortModInputMessageFactoryTest { /** * Testing of {@link OF10PortModInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testPortModInput() throws Exception { @@ -62,10 +62,10 @@ public class OF10PortModInputMessageFactoryTest { builder.setAdvertiseV10(new PortFeaturesV10(true, true, false, false, false, false, false, true, true, false, false, false)); PortModInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); portModFactory.serialize(message, out); - + BufferHelper.checkHeaderV10(out, (byte) 15, 32); Assert.assertEquals("Wrong PortNo", message.getPortNo().getValue().longValue(), out.readUnsignedShort()); byte[] address = new byte[6]; diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigInputMessageFactoryTest.java index c8a41d2c..91a08cbb 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigInputMessageFactoryTest.java @@ -45,7 +45,7 @@ public class OF10QueueGetConfigInputMessageFactoryTest { /** * Testing of {@link OF10QueueGetConfigInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void test() throws Exception { @@ -53,10 +53,10 @@ public class OF10QueueGetConfigInputMessageFactoryTest { BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID); builder.setPort(new PortNumber(6653L)); GetQueueConfigInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); queueFactory.serialize(message, out); - + BufferHelper.checkHeaderV10(out, (byte) 20, 12); Assert.assertEquals("Wrong port", 6653L, out.readUnsignedShort()); out.skipBytes(2); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10StatsRequestInputFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10StatsRequestInputFactoryTest.java index cfb64acc..f7171223 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10StatsRequestInputFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10StatsRequestInputFactoryTest.java @@ -74,16 +74,16 @@ public class OF10StatsRequestInputFactoryTest { caseBuilder.setMultipartRequestDesc(descBuilder.build()); builder.setMultipartRequestBody(caseBuilder.build()); MultipartRequestInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); multipartFactory.serialize(message, out); - + BufferHelper.checkHeaderV10(out, (byte) 16, 12); Assert.assertEquals("Wrong type", 0, out.readUnsignedShort()); Assert.assertEquals("Wrong flags", 0, out.readUnsignedShort()); Assert.assertTrue("Unread data", out.readableBytes() == 0); } - + /** * Testing OF10StatsRequestInputFactory (Flow) for correct serialization * @throws Exception @@ -119,10 +119,10 @@ public class OF10StatsRequestInputFactoryTest { caseBuilder.setMultipartRequestFlow(flowBuilder.build()); builder.setMultipartRequestBody(caseBuilder.build()); MultipartRequestInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); multipartFactory.serialize(message, out); - + BufferHelper.checkHeaderV10(out, (byte) 16, 56); Assert.assertEquals("Wrong type", 1, out.readUnsignedShort()); Assert.assertEquals("Wrong flags", 0, out.readUnsignedShort()); @@ -150,7 +150,7 @@ public class OF10StatsRequestInputFactoryTest { Assert.assertEquals("Wrong out-port", 42, out.readUnsignedShort()); Assert.assertTrue("Unread data", out.readableBytes() == 0); } - + /** * Testing OF10StatsRequestInputFactory (Aggregate) for correct serialization * @throws Exception @@ -186,10 +186,10 @@ public class OF10StatsRequestInputFactoryTest { caseBuilder.setMultipartRequestFlow(flowBuilder.build()); builder.setMultipartRequestBody(caseBuilder.build()); MultipartRequestInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); multipartFactory.serialize(message, out); - + BufferHelper.checkHeaderV10(out, (byte) 16, 56); Assert.assertEquals("Wrong type", 2, out.readUnsignedShort()); Assert.assertEquals("Wrong flags", 0, out.readUnsignedShort()); @@ -217,7 +217,7 @@ public class OF10StatsRequestInputFactoryTest { Assert.assertEquals("Wrong out-port", 6653, out.readUnsignedShort()); Assert.assertTrue("Unread data", out.readableBytes() == 0); } - + /** * Testing OF10StatsRequestInputFactory (Table) for correct serialization * @throws Exception @@ -233,16 +233,16 @@ public class OF10StatsRequestInputFactoryTest { caseBuilder.setMultipartRequestTable(tableBuilder.build()); builder.setMultipartRequestBody(caseBuilder.build()); MultipartRequestInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); multipartFactory.serialize(message, out); - + BufferHelper.checkHeaderV10(out, (byte) 16, 12); Assert.assertEquals("Wrong type", 3, out.readUnsignedShort()); Assert.assertEquals("Wrong flags", 0, out.readUnsignedShort()); Assert.assertTrue("Unread data", out.readableBytes() == 0); } - + /** * Testing OF10StatsRequestInputFactory (Port) for correct serialization * @throws Exception @@ -259,10 +259,10 @@ public class OF10StatsRequestInputFactoryTest { caseBuilder.setMultipartRequestPortStats(portBuilder.build()); builder.setMultipartRequestBody(caseBuilder.build()); MultipartRequestInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); multipartFactory.serialize(message, out); - + BufferHelper.checkHeaderV10(out, (byte) 16, 20); Assert.assertEquals("Wrong type", 4, out.readUnsignedShort()); Assert.assertEquals("Wrong flags", 0, out.readUnsignedShort()); @@ -288,10 +288,10 @@ public class OF10StatsRequestInputFactoryTest { caseBuilder.setMultipartRequestQueue(queueBuilder.build()); builder.setMultipartRequestBody(caseBuilder.build()); MultipartRequestInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); multipartFactory.serialize(message, out); - + BufferHelper.checkHeaderV10(out, (byte) 16, 20); Assert.assertEquals("Wrong type", 5, out.readUnsignedShort()); Assert.assertEquals("Wrong flags", 0, out.readUnsignedShort()); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PacketOutInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PacketOutInputMessageFactoryTest.java index 8cc92e2a..5da3a53d 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PacketOutInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PacketOutInputMessageFactoryTest.java @@ -59,7 +59,7 @@ public class PacketOutInputMessageFactoryTest { /** * Testing of {@link PacketOutInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testPacketOutInputMessage() throws Exception { @@ -80,10 +80,10 @@ public class PacketOutInputMessageFactoryTest { builder.setAction(actions); builder.setData(ByteBufUtils.hexStringToBytes("00 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14")); PacketOutInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); packetOutFactory.serialize(message, out); - + BufferHelper.checkHeaderV13(out, MESSAGE_TYPE, 56); Assert.assertEquals("Wrong BufferId", message.getBufferId().longValue(), out.readUnsignedInt()); Assert.assertEquals("Wrong PortNumber", message.getInPort().getValue().longValue(), out.readUnsignedInt()); @@ -101,7 +101,7 @@ public class PacketOutInputMessageFactoryTest { /** * Testing of {@link PacketOutInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testPacketOutInputWithNoData() throws Exception { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortModInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortModInputMessageFactoryTest.java index ce226535..fd4f4ca8 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortModInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortModInputMessageFactoryTest.java @@ -53,7 +53,7 @@ public class PortModInputMessageFactoryTest { /** * Testing of {@link PortModInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testPortModInput() throws Exception { @@ -64,14 +64,14 @@ public class PortModInputMessageFactoryTest { builder.setConfig(new PortConfig(true, false, true, false)); builder.setMask(new PortConfig(false, true, false, true)); builder.setAdvertise(new PortFeatures(true, false, false, false, - false, false, false, true, - false, false, false, false, + false, false, false, true, + false, false, false, false, false, false, false, false)); PortModInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); portModFactory.serialize(message, out); - + BufferHelper.checkHeaderV13(out, MESSAGE_TYPE, MESSAGE_LENGTH); Assert.assertEquals("Wrong PortNo", message.getPortNo().getValue().longValue(), out.readUnsignedInt()); out.skipBytes(PADDING_IN_PORT_MOD_MESSAGE_01); @@ -93,7 +93,7 @@ public class PortModInputMessageFactoryTest { final Boolean _noPacketIn = ((input) & (1<<6)) > 0; return new PortConfig(_noFwd, _noPacketIn, _noRecv, _portDown); } - + private static PortFeatures createPortFeatures(long input){ final Boolean _10mbHd = ((input) & (1<<0)) > 0; final Boolean _10mbFd = ((input) & (1<<1)) > 0; @@ -111,8 +111,8 @@ public class PortModInputMessageFactoryTest { final Boolean _autoneg = ((input) & (1<<13)) > 0; final Boolean _pause = ((input) & (1<<14)) > 0; final Boolean _pauseAsym = ((input) & (1<<15)) > 0; - return new PortFeatures(_100gbFd, _100mbFd, _100mbHd, _10gbFd, _10mbFd, _10mbHd, + return new PortFeatures(_100gbFd, _100mbFd, _100mbHd, _10gbFd, _10mbFd, _10mbHd, _1gbFd, _1gbHd, _1tbFd, _40gbFd, _autoneg, _copper, _fiber, _other, _pause, _pauseAsym); } - + } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleRequestInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleRequestInputMessageFactoryTest.java index a67b2a48..5f21f65b 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleRequestInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleRequestInputMessageFactoryTest.java @@ -50,7 +50,7 @@ public class RoleRequestInputMessageFactoryTest { /** * Testing of {@link RoleRequestInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testRoleRequestInputMessage() throws Exception { @@ -60,10 +60,10 @@ public class RoleRequestInputMessageFactoryTest { byte[] generationId = new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}; builder.setGenerationId(new BigInteger(1, generationId)); RoleRequestInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); roleFactory.serialize(message, out); - + BufferHelper.checkHeaderV13(out, MESSAGE_TYPE, MESSAGE_LENGTH); Assert.assertEquals("Wrong role", message.getRole().getIntValue(), ControllerRole.forValue((int) out.readUnsignedInt()).getIntValue()); out.skipBytes(PADDING_IN_ROLE_REQUEST_MESSAGE); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetAsyncInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetAsyncInputMessageFactoryTest.java index c9ed91e3..d31a117a 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetAsyncInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetAsyncInputMessageFactoryTest.java @@ -56,7 +56,7 @@ public class SetAsyncInputMessageFactoryTest { } /** - * @throws Exception + * @throws Exception * Testing of {@link SetAsyncInputMessageFactory} for correct translation from POJO */ @Test @@ -78,7 +78,7 @@ public class SetAsyncInputMessageFactoryTest { Assert.assertEquals("Wrong portStatusMask", 0, out.readUnsignedInt()); Assert.assertEquals("Wrong flowRemovedMask", 15, out.readUnsignedInt()); Assert.assertEquals("Wrong flowRemovedMask", 0, out.readUnsignedInt()); - + } private static List createPacketInMask() { @@ -140,7 +140,7 @@ public class SetAsyncInputMessageFactoryTest { } /** - * @throws Exception + * @throws Exception * Testing of {@link SetAsyncInputMessageFactory} for correct translation from POJO */ @Test diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetConfigMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetConfigMessageFactoryTest.java index bd41db6e..c188b593 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetConfigMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetConfigMessageFactoryTest.java @@ -47,7 +47,7 @@ public class SetConfigMessageFactoryTest { /** * Testing of {@link SetConfigMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testSetConfigMessageV13() throws Exception { @@ -57,18 +57,18 @@ public class SetConfigMessageFactoryTest { builder.setFlags(flag); builder.setMissSendLen(10); SetConfigInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); setConfigFactory.serialize(message, out); - + BufferHelper.checkHeaderV13(out, MESSAGE_TYPE, MESSAGE_LENGTH); Assert.assertEquals("Wrong flags", SwitchConfigFlag.FRAGNORMAL.getIntValue(), out.readUnsignedShort()); Assert.assertEquals("Wrong missSendLen", 10, out.readUnsignedShort()); } - + /** * Testing of {@link SetConfigMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testSetConfigMessageV10() throws Exception { @@ -78,10 +78,10 @@ public class SetConfigMessageFactoryTest { builder.setFlags(flag); builder.setMissSendLen(85); SetConfigInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); setConfigFactory.serialize(message, out); - + BufferHelper.checkHeaderV10(out, MESSAGE_TYPE, MESSAGE_LENGTH); Assert.assertEquals("Wrong flags", SwitchConfigFlag.OFPCFRAGDROP.getIntValue(), out.readUnsignedShort()); Assert.assertEquals("Wrong missSendLen", 85, out.readUnsignedShort()); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/TableModInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/TableModInputMessageFactoryTest.java index d547f064..6423a326 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/TableModInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/TableModInputMessageFactoryTest.java @@ -47,7 +47,7 @@ public class TableModInputMessageFactoryTest { /** * Testing of {@link TableModInputMessageFactory} for correct translation from POJO - * @throws Exception + * @throws Exception */ @Test public void testTableModInput() throws Exception { @@ -56,14 +56,14 @@ public class TableModInputMessageFactoryTest { builder.setTableId(new TableId(9L)); builder.setConfig(new TableConfig(true)); TableModInput message = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); tableModFactory.serialize(message, out); - + BufferHelper.checkHeaderV13(out, MESSAGE_TYPE, 16); Assert.assertEquals("Wrong TableID", message.getTableId().getValue().intValue(), out.readUnsignedByte()); out.skipBytes(PADDING_IN_TABLE_MOD_MESSAGE); Assert.assertEquals("Wrong TableConfig", 8, out.readUnsignedInt()); } - + } diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestGroupDescTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestGroupDescTest.java index b747e3e7..f5c8cad6 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestGroupDescTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestGroupDescTest.java @@ -50,7 +50,7 @@ public class MultipartRequestGroupDescTest { /** * Tests {@link MultipartRequestInputFactory} - GroupDesc case - * @throws Exception + * @throws Exception */ @Test public void test() throws Exception { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestGroupFeaturesTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestGroupFeaturesTest.java index ff0012e0..630deca7 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestGroupFeaturesTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestGroupFeaturesTest.java @@ -50,7 +50,7 @@ public class MultipartRequestGroupFeaturesTest { /** * Tests {@link MultipartRequestInputFactory} - GroupFeatures case - * @throws Exception + * @throws Exception */ @Test public void test() throws Exception { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestMeterFeaturesTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestMeterFeaturesTest.java index 7f04ba49..9106a580 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestMeterFeaturesTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestMeterFeaturesTest.java @@ -50,7 +50,7 @@ public class MultipartRequestMeterFeaturesTest { /** * Tests {@link MultipartRequestInputFactory} - MeterFeatures case - * @throws Exception + * @throws Exception */ @Test public void test() throws Exception { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestPortDescTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestPortDescTest.java index fd8365d2..be5b244a 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestPortDescTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestPortDescTest.java @@ -50,7 +50,7 @@ public class MultipartRequestPortDescTest { /** * Tests {@link MultipartRequestInputFactory} - PortDesc case - * @throws Exception + * @throws Exception */ @Test public void test() throws Exception { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestTableTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestTableTest.java index 724b55e5..11383b9f 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestTableTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestTableTest.java @@ -50,7 +50,7 @@ public class MultipartRequestTableTest { /** * Tests {@link MultipartRequestInputFactory} - Table case - * @throws Exception + * @throws Exception */ @Test public void test() throws Exception { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/OF10StatsRequestAggregateTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/OF10StatsRequestAggregateTest.java index 2831e6d5..711c0d45 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/OF10StatsRequestAggregateTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/OF10StatsRequestAggregateTest.java @@ -54,7 +54,7 @@ public class OF10StatsRequestAggregateTest { /** * Tests {@link OF10StatsRequestInputFactory} for correct serialization - * @throws Exception + * @throws Exception */ @Test public void test() throws Exception { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpOpSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpOpSerializerTest.java index 1f1c8bf8..ab564ee0 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpOpSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpOpSerializerTest.java @@ -36,7 +36,7 @@ public class OxmArpOpSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareArpOpMatchEntry(1402); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -51,7 +51,7 @@ public class OxmArpOpSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareArpOpHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpShaSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpShaSerializerTest.java index b0dc9276..3cd8d886 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpShaSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpShaSerializerTest.java @@ -40,7 +40,7 @@ public class OxmArpShaSerializerTest { @Test public void testSerializeWithoutMask() { MatchEntriesBuilder builder = prepareMatchEntry(false, "00:01:02:03:04:05"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -57,12 +57,12 @@ public class OxmArpShaSerializerTest { @Test public void testSerializeWithMask() { MatchEntriesBuilder builder = prepareMatchEntry(true, "00:01:02:03:04:0A"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); checkHeader(buffer, true); - + byte[] address = new byte[6]; buffer.readBytes(address); Assert.assertArrayEquals("Wrong address", new byte[]{0, 1, 2, 3, 4, 10}, address); @@ -78,7 +78,7 @@ public class OxmArpShaSerializerTest { @Test public void testSerializeHeaderWithoutMask() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -92,7 +92,7 @@ public class OxmArpShaSerializerTest { @Test public void testSerializeHeaderWithMask() { MatchEntriesBuilder builder = prepareHeader(true); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpSpaSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpSpaSerializerTest.java index 83d6afe7..8f60a449 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpSpaSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpSpaSerializerTest.java @@ -40,7 +40,7 @@ public class OxmArpSpaSerializerTest { @Test public void testSerializeWithoutMask() { MatchEntriesBuilder builder = prepareMatchEntry(false, "10.0.0.1"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -57,12 +57,12 @@ public class OxmArpSpaSerializerTest { @Test public void testSerializeWithMask() { MatchEntriesBuilder builder = prepareMatchEntry(true, "120.121.122.0"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); checkHeader(buffer, true); - + byte[] address = new byte[4]; buffer.readBytes(address); Assert.assertArrayEquals("Wrong address", new byte[]{120, 121, 122, 0}, address); @@ -78,7 +78,7 @@ public class OxmArpSpaSerializerTest { @Test public void testSerializeHeaderWithoutMask() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -92,7 +92,7 @@ public class OxmArpSpaSerializerTest { @Test public void testSerializeHeaderWithMask() { MatchEntriesBuilder builder = prepareHeader(true); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpThaSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpThaSerializerTest.java index cc0f5d4c..1bd15a7b 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpThaSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpThaSerializerTest.java @@ -40,7 +40,7 @@ public class OxmArpThaSerializerTest { @Test public void testSerializeWithoutMask() { MatchEntriesBuilder builder = prepareMatchEntry(false, "00:01:02:03:04:05"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -57,12 +57,12 @@ public class OxmArpThaSerializerTest { @Test public void testSerializeWithMask() { MatchEntriesBuilder builder = prepareMatchEntry(true, "00:01:02:03:04:0A"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); checkHeader(buffer, true); - + byte[] address = new byte[6]; buffer.readBytes(address); Assert.assertArrayEquals("Wrong address", new byte[]{0, 1, 2, 3, 4, 10}, address); @@ -78,7 +78,7 @@ public class OxmArpThaSerializerTest { @Test public void testSerializeHeaderWithoutMask() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -92,7 +92,7 @@ public class OxmArpThaSerializerTest { @Test public void testSerializeHeaderWithMask() { MatchEntriesBuilder builder = prepareHeader(true); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpTpaSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpTpaSerializerTest.java index 90b51395..5122e822 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpTpaSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpTpaSerializerTest.java @@ -40,7 +40,7 @@ public class OxmArpTpaSerializerTest { @Test public void testSerializeWithoutMask() { MatchEntriesBuilder builder = prepareMatchEntry(false, "10.0.0.1"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -57,12 +57,12 @@ public class OxmArpTpaSerializerTest { @Test public void testSerializeWithMask() { MatchEntriesBuilder builder = prepareMatchEntry(true, "120.121.122.0"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); checkHeader(buffer, true); - + byte[] address = new byte[4]; buffer.readBytes(address); Assert.assertArrayEquals("Wrong address", new byte[]{120, 121, 122, 0}, address); @@ -78,7 +78,7 @@ public class OxmArpTpaSerializerTest { @Test public void testSerializeHeaderWithoutMask() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -92,7 +92,7 @@ public class OxmArpTpaSerializerTest { @Test public void testSerializeHeaderWithMask() { MatchEntriesBuilder builder = prepareHeader(true); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmEthDstSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmEthDstSerializerTest.java index 3a34fdde..03116abd 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmEthDstSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmEthDstSerializerTest.java @@ -40,7 +40,7 @@ public class OxmEthDstSerializerTest { @Test public void testSerializeWithoutMask() { MatchEntriesBuilder builder = prepareMatchEntry(false, "00:01:02:03:04:05"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -57,12 +57,12 @@ public class OxmEthDstSerializerTest { @Test public void testSerializeWithMask() { MatchEntriesBuilder builder = prepareMatchEntry(true, "00:01:02:03:04:0A"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); checkHeader(buffer, true); - + byte[] address = new byte[6]; buffer.readBytes(address); Assert.assertArrayEquals("Wrong address", new byte[]{0, 1, 2, 3, 4, 10}, address); @@ -78,7 +78,7 @@ public class OxmEthDstSerializerTest { @Test public void testSerializeHeaderWithoutMask() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -92,7 +92,7 @@ public class OxmEthDstSerializerTest { @Test public void testSerializeHeaderWithMask() { MatchEntriesBuilder builder = prepareHeader(true); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmEthSrcSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmEthSrcSerializerTest.java index 984899c1..6f143277 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmEthSrcSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmEthSrcSerializerTest.java @@ -40,7 +40,7 @@ public class OxmEthSrcSerializerTest { @Test public void testSerializeWithoutMask() { MatchEntriesBuilder builder = prepareMatchEntry(false, "00:01:02:03:04:05"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -57,12 +57,12 @@ public class OxmEthSrcSerializerTest { @Test public void testSerializeWithMask() { MatchEntriesBuilder builder = prepareMatchEntry(true, "00:01:02:03:04:0A"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); checkHeader(buffer, true); - + byte[] address = new byte[6]; buffer.readBytes(address); Assert.assertArrayEquals("Wrong address", new byte[]{0, 1, 2, 3, 4, 10}, address); @@ -78,7 +78,7 @@ public class OxmEthSrcSerializerTest { @Test public void testSerializeHeaderWithoutMask() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -92,7 +92,7 @@ public class OxmEthSrcSerializerTest { @Test public void testSerializeHeaderWithMask() { MatchEntriesBuilder builder = prepareHeader(true); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmEthTypeSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmEthTypeSerializerTest.java index ae82abc9..7850358f 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmEthTypeSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmEthTypeSerializerTest.java @@ -37,7 +37,7 @@ public class OxmEthTypeSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareEthTypeMatchEntry(65535); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -52,7 +52,7 @@ public class OxmEthTypeSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareEthTypeHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -84,7 +84,7 @@ public class OxmEthTypeSerializerTest { assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength()); } - + private static MatchEntriesBuilder prepareEthTypeMatchEntry(int type) { MatchEntriesBuilder builder = prepareEthTypeHeader(false); EthTypeMatchEntryBuilder typeBuilder = new EthTypeMatchEntryBuilder(); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv4CodeSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv4CodeSerializerTest.java index ec559978..8afa0c1c 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv4CodeSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv4CodeSerializerTest.java @@ -36,7 +36,7 @@ public class OxmIcmpv4CodeSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareIcmpv4CodeMatchEntry((short) 200); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -51,7 +51,7 @@ public class OxmIcmpv4CodeSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareIcmpv4CodeHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -83,7 +83,7 @@ public class OxmIcmpv4CodeSerializerTest { assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength()); } - + private static MatchEntriesBuilder prepareIcmpv4CodeMatchEntry(short value) { MatchEntriesBuilder builder = prepareIcmpv4CodeHeader(false); Icmpv4CodeMatchEntryBuilder icmpv4Builder = new Icmpv4CodeMatchEntryBuilder(); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv4TypeSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv4TypeSerializerTest.java index 1c0c08ba..23df28c8 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv4TypeSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv4TypeSerializerTest.java @@ -36,7 +36,7 @@ public class OxmIcmpv4TypeSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareIcmpv4TypeMatchEntry((short) 128); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -51,7 +51,7 @@ public class OxmIcmpv4TypeSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareIcmpv4TypeHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -83,7 +83,7 @@ public class OxmIcmpv4TypeSerializerTest { assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength()); } - + private static MatchEntriesBuilder prepareIcmpv4TypeMatchEntry(short value) { MatchEntriesBuilder builder = prepareIcmpv4TypeHeader(false); Icmpv4TypeMatchEntryBuilder icmpv4Builder = new Icmpv4TypeMatchEntryBuilder(); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv6CodeSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv6CodeSerializerTest.java index f4525441..410fa4aa 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv6CodeSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv6CodeSerializerTest.java @@ -36,7 +36,7 @@ public class OxmIcmpv6CodeSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareIcmpv6CodeMatchEntry((short) 101); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -51,7 +51,7 @@ public class OxmIcmpv6CodeSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareIcmpv6CodeHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv6TypeSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv6TypeSerializerTest.java index 1c4240ad..c97a7d42 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv6TypeSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv6TypeSerializerTest.java @@ -36,7 +36,7 @@ public class OxmIcmpv6TypeSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareIcmpv6TypeMatchEntry((short) 123); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -51,7 +51,7 @@ public class OxmIcmpv6TypeSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareIcmpv6TypeHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -83,7 +83,7 @@ public class OxmIcmpv6TypeSerializerTest { assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength()); } - + private static MatchEntriesBuilder prepareIcmpv6TypeMatchEntry(short value) { MatchEntriesBuilder builder = prepareIcmpv6TypeHeader(false); Icmpv6TypeMatchEntryBuilder icmpv6Builder = new Icmpv6TypeMatchEntryBuilder(); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpDscpSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpDscpSerializerTest.java index 0373589c..9fdd7dda 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpDscpSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpDscpSerializerTest.java @@ -37,7 +37,7 @@ public class OxmIpDscpSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareIpDscpMatchEntry((short) 58); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -52,7 +52,7 @@ public class OxmIpDscpSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareIpDscpHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpProtoSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpProtoSerializerTest.java index 2672e807..21e2deaf 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpProtoSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpProtoSerializerTest.java @@ -36,7 +36,7 @@ public class OxmIpProtoSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareMatchEntry((short) 123); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -51,7 +51,7 @@ public class OxmIpProtoSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv4DstSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv4DstSerializerTest.java index 69499578..7cb8db66 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv4DstSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv4DstSerializerTest.java @@ -40,7 +40,7 @@ public class OxmIpv4DstSerializerTest { @Test public void testSerializeWithoutMask() { MatchEntriesBuilder builder = prepareMatchEntry(false, "10.0.0.1"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -57,12 +57,12 @@ public class OxmIpv4DstSerializerTest { @Test public void testSerializeWithMask() { MatchEntriesBuilder builder = prepareMatchEntry(true, "120.121.122.0"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); checkHeader(buffer, true); - + byte[] address = new byte[4]; buffer.readBytes(address); Assert.assertArrayEquals("Wrong address", new byte[]{120, 121, 122, 0}, address); @@ -78,7 +78,7 @@ public class OxmIpv4DstSerializerTest { @Test public void testSerializeHeaderWithoutMask() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -92,7 +92,7 @@ public class OxmIpv4DstSerializerTest { @Test public void testSerializeHeaderWithMask() { MatchEntriesBuilder builder = prepareHeader(true); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv4SrcSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv4SrcSerializerTest.java index 69866caa..6ea93c2a 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv4SrcSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv4SrcSerializerTest.java @@ -40,7 +40,7 @@ public class OxmIpv4SrcSerializerTest { @Test public void testSerializeWithoutMask() { MatchEntriesBuilder builder = prepareMatchEntry(false, "10.0.0.1"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -57,12 +57,12 @@ public class OxmIpv4SrcSerializerTest { @Test public void testSerializeWithMask() { MatchEntriesBuilder builder = prepareMatchEntry(true, "120.121.122.0"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); checkHeader(buffer, true); - + byte[] address = new byte[4]; buffer.readBytes(address); Assert.assertArrayEquals("Wrong address", new byte[]{120, 121, 122, 0}, address); @@ -78,7 +78,7 @@ public class OxmIpv4SrcSerializerTest { @Test public void testSerializeHeaderWithoutMask() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -92,7 +92,7 @@ public class OxmIpv4SrcSerializerTest { @Test public void testSerializeHeaderWithMask() { MatchEntriesBuilder builder = prepareHeader(true); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv6ExtHdrSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv6ExtHdrSerializerTest.java index 0924f100..eb8d3644 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv6ExtHdrSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv6ExtHdrSerializerTest.java @@ -41,7 +41,7 @@ public class OxmIpv6ExtHdrSerializerTest { public void testSerializeWithMask() { MatchEntriesBuilder builder = prepareIpv6ExtHdrMatchEntry(false, new Ipv6ExthdrFlags(true, false, true, false, true, false, true, false, true)); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -57,7 +57,7 @@ public class OxmIpv6ExtHdrSerializerTest { public void testSerializeWithoutMask() { MatchEntriesBuilder builder = prepareIpv6ExtHdrMatchEntry(true, new Ipv6ExthdrFlags(false, true, false, true, false, true, false, true, false)); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -75,7 +75,7 @@ public class OxmIpv6ExtHdrSerializerTest { @Test public void testSerializeHeaderWithoutMask() { MatchEntriesBuilder builder = prepareIpv6ExtHdrHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -89,7 +89,7 @@ public class OxmIpv6ExtHdrSerializerTest { @Test public void testSerializeHeaderWithMask() { MatchEntriesBuilder builder = prepareIpv6ExtHdrHeader(true); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -121,7 +121,7 @@ public class OxmIpv6ExtHdrSerializerTest { assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength()); } - + private static MatchEntriesBuilder prepareIpv6ExtHdrMatchEntry(boolean hasMask, Ipv6ExthdrFlags flags) { MatchEntriesBuilder builder = prepareIpv6ExtHdrHeader(hasMask); if (hasMask) { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv6NdSllSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv6NdSllSerializerTest.java index 52df5db1..3e9dce5d 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv6NdSllSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv6NdSllSerializerTest.java @@ -40,7 +40,7 @@ public class OxmIpv6NdSllSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareMatchEntry(false, "00:01:02:03:04:05"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -57,7 +57,7 @@ public class OxmIpv6NdSllSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv6NdTllSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv6NdTllSerializerTest.java index 6c6e8d31..29585d9b 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv6NdTllSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpv6NdTllSerializerTest.java @@ -40,7 +40,7 @@ public class OxmIpv6NdTllSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareMatchEntry(false, "00:01:02:03:04:05"); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -57,7 +57,7 @@ public class OxmIpv6NdTllSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMetadataSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMetadataSerializerTest.java index fbe202dc..b790e133 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMetadataSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMetadataSerializerTest.java @@ -39,7 +39,7 @@ public class OxmMetadataSerializerTest { @Test public void testSerializeWithoutMask() { MatchEntriesBuilder builder = prepareMatchEntry(false, new byte[]{0, 1, 2, 3, 4, 5, 6, 7}); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -56,12 +56,12 @@ public class OxmMetadataSerializerTest { @Test public void testSerializeWithMask() { MatchEntriesBuilder builder = prepareMatchEntry(true, new byte[]{8, 9, 10, 11, 12, 13, 14, 15}); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); checkHeader(buffer, true); - + byte[] address = new byte[8]; buffer.readBytes(address); Assert.assertArrayEquals("Wrong address", new byte[]{8, 9, 10, 11, 12, 13, 14, 15}, address); @@ -77,7 +77,7 @@ public class OxmMetadataSerializerTest { @Test public void testSerializeHeaderWithoutMask() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -91,7 +91,7 @@ public class OxmMetadataSerializerTest { @Test public void testSerializeHeaderWithMask() { MatchEntriesBuilder builder = prepareHeader(true); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsBosSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsBosSerializerTest.java index 6c22ec4a..0bc77dbc 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsBosSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsBosSerializerTest.java @@ -36,7 +36,7 @@ public class OxmMplsBosSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareMplsBosMatchEntry(true); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -51,7 +51,7 @@ public class OxmMplsBosSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareMplsBosHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -83,7 +83,7 @@ public class OxmMplsBosSerializerTest { assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength()); } - + private static MatchEntriesBuilder prepareMplsBosMatchEntry(boolean bos) { MatchEntriesBuilder builder = prepareMplsBosHeader(false); BosMatchEntryBuilder bosBuilder = new BosMatchEntryBuilder(); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsLabelSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsLabelSerializerTest.java index c20890b9..742001f7 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsLabelSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsLabelSerializerTest.java @@ -36,7 +36,7 @@ public class OxmMplsLabelSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareMplsLabelMatchEntry(168535); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -51,7 +51,7 @@ public class OxmMplsLabelSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareMplsLabelHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsTcSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsTcSerializerTest.java index d851b755..737eba0a 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsTcSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsTcSerializerTest.java @@ -36,7 +36,7 @@ public class OxmMplsTcSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareMplsTcMatchEntry((short) 16); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -51,7 +51,7 @@ public class OxmMplsTcSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareMplsTcHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmPbbIsidSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmPbbIsidSerializerTest.java index f2cbf897..02742e88 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmPbbIsidSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmPbbIsidSerializerTest.java @@ -39,7 +39,7 @@ public class OxmPbbIsidSerializerTest { @Test public void testSerializeWithMask() { MatchEntriesBuilder builder = preparePbbIsidMatchEntry(false, 12345); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -54,7 +54,7 @@ public class OxmPbbIsidSerializerTest { @Test public void testSerializeWithoutMask() { MatchEntriesBuilder builder = preparePbbIsidMatchEntry(true, 6789); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -72,7 +72,7 @@ public class OxmPbbIsidSerializerTest { @Test public void testSerializeHeaderWithoutMask() { MatchEntriesBuilder builder = preparePbbIsidHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -86,7 +86,7 @@ public class OxmPbbIsidSerializerTest { @Test public void testSerializeHeaderWithMask() { MatchEntriesBuilder builder = preparePbbIsidHeader(true); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -118,7 +118,7 @@ public class OxmPbbIsidSerializerTest { assertEquals("Wrong value length", EncodeConstants.SIZE_OF_3_BYTES, serializer.getValueLength()); } - + private static MatchEntriesBuilder preparePbbIsidMatchEntry(boolean hasMask, long value) { MatchEntriesBuilder builder = preparePbbIsidHeader(hasMask); if (hasMask) { diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmSctpDstSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmSctpDstSerializerTest.java index e56c5c0d..9bf4e07b 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmSctpDstSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmSctpDstSerializerTest.java @@ -37,7 +37,7 @@ public class OxmSctpDstSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareMatchEntry(4096); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -52,7 +52,7 @@ public class OxmSctpDstSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmSctpSrcSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmSctpSrcSerializerTest.java index 6c3890c4..91d3099f 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmSctpSrcSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmSctpSrcSerializerTest.java @@ -37,7 +37,7 @@ public class OxmSctpSrcSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareMatchEntry(4096); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -52,7 +52,7 @@ public class OxmSctpSrcSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTcpDstSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTcpDstSerializerTest.java index b912aed3..431725ae 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTcpDstSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTcpDstSerializerTest.java @@ -37,7 +37,7 @@ public class OxmTcpDstSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareMatchEntry(4096); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -52,7 +52,7 @@ public class OxmTcpDstSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTcpSrcSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTcpSrcSerializerTest.java index c156b2f5..3cdd17e3 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTcpSrcSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTcpSrcSerializerTest.java @@ -37,7 +37,7 @@ public class OxmTcpSrcSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareMatchEntry(512); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -52,7 +52,7 @@ public class OxmTcpSrcSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTunnelIdSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTunnelIdSerializerTest.java index 35f2986e..73cc676a 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTunnelIdSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTunnelIdSerializerTest.java @@ -39,7 +39,7 @@ public class OxmTunnelIdSerializerTest { @Test public void testSerializeWithoutMask() { MatchEntriesBuilder builder = prepareMatchEntry(false, new byte[]{0, 1, 2, 3, 4, 5, 6, 7}); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -56,12 +56,12 @@ public class OxmTunnelIdSerializerTest { @Test public void testSerializeWithMask() { MatchEntriesBuilder builder = prepareMatchEntry(true, new byte[]{8, 9, 10, 11, 12, 13, 14, 15}); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); checkHeader(buffer, true); - + byte[] address = new byte[8]; buffer.readBytes(address); Assert.assertArrayEquals("Wrong address", new byte[]{8, 9, 10, 11, 12, 13, 14, 15}, address); @@ -77,7 +77,7 @@ public class OxmTunnelIdSerializerTest { @Test public void testSerializeHeaderWithoutMask() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -91,7 +91,7 @@ public class OxmTunnelIdSerializerTest { @Test public void testSerializeHeaderWithMask() { MatchEntriesBuilder builder = prepareHeader(true); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmUdpDstSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmUdpDstSerializerTest.java index 1cafb491..35318d8f 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmUdpDstSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmUdpDstSerializerTest.java @@ -37,7 +37,7 @@ public class OxmUdpDstSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareMatchEntry(2048); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -52,7 +52,7 @@ public class OxmUdpDstSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmUdpSrcSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmUdpSrcSerializerTest.java index d4989830..7cb4d0ab 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmUdpSrcSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmUdpSrcSerializerTest.java @@ -37,7 +37,7 @@ public class OxmUdpSrcSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareMatchEntry(1024); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -52,7 +52,7 @@ public class OxmUdpSrcSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanPcpSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanPcpSerializerTest.java index ba08ad08..b96e0d76 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanPcpSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanPcpSerializerTest.java @@ -36,7 +36,7 @@ public class OxmVlanPcpSerializerTest { @Test public void testSerialize() { MatchEntriesBuilder builder = prepareVlanPcpMatchEntry((short) 42); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -51,7 +51,7 @@ public class OxmVlanPcpSerializerTest { @Test public void testSerializeHeader() { MatchEntriesBuilder builder = prepareVlanPcpHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanVidSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanVidSerializerTest.java index f0ae6dea..a22e6c81 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanVidSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanVidSerializerTest.java @@ -39,7 +39,7 @@ public class OxmVlanVidSerializerTest { @Test public void testSerializeWithCfiBitSet() { MatchEntriesBuilder builder = prepareVlanVidMatchEntry(false, true); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -54,7 +54,7 @@ public class OxmVlanVidSerializerTest { @Test public void testSerializeWithoutCfiBitSet() { MatchEntriesBuilder builder = prepareVlanVidMatchEntry(true, false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); @@ -72,7 +72,7 @@ public class OxmVlanVidSerializerTest { @Test public void testSerializeHeaderWithoutMask() { MatchEntriesBuilder builder = prepareVlanVidHeader(false); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); @@ -86,7 +86,7 @@ public class OxmVlanVidSerializerTest { @Test public void testSerializeHeaderWithMask() { MatchEntriesBuilder builder = prepareVlanVidHeader(true); - + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serializeHeader(builder.build(), buffer); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/ActionsDeserializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/ActionsDeserializerTest.java index d7d29d84..e9f98b7c 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/ActionsDeserializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/ActionsDeserializerTest.java @@ -72,10 +72,10 @@ public class ActionsDeserializerTest { + "00 19 00 10 80 00 02 04 00 00 00 0B 00 00 00 00 " + "00 1A 00 08 00 0A 00 00 " + "00 1B 00 08 00 00 00 00"); - + message.skipBytes(4); // skip XID LOGGER.info("bytes: " + message.readableBytes()); - + CodeKeyMaker keyMaker = CodeKeyMakerFactory.createActionsKeyMaker(EncodeConstants.OF13_VERSION_ID); List actions = ListDeserializer.deserializeList(EncodeConstants.OF13_VERSION_ID, message.readableBytes(), message, keyMaker, registry); @@ -132,7 +132,7 @@ public class ActionsDeserializerTest { Assert.assertEquals("Wrong match entry field", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow." + "oxm.rev130731.InPhyPort", entries.get(0).getOxmMatchField().getName()); Assert.assertEquals("Wrong match entry mask", false, entries.get(0).isHasMask()); - Assert.assertEquals("Wrong match entry value", 11, + Assert.assertEquals("Wrong match entry value", 11, entries.get(0).getAugmentation(PortNumberMatchEntry.class).getPortNumber().getValue().intValue()); Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight." + "openflow.common.action.rev130731.PushPbb", actions.get(14).getType().getName()); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/BufferHelper.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/BufferHelper.java index 6a857639..dcdbec18 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/BufferHelper.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/BufferHelper.java @@ -23,12 +23,12 @@ import org.opendaylight.yangtools.yang.binding.DataObject; /** * @author michal.polkorab - * + * */ public abstract class BufferHelper { /** - * + * */ public static final Long DEFAULT_XID = 0x01020304L; private static final byte[] XID = new byte[] { 0x01, 0x02, 0x03, 0x04 }; @@ -44,7 +44,7 @@ public abstract class BufferHelper { bb.writeBytes(payload); return bb; } - + /** * @param payload String in hex format * @return ByteBuf filled with OpenFlow protocol message without first 4 @@ -53,7 +53,7 @@ public abstract class BufferHelper { public static ByteBuf buildBuffer(String payload) { return buildBuffer(ByteBufUtils.hexStringToBytes(payload)); } - + /** * @return ByteBuf filled with OpenFlow protocol header message without first 4 * bytes @@ -74,7 +74,7 @@ public abstract class BufferHelper { public static void checkHeaderV13(ByteBuf input, byte msgType, int length) { checkHeader(input, msgType, length, (short) EncodeConstants.OF13_VERSION_ID); } - + /** * Use version 1.0 for encoded message * @param input ByteBuf to be checked for correct OpenFlow Protocol header @@ -84,14 +84,14 @@ public abstract class BufferHelper { public static void checkHeaderV10(ByteBuf input, byte msgType, int length) { checkHeader(input, msgType, length, (short) EncodeConstants.OF10_VERSION_ID); } - + private static void checkHeader(ByteBuf input, byte msgType, int length, Short version) { Assert.assertEquals("Wrong version", version, Short.valueOf(input.readByte())); Assert.assertEquals("Wrong type", msgType, input.readByte()); Assert.assertEquals("Wrong length", length, input.readUnsignedShort()); Assert.assertEquals("Wrong Xid", DEFAULT_XID, Long.valueOf(input.readUnsignedInt())); } - + /** * @param ofHeader OpenFlow protocol header @@ -99,19 +99,19 @@ public abstract class BufferHelper { public static void checkHeaderV13(OfHeader ofHeader) { checkHeader(ofHeader, (short) EncodeConstants.OF13_VERSION_ID); } - + /** * @param ofHeader OpenFlow protocol header */ public static void checkHeaderV10(OfHeader ofHeader) { checkHeader(ofHeader, (short) EncodeConstants.OF10_VERSION_ID); } - + private static void checkHeader(OfHeader ofHeader, Short version) { Assert.assertEquals("Wrong version", version, ofHeader.getVersion()); Assert.assertEquals("Wrong Xid", DEFAULT_XID, ofHeader.getXid()); } - + /** * @param builder * @param version wire protocol number used diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/InstructionsDeserializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/InstructionsDeserializerTest.java index adb6941e..39452dcc 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/InstructionsDeserializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/InstructionsDeserializerTest.java @@ -57,9 +57,9 @@ public class InstructionsDeserializerTest { + "00 00 00 00 00 00 00 20 00 00 00 00 00 00 00 30 00 05 00 08 00 00 00 00 00 06 00 08 " + "00 01 02 03 00 03 00 20 00 00 00 00 00 00 00 10 00 00 00 25 00 35 00 00 00 00 00 00 " + "00 16 00 08 00 00 00 50 00 04 00 18 00 00 00 00 00 15 00 08 00 00 00 25 00 0F 00 08 05 00 00 00"); - + message.skipBytes(4); // skip XID - + CodeKeyMaker keyMaker = CodeKeyMakerFactory.createInstructionsKeyMaker(EncodeConstants.OF13_VERSION_ID); List instructions = ListDeserializer.deserializeList(EncodeConstants.OF13_VERSION_ID, message.readableBytes(), message, keyMaker, registry); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/MatchDeserializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/MatchDeserializerTest.java index a3ad2abb..e325baff 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/MatchDeserializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/MatchDeserializerTest.java @@ -132,14 +132,14 @@ public class MatchDeserializerTest { Assert.assertEquals("Wrong Ipv4 address format", new Ipv4Address("0.1.2.3"), entry.getAugmentation(Ipv4AddressMatchEntry.class).getIpv4Address()); } - + /** * Testing Ipv6 address deserialization */ @Test public void testIpv6Address() { ByteBuf buffer = ByteBufUtils.hexStringToByteBuf("80 00 34 10 00 00 00 01 00 02 00 03 00 04 00 05 00 06 0F 07"); - + MatchEntryDeserializerKey key = new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, 0x8000, 26); key.setExperimenterId(null); @@ -148,7 +148,7 @@ public class MatchDeserializerTest { Assert.assertEquals("Wrong Ipv6 address format", new Ipv6Address("0000:0001:0002:0003:0004:0005:0006:0F07"), entry.getAugmentation(Ipv6AddressMatchEntry.class).getIpv6Address()); } - + /** * Testing match deserialization */ @@ -219,25 +219,25 @@ public class MatchDeserializerTest { Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry2.getOxmClass()); Assert.assertEquals("Wrong entry field", Metadata.class, entry2.getOxmMatchField()); Assert.assertEquals("Wrong entry hasMask", true, entry2.isHasMask()); - Assert.assertArrayEquals("Wrong entry value", ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 03"), + Assert.assertArrayEquals("Wrong entry value", ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 03"), entry2.getAugmentation(MetadataMatchEntry.class).getMetadata()); - Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 04"), + Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 04"), entry2.getAugmentation(MaskMatchEntry.class).getMask()); MatchEntries entry3 = entries.get(3); Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry3.getOxmClass()); Assert.assertEquals("Wrong entry field", EthDst.class, entry3.getOxmMatchField()); Assert.assertEquals("Wrong entry hasMask", true, entry3.isHasMask()); - Assert.assertEquals("Wrong entry value", new MacAddress("00:00:00:00:00:05"), + Assert.assertEquals("Wrong entry value", new MacAddress("00:00:00:00:00:05"), entry3.getAugmentation(MacAddressMatchEntry.class).getMacAddress()); - Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 00 00 06"), + Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 00 00 06"), entry3.getAugmentation(MaskMatchEntry.class).getMask()); MatchEntries entry4 = entries.get(4); Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry4.getOxmClass()); Assert.assertEquals("Wrong entry field", EthSrc.class, entry4.getOxmMatchField()); Assert.assertEquals("Wrong entry hasMask", true, entry4.isHasMask()); - Assert.assertEquals("Wrong entry value", new MacAddress("00:00:00:00:00:07"), + Assert.assertEquals("Wrong entry value", new MacAddress("00:00:00:00:00:07"), entry4.getAugmentation(MacAddressMatchEntry.class).getMacAddress()); - Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 00 00 08"), + Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 00 00 08"), entry4.getAugmentation(MaskMatchEntry.class).getMask()); MatchEntries entry5 = entries.get(5); Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry5.getOxmClass()); @@ -251,9 +251,9 @@ public class MatchDeserializerTest { Assert.assertEquals("Wrong entry hasMask", true, entry6.isHasMask()); Assert.assertEquals("Wrong entry value", 10, entry6.getAugmentation(VlanVidMatchEntry.class).getVlanVid().intValue()); - Assert.assertEquals("Wrong entry value", false, + Assert.assertEquals("Wrong entry value", false, entry6.getAugmentation(VlanVidMatchEntry.class).isCfiBit()); - Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 0B"), + Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 0B"), entry6.getAugmentation(MaskMatchEntry.class).getMask()); MatchEntries entry7 = entries.get(7); Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry7.getOxmClass()); @@ -285,7 +285,7 @@ public class MatchDeserializerTest { Assert.assertEquals("Wrong entry hasMask", true, entry11.isHasMask()); Assert.assertEquals("Wrong entry value", new Ipv4Address("10.0.0.1"), entry11.getAugmentation(Ipv4AddressMatchEntry.class).getIpv4Address()); - Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 FF 00"), + Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 FF 00"), entry11.getAugmentation(MaskMatchEntry.class).getMask()); MatchEntries entry12 = entries.get(12); Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry12.getOxmClass()); @@ -293,7 +293,7 @@ public class MatchDeserializerTest { Assert.assertEquals("Wrong entry hasMask", true, entry12.isHasMask()); Assert.assertEquals("Wrong entry value", new Ipv4Address("10.0.0.2"), entry12.getAugmentation(Ipv4AddressMatchEntry.class).getIpv4Address()); - Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 FF"), + Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 FF"), entry12.getAugmentation(MaskMatchEntry.class).getMask()); MatchEntries entry13 = entries.get(13); Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry13.getOxmClass()); @@ -355,7 +355,7 @@ public class MatchDeserializerTest { Assert.assertEquals("Wrong entry hasMask", true, entry22.isHasMask()); Assert.assertEquals("Wrong entry value", new Ipv4Address("10.0.0.9"), entry22.getAugmentation(Ipv4AddressMatchEntry.class).getIpv4Address()); - Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 FF 00"), + Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 FF 00"), entry22.getAugmentation(MaskMatchEntry.class).getMask()); MatchEntries entry23 = entries.get(23); Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry23.getOxmClass()); @@ -363,47 +363,47 @@ public class MatchDeserializerTest { Assert.assertEquals("Wrong entry hasMask", true, entry23.isHasMask()); Assert.assertEquals("Wrong entry value", new Ipv4Address("10.0.0.10"), entry23.getAugmentation(Ipv4AddressMatchEntry.class).getIpv4Address()); - Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 FF"), + Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 FF"), entry23.getAugmentation(MaskMatchEntry.class).getMask()); MatchEntries entry24 = entries.get(24); Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry24.getOxmClass()); Assert.assertEquals("Wrong entry field", ArpSha.class, entry24.getOxmMatchField()); Assert.assertEquals("Wrong entry hasMask", true, entry24.isHasMask()); - Assert.assertEquals("Wrong entry value", new MacAddress("00:00:00:00:00:01"), + Assert.assertEquals("Wrong entry value", new MacAddress("00:00:00:00:00:01"), entry24.getAugmentation(MacAddressMatchEntry.class).getMacAddress()); - Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 00 00 03"), + Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 00 00 03"), entry24.getAugmentation(MaskMatchEntry.class).getMask()); MatchEntries entry25 = entries.get(25); Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry25.getOxmClass()); Assert.assertEquals("Wrong entry field", ArpTha.class, entry25.getOxmMatchField()); Assert.assertEquals("Wrong entry hasMask", true, entry25.isHasMask()); - Assert.assertEquals("Wrong entry value", new MacAddress("00:00:00:00:00:02"), + Assert.assertEquals("Wrong entry value", new MacAddress("00:00:00:00:00:02"), entry25.getAugmentation(MacAddressMatchEntry.class).getMacAddress()); - Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 00 00 04"), + Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 00 00 04"), entry25.getAugmentation(MaskMatchEntry.class).getMask()); MatchEntries entry26 = entries.get(26); Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry26.getOxmClass()); Assert.assertEquals("Wrong entry field", Ipv6Src.class, entry26.getOxmMatchField()); Assert.assertEquals("Wrong entry hasMask", true, entry26.isHasMask()); - Assert.assertEquals("Wrong entry value", new Ipv6Address("0000:0000:0000:0000:0000:0000:0000:0015"), + Assert.assertEquals("Wrong entry value", new Ipv6Address("0000:0000:0000:0000:0000:0000:0000:0015"), entry26.getAugmentation(Ipv6AddressMatchEntry.class).getIpv6Address()); Assert.assertArrayEquals("Wrong entry mask", - ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 16"), + ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 16"), entry26.getAugmentation(MaskMatchEntry.class).getMask()); MatchEntries entry27 = entries.get(27); Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry27.getOxmClass()); Assert.assertEquals("Wrong entry field", Ipv6Dst.class, entry27.getOxmMatchField()); Assert.assertEquals("Wrong entry hasMask", true, entry27.isHasMask()); - Assert.assertEquals("Wrong entry value", new Ipv6Address("0000:0000:0000:0000:0000:0000:0000:0017"), + Assert.assertEquals("Wrong entry value", new Ipv6Address("0000:0000:0000:0000:0000:0000:0000:0017"), entry27.getAugmentation(Ipv6AddressMatchEntry.class).getIpv6Address()); Assert.assertArrayEquals("Wrong entry mask", - ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18"), + ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18"), entry27.getAugmentation(MaskMatchEntry.class).getMask()); MatchEntries entry28 = entries.get(28); Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry28.getOxmClass()); Assert.assertEquals("Wrong entry field", Ipv6Flabel.class, entry28.getOxmMatchField()); Assert.assertEquals("Wrong entry hasMask", true, entry28.isHasMask()); - Assert.assertEquals("Wrong entry value", 2, + Assert.assertEquals("Wrong entry value", 2, entry28.getAugmentation(Ipv6FlabelMatchEntry.class).getIpv6Flabel().getValue().intValue()); Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 03"), entry28.getAugmentation(MaskMatchEntry.class).getMask()); @@ -411,25 +411,25 @@ public class MatchDeserializerTest { Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry29.getOxmClass()); Assert.assertEquals("Wrong entry field", Icmpv6Type.class, entry29.getOxmMatchField()); Assert.assertEquals("Wrong entry hasMask", false, entry29.isHasMask()); - Assert.assertEquals("Wrong entry value", 21, + Assert.assertEquals("Wrong entry value", 21, entry29.getAugmentation(Icmpv6TypeMatchEntry.class).getIcmpv6Type().intValue()); MatchEntries entry30 = entries.get(30); Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry30.getOxmClass()); Assert.assertEquals("Wrong entry field", Icmpv6Code.class, entry30.getOxmMatchField()); Assert.assertEquals("Wrong entry hasMask", false, entry30.isHasMask()); - Assert.assertEquals("Wrong entry value", 23, + Assert.assertEquals("Wrong entry value", 23, entry30.getAugmentation(Icmpv6CodeMatchEntry.class).getIcmpv6Code().intValue()); MatchEntries entry31 = entries.get(31); Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry31.getOxmClass()); Assert.assertEquals("Wrong entry field", Ipv6NdTarget.class, entry31.getOxmMatchField()); Assert.assertEquals("Wrong entry hasMask", false, entry31.isHasMask()); - Assert.assertEquals("Wrong entry value", new Ipv6Address("0000:0000:0000:0000:0000:0000:0000:0020"), + Assert.assertEquals("Wrong entry value", new Ipv6Address("0000:0000:0000:0000:0000:0000:0000:0020"), entry31.getAugmentation(Ipv6AddressMatchEntry.class).getIpv6Address()); MatchEntries entry32 = entries.get(32); Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry32.getOxmClass()); Assert.assertEquals("Wrong entry field", Ipv6NdSll.class, entry32.getOxmMatchField()); Assert.assertEquals("Wrong entry hasMask", false, entry32.isHasMask()); - Assert.assertEquals("Wrong entry value", new MacAddress("00:05:00:00:00:01"), + Assert.assertEquals("Wrong entry value", new MacAddress("00:05:00:00:00:01"), entry32.getAugmentation(MacAddressMatchEntry.class).getMacAddress()); MatchEntries entry33 = entries.get(33); Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry33.getOxmClass()); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10ActionsDeserializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10ActionsDeserializerTest.java index 3e83bf4b..2dd21e82 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10ActionsDeserializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10ActionsDeserializerTest.java @@ -63,7 +63,7 @@ public class OF10ActionsDeserializerTest { + "00 09 00 08 00 02 00 00 " + "00 0A 00 08 00 03 00 00 " + "00 0B 00 10 00 04 00 00 00 00 00 00 00 00 00 30"); - + message.skipBytes(4); // skip XID CodeKeyMaker keyMaker = CodeKeyMakerFactory.createActionsKeyMaker(EncodeConstants.OF10_VERSION_ID); List actions = ListDeserializer.deserializeList(EncodeConstants.OF10_VERSION_ID, @@ -97,7 +97,7 @@ public class OF10ActionsDeserializerTest { Action action6 = actions.get(5); Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight" + ".openflow.common.action.rev130731.SetDlDst", action6.getType().getName()); - Assert.assertArrayEquals("Wrong dl-dst", ByteBufUtils.macAddressToBytes("02:03:04:05:06:07"), + Assert.assertArrayEquals("Wrong dl-dst", ByteBufUtils.macAddressToBytes("02:03:04:05:06:07"), ByteBufUtils.macAddressToBytes(action6.getAugmentation(DlAddressAction.class).getDlAddress().getValue())); Action action7 = actions.get(6); Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight" diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10ActionsSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10ActionsSerializerTest.java index 3b72cb4d..ad9f0c14 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10ActionsSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10ActionsSerializerTest.java @@ -72,7 +72,7 @@ public class OF10ActionsSerializerTest { } /** - * Testing correct serialization of actions (OF v1.0) + * Testing correct serialization of actions (OF v1.0) */ @Test public void test() { @@ -152,11 +152,11 @@ public class OF10ActionsSerializerTest { queueBuilder.setQueueId(400L); actionBuilder.addAugmentation(QueueIdAction.class, queueBuilder.build()); actions.add(actionBuilder.build()); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); ListSerializer.serializeList(actions, TypeKeyMakerFactory .createActionKeyMaker(EncodeConstants.OF10_VERSION_ID), registry, out); - + Assert.assertEquals("Wrong action type", 0, out.readUnsignedShort()); Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort()); Assert.assertEquals("Wrong port", 42, out.readUnsignedShort()); @@ -215,5 +215,5 @@ public class OF10ActionsSerializerTest { Assert.assertEquals("Wrong queue-id", 400, out.readUnsignedInt()); Assert.assertTrue("Written more bytes than needed", out.readableBytes() == 0); } - + } \ No newline at end of file diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchDeserializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchDeserializerTest.java index 262be94b..0201f609 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchDeserializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchDeserializerTest.java @@ -69,7 +69,7 @@ public class OF10MatchDeserializerTest { Assert.assertEquals("Wrong tp-src", 20560, match.getTpSrc().shortValue()); Assert.assertEquals("Wrong tp-dst", 8224, match.getTpDst().shortValue()); } - + /** * Testing correct deserialization of ofp_match */ diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializerTest.java index ca295ea1..e19ede8c 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializerTest.java @@ -70,7 +70,7 @@ public class OF10MatchSerializerTest { builder.setTpDst(4096); MatchV10 match = builder.build(); matchSerializer.serialize(match, out); - + Assert.assertEquals("Wrong wildcards", 2361553, out.readUnsignedInt()); Assert.assertEquals("Wrong in-port", 6653, out.readUnsignedShort()); byte[] dlSrc = new byte[6]; @@ -91,7 +91,7 @@ public class OF10MatchSerializerTest { Assert.assertEquals("Wrong tp-src", 2048, out.readUnsignedShort()); Assert.assertEquals("Wrong tp-dst", 4096, out.readUnsignedShort()); } - + /** * Testing correct serialization of ofp_match */ @@ -117,7 +117,7 @@ public class OF10MatchSerializerTest { builder.setTpDst(4096); MatchV10 match = builder.build(); matchSerializer.serialize(match, out); - + Assert.assertEquals("Wrong wildcards", 3678463, out.readUnsignedInt()); Assert.assertEquals("Wrong in-port", 6653, out.readUnsignedShort()); byte[] dlSrc = new byte[6]; diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13ActionsSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13ActionsSerializerTest.java index 4f01fd20..ed47b014 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13ActionsSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13ActionsSerializerTest.java @@ -64,7 +64,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm. /** * @author michal.polkorab - * + * */ public class OF13ActionsSerializerTest { @@ -175,11 +175,11 @@ public class OF13ActionsSerializerTest { actionBuilder = new ActionBuilder(); actionBuilder.setType(PopPbb.class); actions.add(actionBuilder.build()); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); ListSerializer.serializeList(actions, TypeKeyMakerFactory .createActionKeyMaker(EncodeConstants.OF13_VERSION_ID), registry, out); - + Assert.assertEquals("Wrong action type", 0, out.readUnsignedShort()); Assert.assertEquals("Wrong action length", 16, out.readUnsignedShort()); Assert.assertEquals("Wrong action port", 42, out.readUnsignedInt()); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13InstructionsSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13InstructionsSerializerTest.java index 68fe7510..6e972f82 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13InstructionsSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13InstructionsSerializerTest.java @@ -142,11 +142,11 @@ public class OF13InstructionsSerializerTest { actionsBuilder.setAction(actions); builder.addAugmentation(ActionsInstruction.class, actionsBuilder.build()); instructions.add(builder.build()); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); ListSerializer.serializeList(instructions, TypeKeyMakerFactory .createInstructionKeyMaker(EncodeConstants.OF13_VERSION_ID), registry, out); - + Assert.assertEquals("Wrong instruction type", 1, out.readUnsignedShort()); Assert.assertEquals("Wrong instruction length", 8, out.readUnsignedShort()); Assert.assertEquals("Wrong instruction table-id", 5, out.readUnsignedByte()); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer02Test.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer02Test.java index e607d0fc..a29b8437 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer02Test.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer02Test.java @@ -152,15 +152,15 @@ public class OF13MatchSerializer02Test { MatchBuilder builder = new MatchBuilder(); builder.setType(OxmMatchType.class); Match match = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); matchSerializer.serialize(match, out); - + Assert.assertEquals("Wrong match type", 1, out.readUnsignedShort()); Assert.assertEquals("Wrong match length", 4, out.readUnsignedShort()); Assert.assertTrue("Wrong padding", out.readableBytes() == 4); } - + /** * Testing serialization of match */ @@ -510,7 +510,7 @@ public class OF13MatchSerializer02Test { bosBuilder.setBos(true); entryBuilder.addAugmentation(BosMatchEntry.class, bosBuilder.build()); entries.add(entryBuilder.build()); - + entryBuilder = new MatchEntriesBuilder(); entryBuilder.setOxmClass(OpenflowBasicClass.class); entryBuilder.setOxmMatchField(PbbIsid.class); @@ -522,7 +522,7 @@ public class OF13MatchSerializer02Test { maskBuilder.setMask(new byte[]{0,1,2}); entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build()); entries.add(entryBuilder.build()); - + entryBuilder = new MatchEntriesBuilder(); entryBuilder.setOxmClass(OpenflowBasicClass.class); entryBuilder.setOxmMatchField(TunnelId.class); @@ -534,7 +534,7 @@ public class OF13MatchSerializer02Test { maskBuilder.setMask(new byte[]{0,0,0,0,0,0,0,2}); entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build()); entries.add(entryBuilder.build()); - + entryBuilder = new MatchEntriesBuilder(); entryBuilder.setOxmClass(OpenflowBasicClass.class); entryBuilder.setOxmMatchField(Ipv6Exthdr.class); @@ -546,15 +546,15 @@ public class OF13MatchSerializer02Test { maskBuilder.setMask(new byte[]{0,2}); entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build()); entries.add(entryBuilder.build()); - - - + + + builder.setMatchEntries(entries); Match match = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); matchSerializer.serialize(match, out); - + Assert.assertEquals("Wrong match type", 1, out.readUnsignedShort()); Assert.assertEquals("Wrong match length", 428, out.readUnsignedShort()); Assert.assertEquals("Wrong match entry class", 0x8000, out.readUnsignedShort()); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializerTest.java index ca39e1a7..6b82e9e6 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializerTest.java @@ -94,10 +94,10 @@ public class OF13MatchSerializerTest { entries.add(entriesBuilder.build()); builder.setMatchEntries(entries); Match match = builder.build(); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); matchSerializer.serialize(match, out); - + Assert.assertEquals("Wrong type", 1, out.readUnsignedShort()); out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); Assert.assertEquals("Wrong class", 0x8000, out.readUnsignedShort()); @@ -108,7 +108,7 @@ public class OF13MatchSerializerTest { Assert.assertEquals("Wrong ip address (third number)", 3, out.readUnsignedByte()); Assert.assertEquals("Wrong ip address (fourth number)", 4, out.readUnsignedByte()); } - + /** * Test for correct serialization of Ipv6Address match entry */ @@ -166,7 +166,7 @@ public class OF13MatchSerializerTest { Match match = builder.build(); ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); matchSerializer.serialize(match, out); - + Assert.assertEquals("Wrong type", 1, out.readUnsignedShort()); out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); Assert.assertEquals("Wrong class", 0x8000, out.readUnsignedShort()); @@ -255,10 +255,10 @@ public class OF13MatchSerializerTest { @Test public void testIpv6Flabel() { Match match = buildIpv6FLabelMatch(0x0f9e8dL, false, null); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); matchSerializer.serialize(match, out); - + Assert.assertEquals("Wrong type", 1, out.readUnsignedShort()); out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); Assert.assertEquals("Wrong class", 0x8000, out.readUnsignedShort()); @@ -266,21 +266,21 @@ public class OF13MatchSerializerTest { out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES); byte[] label = new byte[4]; out.readBytes(label); - + LOG.debug("label: "+ ByteBufUtils.bytesToHexString(label)); Assert.assertArrayEquals("Wrong ipv6FLabel", new byte[]{0, 0x0f, (byte) 0x9e, (byte) 0x8d}, label); } - + /** * Test for correct serialization of Ipv4Address match entry with mask */ @Test public void testIpv6FlabelWithMask() { Match match = buildIpv6FLabelMatch(0x0f9e8dL, true, new byte[]{0, 0x0c, 0x7b, 0x6a}); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); matchSerializer.serialize(match, out); - + Assert.assertEquals("Wrong type", 1, out.readUnsignedShort()); out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES); Assert.assertEquals("Wrong class", 0x8000, out.readUnsignedShort()); @@ -288,20 +288,20 @@ public class OF13MatchSerializerTest { out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES); byte[] labelAndMask = new byte[8]; out.readBytes(labelAndMask); - + LOG.debug("label: "+ByteBufUtils.bytesToHexString(labelAndMask)); Assert.assertArrayEquals("Wrong ipv6FLabel", new byte[]{0, 0x0f, (byte) 0x9e, (byte) 0x8d, 0, 0x0c, 0x7b, 0x6a}, labelAndMask); } - + /** * Test for correct serialization of Ipv4Address match entry with wrong mask */ @Test public void testIpv6FlabelWithMaskBad() { Match match = buildIpv6FLabelMatch(0x0f9e8dL, true, new byte[]{0x0c, 0x7b, 0x6a}); - + ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer(); - + try { matchSerializer.serialize(match, out); Assert.fail("incorrect length of mask ignored"); diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/statistics/StatisticsCountersTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/statistics/StatisticsCountersTest.java index d922d590..fbe48b17 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/statistics/StatisticsCountersTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/statistics/StatisticsCountersTest.java @@ -15,7 +15,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * General tests for StatisticsCounters class + * General tests for StatisticsCounters class * @author madamjak * */ @@ -54,7 +54,7 @@ public class StatisticsCountersTest { } else { Assert.assertNull("Wrong - not enabled counter give not null value", statCounters.getCounter(cet)); } - + } statCounters.resetCounters(); for(CounterEventTypes cet : CounterEventTypes.values()){ diff --git a/openflow-protocol-it/pom.xml b/openflow-protocol-it/pom.xml index 4ef8ec36..2751cc9f 100644 --- a/openflow-protocol-it/pom.xml +++ b/openflow-protocol-it/pom.xml @@ -12,7 +12,7 @@ https://wiki.opendaylight.org/view/Openflow_Protocol_Library:Main HEAD - + ${project.groupId} diff --git a/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java b/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java index a1440961..411bc5ea 100644 --- a/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java +++ b/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java @@ -47,7 +47,7 @@ public class IntegrationTest { private static final Logger LOGGER = LoggerFactory .getLogger(IntegrationTest.class); - + private static int port; private TlsConfiguration tlsConfiguration; private static final int SWITCH_IDLE_TIMEOUT = 2000; @@ -63,7 +63,7 @@ public class IntegrationTest { */ public void setUp(TransportProtocol protocol) throws Exception { LOGGER.debug("\n starting test -------------------------------"); - + String currentDir = System.getProperty("user.dir"); LOGGER.debug("Current dir using System:" +currentDir); startupAddress = InetAddress.getLocalHost(); @@ -76,7 +76,7 @@ public class IntegrationTest { connConfig = new ConnectionConfigurationImpl(startupAddress, 0, tlsConfiguration, SWITCH_IDLE_TIMEOUT); connConfig.setTransferProtocol(protocol); mockPlugin = new MockPlugin(); - + switchConnectionProvider = new SwitchConnectionProviderImpl(); switchConnectionProvider.setSwitchConnectionHandler(mockPlugin); switchConnectionProvider.setConfiguration(connConfig); @@ -101,7 +101,7 @@ public class IntegrationTest { /** * Library integration and communication test with handshake - * @throws Exception + * @throws Exception */ @Test public void testHandshake() throws Exception { @@ -113,13 +113,13 @@ public class IntegrationTest { OFClient firstClient = clients.get(0); firstClient.getScenarioDone().get(); Thread.sleep(1000); - + LOGGER.debug("testHandshake() Finished") ; } /** * Library integration and secured communication test with handshake - * @throws Exception + * @throws Exception */ @Test public void testTlsHandshake() throws Exception { @@ -131,13 +131,13 @@ public class IntegrationTest { OFClient firstClient = clients.get(0); firstClient.getScenarioDone().get(); Thread.sleep(1000); - + LOGGER.debug("testTlsHandshake() Finished") ; } /** * Library integration and communication test with handshake + echo exchange - * @throws Exception + * @throws Exception */ @Test public void testHandshakeAndEcho() throws Exception { @@ -158,7 +158,7 @@ public class IntegrationTest { /** * Library integration and secured communication test with handshake + echo exchange - * @throws Exception + * @throws Exception */ @Test public void testTlsHandshakeAndEcho() throws Exception { @@ -179,7 +179,7 @@ public class IntegrationTest { /** * Library udp integration and communication test with handshake + echo exchange - * @throws Exception + * @throws Exception */ @Test public void testUdpHandshakeAndEcho() throws Exception { @@ -208,7 +208,7 @@ public class IntegrationTest { } /** - * @param amountOfCLients + * @param amountOfCLients * @param protocol true if encrypted connection should be used * @return new clients up and running * @throws ExecutionException if some client could not start diff --git a/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/MockPlugin.java b/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/MockPlugin.java index b4f69bb0..f8298bbf 100644 --- a/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/MockPlugin.java +++ b/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/MockPlugin.java @@ -48,7 +48,7 @@ import com.google.common.util.concurrent.SettableFuture; * @author michal.polkorab * */ -public class MockPlugin implements OpenflowProtocolListener, SwitchConnectionHandler, +public class MockPlugin implements OpenflowProtocolListener, SwitchConnectionHandler, SystemNotificationsListener, ConnectionReadyListener { protected static final Logger LOGGER = LoggerFactory.getLogger(MockPlugin.class); @@ -62,7 +62,7 @@ public class MockPlugin implements OpenflowProtocolListener, SwitchConnectionHan finishedFuture = SettableFuture.create(); LOGGER.debug("mockPlugin: "+System.identityHashCode(this)); } - + @Override public void onSwitchConnected(ConnectionAdapter connection) { LOGGER.debug("onSwitchConnected: " + connection); @@ -100,19 +100,19 @@ public class MockPlugin implements OpenflowProtocolListener, SwitchConnectionHan @Override public void onErrorMessage(ErrorMessage notification) { LOGGER.debug("Error message received"); - + } @Override public void onExperimenterMessage(ExperimenterMessage notification) { LOGGER.debug("Experimenter message received"); - + } @Override public void onFlowRemovedMessage(FlowRemovedMessage notification) { LOGGER.debug("FlowRemoved message received"); - + } @Override @@ -137,7 +137,7 @@ public class MockPlugin implements OpenflowProtocolListener, SwitchConnectionHan }).start(); } - + protected void getSwitchFeatures() { GetFeaturesInputBuilder featuresBuilder = new GetFeaturesInputBuilder(); featuresBuilder.setVersion((short) 4); @@ -169,7 +169,7 @@ public class MockPlugin implements OpenflowProtocolListener, SwitchConnectionHan Future disconnect = adapter.disconnect(); disconnect.get(); LOGGER.debug("MockPlugin.shutdown() Disconnected"); - } + } } catch (Exception e) { LOGGER.error("MockPlugin.shutdown() exception caught: ", e.getMessage(), e); } @@ -179,7 +179,7 @@ public class MockPlugin implements OpenflowProtocolListener, SwitchConnectionHan @Override public void onMultipartReplyMessage(MultipartReplyMessage notification) { LOGGER.debug("MultipartReply message received"); - + } @Override @@ -198,7 +198,7 @@ public class MockPlugin implements OpenflowProtocolListener, SwitchConnectionHan @Override public void onPortStatusMessage(PortStatusMessage notification) { LOGGER.debug("MockPlugin.onPortStatusMessage() message received"); - + } @Override @@ -225,7 +225,7 @@ public class MockPlugin implements OpenflowProtocolListener, SwitchConnectionHan public int getIdleCounter() { return idleCounter; } - + @Override public void onConnectionReady() { LOGGER.trace("MockPlugin().onConnectionReady()"); diff --git a/openflow-protocol-spi/pom.xml b/openflow-protocol-spi/pom.xml index 6cef4f39..18369f5e 100644 --- a/openflow-protocol-spi/pom.xml +++ b/openflow-protocol-spi/pom.xml @@ -7,13 +7,13 @@ openflow-protocol-spi bundle - + Openflow Protocol Library - SPI https://wiki.opendaylight.org/view/Openflow_Protocol_Library:Main HEAD - + @@ -81,7 +81,7 @@ - + ${project.groupId} diff --git a/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java b/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java index 69d08fbb..b57500b4 100644 --- a/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java +++ b/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java @@ -28,20 +28,20 @@ public interface SwitchConnectionProvider extends AutoCloseable, * @param configuration [protocol, port, address and supported features] */ void setConfiguration(ConnectionConfiguration configuration); - + /** * start listening to switches, but please don't forget to do * {@link #setSwitchConnectionHandler(SwitchConnectionHandler)} first * @return future, triggered to true, when listening channel is up and running */ ListenableFuture startup(); - + /** * stop listening to switches * @return future, triggered to true, when all listening channels are down */ ListenableFuture shutdown(); - + /** * @param switchConHandler instance being informed when new switch connects */ diff --git a/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/statistics/StatisticsHandler.java b/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/statistics/StatisticsHandler.java index 1d2c580b..3779a5eb 100644 --- a/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/statistics/StatisticsHandler.java +++ b/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/statistics/StatisticsHandler.java @@ -10,7 +10,7 @@ package org.opendaylight.openflowjava.protocol.spi.statistics; /** * Used for JConsole service - * + * * @author michal.polkorab */ public interface StatisticsHandler { diff --git a/openflowjava-config/pom.xml b/openflowjava-config/pom.xml index 91edd9e8..deeade0d 100644 --- a/openflowjava-config/pom.xml +++ b/openflowjava-config/pom.xml @@ -1,7 +1,7 @@ - diff --git a/pom.xml b/pom.xml index 71becad6..67148ce6 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ 2010.09.24.7-SNAPSHOT 2013.09.07.7-SNAPSHOT 2.4.0 - 14.0.1 + 14.0.1 4.0.23.Final 2.3.2 0.7.0-SNAPSHOT @@ -266,7 +266,7 @@ deploy jar-no-fork - + diff --git a/simple-client/pom.xml b/simple-client/pom.xml index e73c7624..a68633e1 100644 --- a/simple-client/pom.xml +++ b/simple-client/pom.xml @@ -12,7 +12,7 @@ https://wiki.opendaylight.org/view/Openflow_Protocol_Library:Main HEAD - + @@ -26,7 +26,7 @@ - + ${project.groupId} diff --git a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/ClientSslContextFactory.java b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/ClientSslContextFactory.java index a6d93aba..9b46d6c0 100644 --- a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/ClientSslContextFactory.java +++ b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/ClientSslContextFactory.java @@ -45,14 +45,14 @@ public final class ClientSslContextFactory { KeyManagerFactory kmf = KeyManagerFactory.getInstance(algorithm); kmf.init(ks, ClientSslKeyStore.getCertificatePassword()); - + KeyStore ts = KeyStore.getInstance("JKS"); ts.load(ClientSslTrustStore.asInputStream(), ClientSslTrustStore.getKeyStorePassword()); - + TrustManagerFactory tmf = TrustManagerFactory.getInstance(algorithm); tmf.init(ts); - + clientContext = SSLContext.getInstance(PROTOCOL); clientContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); } catch (Exception e) { diff --git a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/OFClient.java b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/OFClient.java index 02a2199a..169395c6 100644 --- a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/OFClient.java +++ b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/OFClient.java @@ -12,7 +12,7 @@ import com.google.common.util.concurrent.SettableFuture; /** * Unifying interface for simple clients / switch simulators - * + * * @author michal.polkorab */ public interface OFClient extends Runnable { diff --git a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/ScenarioFactory.java b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/ScenarioFactory.java index 264bedfd..a6afb6a5 100644 --- a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/ScenarioFactory.java +++ b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/ScenarioFactory.java @@ -14,7 +14,7 @@ import org.opendaylight.openflowjava.util.ByteBufUtils; /** * Class for providing prepared handshake scenario - * + * * @author michal.polkorab */ public final class ScenarioFactory { diff --git a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/ScenarioHandler.java b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/ScenarioHandler.java index 61333f87..075c6568 100644 --- a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/ScenarioHandler.java +++ b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/ScenarioHandler.java @@ -19,7 +19,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * + * * @author michal.polkorab * */ @@ -33,7 +33,7 @@ public class ScenarioHandler extends Thread { private boolean scenarioFinished = false; /** - * + * * @param scenario */ public ScenarioHandler(Stack scenario) { @@ -84,7 +84,7 @@ public class ScenarioHandler extends Thread { this.notify(); } } - + /** * @return true if scenario is done / empty */ diff --git a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SendEvent.java b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SendEvent.java index db339eb2..c5765272 100644 --- a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SendEvent.java +++ b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SendEvent.java @@ -17,7 +17,7 @@ import org.slf4j.LoggerFactory; /** * Class representing sending message event - * + * * @author michal.polkorab */ public class SendEvent implements ClientEvent { diff --git a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClient.java b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClient.java index 89854c7e..b097b1d1 100644 --- a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClient.java +++ b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClient.java @@ -37,7 +37,7 @@ public class SimpleClient implements OFClient { private SettableFuture isOnlineFuture; private SettableFuture scenarioDone; private ScenarioHandler scenarioHandler; - + /** * Constructor of class * @@ -54,7 +54,7 @@ public class SimpleClient implements OFClient { isOnlineFuture = SettableFuture.create(); scenarioDone = SettableFuture.create(); } - + /** * Starting class of {@link SimpleClient} */ diff --git a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientHandler.java b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientHandler.java index 1c888067..01e114bf 100644 --- a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientHandler.java +++ b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientHandler.java @@ -62,7 +62,7 @@ public class SimpleClientHandler extends ChannelInboundHandlerAdapter { } scenarioHandler.setCtx(ctx); scenarioHandler.start(); - + } /** diff --git a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientInitializer.java b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientInitializer.java index c44a660c..a2fe3a11 100644 --- a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientInitializer.java +++ b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientInitializer.java @@ -19,11 +19,11 @@ import javax.net.ssl.SSLEngine; import com.google.common.util.concurrent.SettableFuture; /** Initializes secured {@link SimpleClient} pipeline - * + * * @author michal.polkorab */ public class SimpleClientInitializer extends ChannelInitializer { - + private SettableFuture isOnlineFuture; private boolean secured; private ScenarioHandler scenarioHandler; diff --git a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SleepEvent.java b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SleepEvent.java index 25ed0d46..b1e1a50c 100644 --- a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SleepEvent.java +++ b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SleepEvent.java @@ -13,7 +13,7 @@ import org.slf4j.LoggerFactory; /** * Class representing sleep (wait) event - * + * * @author michal.polkorab */ public class SleepEvent implements ClientEvent { @@ -22,7 +22,7 @@ public class SleepEvent implements ClientEvent { private long sleepTime; /** - * + * * @param sleepTime time of {@link Thread#sleep(long)} in milliseconds */ public SleepEvent(long sleepTime) { diff --git a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/UdpSimpleClient.java b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/UdpSimpleClient.java index 92e88672..e9d69da1 100644 --- a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/UdpSimpleClient.java +++ b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/UdpSimpleClient.java @@ -37,7 +37,7 @@ public class UdpSimpleClient implements OFClient { private SettableFuture isOnlineFuture; private SettableFuture scenarioDone; private ScenarioHandler scenarioHandler; - + /** * Constructor of class * @@ -54,7 +54,7 @@ public class UdpSimpleClient implements OFClient { isOnlineFuture = SettableFuture.create(); scenarioDone = SettableFuture.create(); } - + /** * Starting class of {@link UdpSimpleClient} */ @@ -125,7 +125,7 @@ public class UdpSimpleClient implements OFClient { sc = new UdpSimpleClient(host, port); } sc.run(); - + } @Override diff --git a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/UdpSimpleClientInitializer.java b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/UdpSimpleClientInitializer.java index cd7a8a8a..11444427 100644 --- a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/UdpSimpleClientInitializer.java +++ b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/UdpSimpleClientInitializer.java @@ -16,11 +16,11 @@ import io.netty.channel.socket.nio.NioDatagramChannel; import com.google.common.util.concurrent.SettableFuture; /** Initializes udp pipeline - * + * * @author michal.polkorab */ public class UdpSimpleClientInitializer extends ChannelInitializer { - + private SettableFuture isOnlineFuture; private ScenarioHandler scenarioHandler; diff --git a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/WaitForMessageEvent.java b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/WaitForMessageEvent.java index c4c786c6..bcf696e9 100644 --- a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/WaitForMessageEvent.java +++ b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/WaitForMessageEvent.java @@ -19,7 +19,7 @@ import org.slf4j.LoggerFactory; * @author michal.polkorab */ public class WaitForMessageEvent implements ClientEvent { - + private static final Logger LOGGER = LoggerFactory.getLogger(WaitForMessageEvent.class); private byte[] headerExpected; private byte[] headerReceived; diff --git a/util/src/test/java/org/opendaylight/openflowjava/util/ByteBufUtilsTest.java b/util/src/test/java/org/opendaylight/openflowjava/util/ByteBufUtilsTest.java index 9bbb0d74..7113eb06 100644 --- a/util/src/test/java/org/opendaylight/openflowjava/util/ByteBufUtilsTest.java +++ b/util/src/test/java/org/opendaylight/openflowjava/util/ByteBufUtilsTest.java @@ -31,7 +31,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 public class ByteBufUtilsTest { private byte[] expected = new byte[]{0x01, 0x02, 0x03, 0x04, 0x05, (byte) 0xff}; - + /** * Test of {@link org.opendaylight.openflowjava.util.ByteBufUtils#hexStringToBytes(String)} */ @@ -58,10 +58,10 @@ public class ByteBufUtilsTest { @Test public void testHexStringToByteBuf() { ByteBuf bb = ByteBufUtils.hexStringToByteBuf("01 02 03 04 05 ff"); - + Assert.assertArrayEquals(expected, byteBufToByteArray(bb)); } - + /** * Test of {@link ByteBufUtils#hexStringToByteBuf(String, ByteBuf)} */ @@ -72,13 +72,13 @@ public class ByteBufUtilsTest { Assert.assertArrayEquals(expected, byteBufToByteArray(buffer)); } - + private static byte[] byteBufToByteArray(ByteBuf bb) { byte[] result = new byte[bb.readableBytes()]; bb.readBytes(result); return result; } - + /** * Test of {@link ByteBufUtils#fillBitMaskFromMap(java.util.Map)} */ @@ -87,15 +87,15 @@ public class ByteBufUtilsTest { Map emptyMap = new HashMap<>(); String expectedBinaryString = "00000000000000000000000000000000"; String bitmaskInBinaryString = toBinaryString(emptyMap, 32); - + Assert.assertEquals("Not null string", expectedBinaryString, bitmaskInBinaryString); } private static String toBinaryString(Map emptyMap, int length) { - String binaryString = Integer.toBinaryString(ByteBufUtils.fillBitMaskFromMap(emptyMap)); + String binaryString = Integer.toBinaryString(ByteBufUtils.fillBitMaskFromMap(emptyMap)); return String.format("%"+length+"s", binaryString).replaceAll(" ", "0"); } - + /** * Test of {@link ByteBufUtils#fillBitMaskFromMap(java.util.Map)} */ @@ -110,7 +110,7 @@ public class ByteBufUtilsTest { bitmaskValueInBinarySytring = toBinaryString(fullMap, 32); Assert.assertEquals("Strings does not match", expectedBinaryString, bitmaskValueInBinarySytring); } - + /** * Test of {@link ByteBufUtils#fillBitMaskFromMap(java.util.Map)} */ @@ -125,7 +125,7 @@ public class ByteBufUtilsTest { bitmaskValueInBinarySytring = toBinaryString(zeroMap, 32); Assert.assertEquals("Strings does not match", expectedBinaryString, bitmaskValueInBinarySytring); } - + /** * Test of {@link ByteBufUtils#fillBitMaskFromMap(java.util.Map)} */ @@ -145,7 +145,7 @@ public class ByteBufUtilsTest { bitmaskValueInBinarySytring = toBinaryString(randomMap, 32); Assert.assertEquals("Strings does not match", expectedBinaryString, bitmaskValueInBinarySytring); } - + /** * Test of {@link ByteBufUtils#fillBitMaskFromList(List)} */ @@ -155,17 +155,17 @@ public class ByteBufUtilsTest { emptyList.add(null); String expectedBinaryString = "00000000000000000000000000000000"; String bitmaskInBinaryString = listToBinaryString(emptyList, 32); - + Assert.assertEquals("Not null string", expectedBinaryString, bitmaskInBinaryString); } private static String listToBinaryString(List emptyList, int length) { int[] bitMaskArray; bitMaskArray = ByteBufUtils.fillBitMaskFromList(emptyList); - String binaryString = Integer.toBinaryString(bitMaskArray[0]); + String binaryString = Integer.toBinaryString(bitMaskArray[0]); return String.format("%"+length+"s", binaryString).replaceAll(" ", "0"); } - + /** * Test of {@link ByteBufUtils#fillBitMaskFromList(List)} */ @@ -180,7 +180,7 @@ public class ByteBufUtilsTest { bitmaskValueInBinarySytring = listToBinaryString(fullList, 32); Assert.assertEquals("Strings does not match", expectedBinaryString, bitmaskValueInBinarySytring); } - + /** * Test of {@link ByteBufUtils#fillBitMaskFromList(List)} */ @@ -195,7 +195,7 @@ public class ByteBufUtilsTest { bitmaskValueInBinarySytring = listToBinaryString(zeroList, 32); Assert.assertEquals("Strings does not match", expectedBinaryString, bitmaskValueInBinarySytring); } - + /** * Test of {@link ByteBufUtils#fillBitMaskFromList(List)} */ @@ -323,7 +323,7 @@ public class ByteBufUtilsTest { public void testDecodeString() { ByteBuf buf = ByteBufUtils.hexStringToByteBuf("4A 41 4D 45 53 20 42 4F 4E 44 00 00 00 00 00 00"); Assert.assertEquals("Wrong string decoded", "JAMES BOND", ByteBufUtils.decodeNullTerminatedString(buf, 16)); - + ByteBuf buf2 = ByteBufUtils.hexStringToByteBuf("53 50 49 44 45 52 4D 41 4E 00 00 00 00 00 00"); Assert.assertEquals("Wrong string decoded", "SPIDERMAN", ByteBufUtils.decodeNullTerminatedString(buf2, 15)); } @@ -409,7 +409,7 @@ public class ByteBufUtilsTest { String ipv4Address = ByteBufUtils.readIpv4Address(buffer); Assert.assertEquals("Wrong conversion", "10.20.30.40", ipv4Address); Assert.assertTrue("Unexpected data", buffer.readableBytes() == 0); - + ByteBuf buffer2 = PooledByteBufAllocator.DEFAULT.buffer(); buffer.writeByte(10); ipv4Address = ByteBufUtils.readIpv4Address(buffer2); @@ -432,7 +432,7 @@ public class ByteBufUtilsTest { String ipv4Address = ByteBufUtils.readIpv6Address(buffer); Assert.assertEquals("Wrong conversion", "000A:FFFF:1000:0000:0400:002A:0A08:B279", ipv4Address); Assert.assertTrue("Unexpected data", buffer.readableBytes() == 0); - + ByteBuf buffer2 = PooledByteBufAllocator.DEFAULT.buffer(); buffer.writeShort(10); ipv4Address = ByteBufUtils.readIpv6Address(buffer2);