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.ovsdb.openstack.netvirt.sfc.workaround.services;
11 import static org.junit.Assert.assertEquals;
13 import org.junit.Test;
14 import org.opendaylight.ovsdb.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;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
19 public class AclMatchesTest {
21 public void buildMatchTest() {
22 AclUtils aclUtils = new AclUtils();
23 MatchesBuilder matchesBuilder = aclUtils.matchesBuilder(new MatchesBuilder(), 80);
24 AclMatches aclMatches = new AclMatches(matchesBuilder.build());
25 MatchBuilder matchBuilder = new MatchBuilder();
26 MatchUtils.createIpProtocolMatch(matchBuilder, (short)6);
27 MatchUtils.addLayer4Match(matchBuilder, 6, 0, 80);
28 assertEquals(matchBuilder.build(), aclMatches.buildMatch().build());