Search in sources :

Example 6 with Augmentation

use of org.opendaylight.yangtools.yang.binding.Augmentation in project openflowplugin by opendaylight.

the class ArpSpaConvertorTest method testConvertToOFJava.

@Test
public void testConvertToOFJava() throws Exception {
    final NxmOfArpSpaBuilder nxmOfArpSpaBuilder = new NxmOfArpSpaBuilder().setIpv4Address(IPV4_ADDRESS);
    final NxAugMatchRpcAddFlowBuilder nxAugMatchRpcAddFlowBuilder = new NxAugMatchRpcAddFlowBuilder();
    nxAugMatchRpcAddFlowBuilder.setNxmOfArpSpa(nxmOfArpSpaBuilder.build());
    final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
    when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
    final MatchEntry converted = arpSpaConvertor.convert(extension);
    Assert.assertEquals(IpConverter.ipv4AddressToLong(IPV4_ADDRESS), ((ArpSpaCaseValue) converted.getMatchEntryValue()).getArpSpaValues().getValue().longValue());
}
Also used : Extension(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension) Augmentation(org.opendaylight.yangtools.yang.binding.Augmentation) NxmOfArpSpaBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.of.arp.spa.grouping.NxmOfArpSpaBuilder) MatchEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry) NxAugMatchRpcAddFlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchRpcAddFlowBuilder) Test(org.junit.Test)

Example 7 with Augmentation

use of org.opendaylight.yangtools.yang.binding.Augmentation in project openflowplugin by opendaylight.

the class Nshc1ConvertorTest method setUp.

@Before
public void setUp() throws Exception {
    final NxmNxNshc1Builder nxmNxNshc1Builder = new NxmNxNshc1Builder().setValue(1L);
    final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
    nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxNshc1(nxmNxNshc1Builder.build());
    final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
    when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
    nshc1Convertor = new Nshc1Convertor();
}
Also used : Extension(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension) Augmentation(org.opendaylight.yangtools.yang.binding.Augmentation) NxAugMatchNodesNodeTableFlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlowBuilder) NxmNxNshc1Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.nshc._1.grouping.NxmNxNshc1Builder) Before(org.junit.Before)

Example 8 with Augmentation

use of org.opendaylight.yangtools.yang.binding.Augmentation in project openflowplugin by opendaylight.

the class Nshc3ConvertorTest method setUp.

@Before
public void setUp() throws Exception {
    final NxmNxNshc3Builder nxmNxNshc3Builder = new NxmNxNshc3Builder().setValue(1L);
    final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
    nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxNshc3(nxmNxNshc3Builder.build());
    final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
    when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
    nshc3Convertor = new Nshc3Convertor();
}
Also used : Extension(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension) Augmentation(org.opendaylight.yangtools.yang.binding.Augmentation) NxAugMatchNodesNodeTableFlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlowBuilder) NxmNxNshc3Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.nshc._3.grouping.NxmNxNshc3Builder) Before(org.junit.Before)

Example 9 with Augmentation

use of org.opendaylight.yangtools.yang.binding.Augmentation in project openflowplugin by opendaylight.

the class TcpDstConvertorTest method setUp.

@Before
public void setUp() throws Exception {
    final NxmOfTcpDstBuilder nxmOfTcpDstBuilder = new NxmOfTcpDstBuilder().setMask(1).setPort(DEFAULT_PORT);
    final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
    nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfTcpDst(nxmOfTcpDstBuilder.build());
    final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
    when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
    tcpDstConvertor = new TcpDstConvertor();
}
Also used : Extension(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension) Augmentation(org.opendaylight.yangtools.yang.binding.Augmentation) NxAugMatchNodesNodeTableFlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlowBuilder) NxmOfTcpDstBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.of.tcp.dst.grouping.NxmOfTcpDstBuilder) Before(org.junit.Before)

Example 10 with Augmentation

use of org.opendaylight.yangtools.yang.binding.Augmentation in project openflowplugin by opendaylight.

the class TunIdConvertorTest method setUp.

@Before
public void setUp() throws Exception {
    final NxmNxTunIdBuilder nxmNxTunIdBuilder = new NxmNxTunIdBuilder().setValue(BigInteger.ONE);
    final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
    nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxTunId(nxmNxTunIdBuilder.build());
    final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
    when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
    tunIdConvertor = new TunIdConvertor();
}
Also used : NxmNxTunIdBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.tun.id.grouping.NxmNxTunIdBuilder) Extension(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension) Augmentation(org.opendaylight.yangtools.yang.binding.Augmentation) NxAugMatchNodesNodeTableFlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlowBuilder) Before(org.junit.Before)

Aggregations

Augmentation (org.opendaylight.yangtools.yang.binding.Augmentation)27 Extension (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension)23 Before (org.junit.Before)21 NxAugMatchNodesNodeTableFlowBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlowBuilder)18 NxAugMatchRpcAddFlowBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchRpcAddFlowBuilder)5 HashMap (java.util.HashMap)4 Map (java.util.Map)4 Test (org.junit.Test)2 RouteEntryBaseAttributes (org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.RouteEntryBaseAttributes)2 ActionsAugPolicy (org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.policy.action.ActionsAugPolicy)2 BgpActionAugPolicy (org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.policy.action.BgpActionAugPolicy)2 BgpConditionsAugmentationPolicy (org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.policy.condition.BgpConditionsAugmentationPolicy)2 Actions1 (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.Actions1)2 Conditions1 (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.Conditions1)2 BgpActions (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.BgpActions)2 SetAsPathPrepend (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.SetAsPathPrepend)2 SetCommunity (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.SetCommunity)2 SetExtCommunity (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.SetExtCommunity)2 BgpConditions (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.conditions.BgpConditions)2 RejectRoute (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.generic.actions.route.disposition.RejectRoute)2