Search in sources :

Example 6 with MockCodecContext

use of org.onosproject.codec.impl.MockCodecContext in project trellis-control by opennetworkinglab.

the class RedirectPolicyCodecTest method setUp.

@Before
public void setUp() throws Exception {
    context = new MockCodecContext();
    codec = new RedirectPolicyCodec();
    List<DeviceId> deviceIds = new LinkedList<>();
    deviceIds.add(DeviceId.deviceId("of:0000000000000001"));
    deviceIds.add(DeviceId.deviceId("of:0000000000000002"));
    deviceIds.add(DeviceId.deviceId("of:0000000000000003"));
    redirectPolicy = new RedirectPolicy(Set.copyOf(deviceIds));
}
Also used : RedirectPolicy(org.onosproject.segmentrouting.policy.api.RedirectPolicy) MockCodecContext(org.onosproject.codec.impl.MockCodecContext) DeviceId(org.onosproject.net.DeviceId) LinkedList(java.util.LinkedList) Before(org.junit.Before)

Example 7 with MockCodecContext

use of org.onosproject.codec.impl.MockCodecContext in project trellis-control by opennetworkinglab.

the class TrafficMatchCodecTest method setUp.

@Before
public void setUp() throws Exception {
    context = new MockCodecContext();
    codec = new TrafficMatchCodec();
    trafficSelector = DefaultTrafficSelector.builder().matchIPProtocol((byte) 0x06).matchIPSrc(Ip4Address.valueOf("10.0.0.1").toIpPrefix()).matchIPDst(Ip4Address.valueOf("10.0.0.2").toIpPrefix()).matchTcpSrc(TpPort.tpPort(80)).matchTcpDst(TpPort.tpPort(81)).build();
    policyId = PolicyId.of("DROP");
    TrafficMatchPriority trafficMatchPriority = new TrafficMatchPriority(60000);
    trafficMatch = new TrafficMatch(trafficSelector, policyId, trafficMatchPriority);
}
Also used : TrafficMatch(org.onosproject.segmentrouting.policy.api.TrafficMatch) MockCodecContext(org.onosproject.codec.impl.MockCodecContext) TrafficMatchPriority(org.onosproject.segmentrouting.policy.api.TrafficMatchPriority) Before(org.junit.Before)

Example 8 with MockCodecContext

use of org.onosproject.codec.impl.MockCodecContext in project trellis-control by opennetworkinglab.

the class XconnectCodecTest method setUp.

@Before
public void setUp() throws Exception {
    context = new MockCodecContext();
    codec = new XconnectCodec();
}
Also used : MockCodecContext(org.onosproject.codec.impl.MockCodecContext) Before(org.junit.Before)

Aggregations

MockCodecContext (org.onosproject.codec.impl.MockCodecContext)8 Before (org.junit.Before)6 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 Test (org.junit.Test)2 DefaultVirtualHost (org.onosproject.incubator.net.virtual.DefaultVirtualHost)2 VirtualHost (org.onosproject.incubator.net.virtual.VirtualHost)2 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 InputStream (java.io.InputStream)1 LinkedList (java.util.LinkedList)1 IpAddress (org.onlab.packet.IpAddress)1 MacAddress (org.onlab.packet.MacAddress)1 VlanId (org.onlab.packet.VlanId)1 NetworkId (org.onosproject.incubator.net.virtual.NetworkId)1 DeviceId (org.onosproject.net.DeviceId)1 HostId (org.onosproject.net.HostId)1 HostLocation (org.onosproject.net.HostLocation)1 DropPolicy (org.onosproject.segmentrouting.policy.api.DropPolicy)1 RedirectPolicy (org.onosproject.segmentrouting.policy.api.RedirectPolicy)1 TrafficMatch (org.onosproject.segmentrouting.policy.api.TrafficMatch)1 TrafficMatchPriority (org.onosproject.segmentrouting.policy.api.TrafficMatchPriority)1