2 * Copyright © 2016 Red Hat, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.netvirt.openstack.netvirt.sfc.workaround.services;
11 import static org.junit.Assert.assertEquals;
13 import org.junit.Test;
14 import org.opendaylight.netvirt.utils.mdsal.openflow.MatchUtils;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.MatchesBuilder;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
18 public class AclMatchesTest {
20 public void buildMatchTest() {
21 AclUtils aclUtils = new AclUtils();
22 MatchesBuilder matchesBuilder = aclUtils.matchesBuilder(new MatchesBuilder(), 80);
23 AclMatches aclMatches = new AclMatches(matchesBuilder.build());
24 MatchBuilder matchBuilder = new MatchBuilder();
25 MatchUtils.createIpProtocolMatch(matchBuilder, (short)6);
26 MatchUtils.addLayer4Match(matchBuilder, 6, 0, 80);
27 assertEquals(matchBuilder.build(), aclMatches.buildMatch().build());