8f11077e008a26ab0755957dc149b3918a43b64a
[hc2vpp.git] /
1 /*
2  * Copyright (c) 2018 Cisco and/or its affiliates.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package io.fd.hc2vpp.it.jvpp.benchmark.classify;
18
19 import static org.junit.Assert.*;
20
21 import io.fd.vpp.jvpp.acl.dto.AclAddReplace;
22 import io.fd.vpp.jvpp.core.dto.ClassifyAddDelTable;
23 import org.junit.Test;
24
25 public class ClassifyTableProviderImplTest {
26     @Test
27     public void testTablesDiffer() throws Exception {
28         final ClassifyTableProviderImpl provider = new ClassifyTableProviderImpl(2);
29         final ClassifyAddDelTable table0 = provider.next();
30         final ClassifyAddDelTable table1 = provider.next();
31         final ClassifyAddDelTable table2 = provider.next();
32         final ClassifyAddDelTable table3 = provider.next();
33
34         // Test if ACLs are provided in round-robin fashion
35         assertEquals("Tables 0 and 2 should be equal", table0, table2);
36         assertEquals("Tables 1 and 3 should be equal", table1, table3);
37         assertNotEquals("Tables 0 and 1 should be different", table0, table1);
38     }
39 }