* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.deserialization.messages;
import static org.junit.Assert.assertEquals;
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.UnpooledByteBufAllocator;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupModCommand;
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.UnpooledByteBufAllocator;
-
public class GroupMessageDeserializerTest extends AbstractDeserializerTest {
private static final byte PADDING = 1;
}
@Test
- public void deserialize() throws Exception {
+ public void deserialize() {
// Group header
buffer.writeByte(TYPE);
buffer.writeShort(EncodeConstants.EMPTY_LENGTH);
assertEquals(GROUP_TYPE.getIntValue(), message.getGroupType().getIntValue());
assertEquals(1, message.getBuckets().getBucket().size());
- final Bucket bucket = message.getBuckets().getBucket().get(0);
+ final Bucket bucket = message.getBuckets().nonnullBucket().values().iterator().next();
assertEquals(WEIGHT, bucket.getWeight().shortValue());
assertEquals(WATCH_PORT, bucket.getWatchPort().intValue());
assertEquals(WATCH_GROUP, bucket.getWatchGroup().intValue());
assertEquals(1, bucket.getAction().size());
- assertEquals(PopPbbActionCase.class, bucket.getAction().get(0).getAction().getImplementedInterface());
+ assertEquals(PopPbbActionCase.class,
+ bucket.nonnullAction().values().iterator().next().getAction().implementedInterface());
}
}