X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Fstatistics%2FSinglePurposeMultipartReplyTranslatorTest.java;h=5ab810539ebbfdc55b2129595d0743495a88cc85;hb=44da2880eee5acbc7da23f82c4807b0337efed66;hp=7e2c5a9257705a448ec154696d51f9cc9e236d0b;hpb=d10c556113e37e0cb9fa08ed47932f72ba454ee3;p=openflowplugin.git diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/SinglePurposeMultipartReplyTranslatorTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/SinglePurposeMultipartReplyTranslatorTest.java index 7e2c5a9257..5ab810539e 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/SinglePurposeMultipartReplyTranslatorTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/SinglePurposeMultipartReplyTranslatorTest.java @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * 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.statistics; import static org.junit.Assert.assertEquals; @@ -9,10 +16,13 @@ import com.google.common.collect.Lists; import java.math.BigInteger; import java.util.Collections; import java.util.List; +import org.junit.Before; import org.junit.Test; import org.opendaylight.openflowplugin.api.OFConstants; import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; +import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager; +import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManagerFactory; import org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.AggregateFlowStatisticsUpdate; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdate; @@ -22,7 +32,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111. import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupTypes; import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.desc.stats.reply.GroupDescStats; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Node; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionType; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupId; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupType; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags; @@ -54,7 +63,7 @@ public class SinglePurposeMultipartReplyTranslatorTest { private static final BigInteger DUMMY_DATAPATH_ID = new BigInteger("21"); private static final Long DUMMY_XID = 1L; - private static final SinglePurposeMultipartReplyTranslator singlePurposeMultipartReplyTranslator = new SinglePurposeMultipartReplyTranslator(); + private SinglePurposeMultipartReplyTranslator singlePurposeMultipartReplyTranslator; private static final BigInteger DUMMY_BYTE_COUNT = new BigInteger("31"); private static final BigInteger DUMMY_PACKET_COUNT = new BigInteger("41"); private static final Long DUMMY_FLOW_COUNT = 51L; @@ -77,7 +86,12 @@ public class SinglePurposeMultipartReplyTranslatorTest { private static final Long DUMMY_REF_COUNT = 1234L; private static final GroupTypes DUMMY_GROUPS_TYPE = GroupTypes.GroupAll; private static final GroupType DUMMY_GROUP_TYPE = GroupType.OFPGTALL; - private static final Long GROUP_ACTION_BITMAP = 0b00000000000000000000000000000000000001111111111111001100000000001L; + + @Before + public void setUp() { + final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager(); + singlePurposeMultipartReplyTranslator = new SinglePurposeMultipartReplyTranslator(convertorManager); + } @Test public void testTranslateFlow() { @@ -193,15 +207,6 @@ public class SinglePurposeMultipartReplyTranslatorTest { assertEquals(DUMMY_GROUPS_TYPE,groupDescStat.getGroupType() ); } - @Test - public void getGroupActionsSupportBitmap() { - ActionType actionSupported = new ActionType(true,true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); - final List groupActionsSupportBitmap = SinglePurposeMultipartReplyTranslator.getGroupActionsSupportBitmap(Lists.newArrayList(actionSupported)); - assertEquals(1, groupActionsSupportBitmap.size()); - final Long bitmap = groupActionsSupportBitmap.get(0); - assertEquals(GROUP_ACTION_BITMAP, bitmap); - } - private MultipartReplyBody prepareMultipartReplyGroupDesc() { MultipartReplyGroupDescCaseBuilder multipartReplyGroupDescCaseBuilder = new MultipartReplyGroupDescCaseBuilder(); MultipartReplyGroupDescBuilder multipartReplyGroupDescBuilder = new MultipartReplyGroupDescBuilder();