use of org.onosproject.net.flow.criteria.Criterion in project onos by opennetworkinglab.
the class CriterionCodecTest method matchTcpSrcMaskedTest.
/**
* Tests source TCP port masked criterion.
*/
@Test
public void matchTcpSrcMaskedTest() {
Criterion criterion = Criteria.matchTcpSrcMasked(tpPort, tpPortMask);
ObjectNode result = criterionCodec.encode(criterion, context);
assertThat(result, matchesCriterion(criterion));
}
use of org.onosproject.net.flow.criteria.Criterion in project onos by opennetworkinglab.
the class CriterionCodecTest method getCriterion.
/**
* Reads in a criterion from the given resource and decodes it.
*
* @param resourceName resource to use to read the JSON for the rule
* @return decoded criterion
* @throws IOException if processing the resource fails
*/
private Criterion getCriterion(String resourceName) throws IOException {
InputStream jsonStream = CriterionCodecTest.class.getResourceAsStream(resourceName);
JsonNode json = context.mapper().readTree(jsonStream);
MatcherAssert.assertThat(json, notNullValue());
Criterion criterion = criterionCodec.decode((ObjectNode) json, context);
Assert.assertThat(criterion, notNullValue());
return criterion;
}
use of org.onosproject.net.flow.criteria.Criterion in project onos by opennetworkinglab.
the class CriterionCodecTest method matchUdpDstMaskedTest.
/**
* Tests destination UDP port masked criterion.
*/
@Test
public void matchUdpDstMaskedTest() {
Criterion criterion = Criteria.matchUdpDstMasked(tpPort, tpPortMask);
ObjectNode result = criterionCodec.encode(criterion, context);
assertThat(result, matchesCriterion(criterion));
}
use of org.onosproject.net.flow.criteria.Criterion in project onos by opennetworkinglab.
the class CriterionCodecTest method matchInPortTest.
/**
* Tests in port criterion.
*/
@Test
public void matchInPortTest() {
Criterion criterion = Criteria.matchInPort(port);
ObjectNode result = criterionCodec.encode(criterion, context);
assertThat(result, matchesCriterion(criterion));
}
use of org.onosproject.net.flow.criteria.Criterion in project onos by opennetworkinglab.
the class CriterionCodecTest method matchIPv6NDSourceLinkLayerAddressTest.
/**
* Tests IPV6 SLL criterion.
*/
@Test
public void matchIPv6NDSourceLinkLayerAddressTest() {
Criterion criterion = Criteria.matchIPv6NDSourceLinkLayerAddress(mac1);
ObjectNode result = criterionCodec.encode(criterion, context);
assertThat(result, matchesCriterion(criterion));
}
Aggregations