16 package org.openkilda.floodlight.switchmanager;
18 import static org.junit.Assert.assertEquals;
22 import org.junit.Test;
24 import java.util.HashSet;
31 private static final String FLOW_1_ID =
"first-flow";
32 private static final String FLOW_2_ID =
"second-flow";
33 private static final String FLOW_3_ID =
"third-flow";
39 Set<Integer> expected =
new HashSet<>();
41 int m1 = meterPool.
allocate(SWITCH_1_ID, FLOW_1_ID);
42 int m2 = meterPool.
allocate(SWITCH_2_ID, FLOW_1_ID);
49 int m3 = meterPool.
allocate(SWITCH_1_ID, FLOW_2_ID);
50 int m4 = meterPool.
allocate(SWITCH_2_ID, FLOW_2_ID);
69 int m5 = meterPool.
allocate(SWITCH_1_ID, FLOW_3_ID);
70 int m6 = meterPool.
allocate(SWITCH_3_ID, FLOW_3_ID);
82 assertEquals(m1 + 2, m5);
synchronized Set< Integer > getMetersBySwitch(final SwitchId switchId)
synchronized Integer deallocate(final SwitchId switchId, final String flowId)
synchronized Integer allocate(final SwitchId switchId, final String flowId, Integer meterId)
synchronized Set< Integer > getMetersByFlow(final String flowId)