use of org.onosproject.net.optical.OmsPort in project onos by opennetworkinglab.
the class DefaultOmsPortTest method testEquality.
@Test
public void testEquality() {
PortNumber pn = PortNumber.portNumber(4900);
Annotations an = DefaultAnnotations.builder().set("Base", "value").build();
Annotations an2 = DefaultAnnotations.builder().set("Base", "value2").build();
Port base = new DefaultPort(DEV, pn, true, Port.Type.VIRTUAL, 2, an);
Frequency minF = Frequency.ofGHz(3);
Frequency maxF = Frequency.ofGHz(33);
Frequency grid = Frequency.ofGHz(2);
// reference OMS port
OmsPort oms = new DefaultOmsPort(base, minF, maxF, grid);
new EqualsTester().addEqualityGroup(oms, // different base port type or portspeed is ignored
new DefaultOmsPort(new DefaultPort(DEV, pn, true, an), minF, maxF, grid)).addEqualityGroup(new DefaultOmsPort(new DefaultPort(DEV, portNumber(1), true, an), minF, maxF, grid)).addEqualityGroup(new DefaultOmsPort(new DefaultPort(DEV, pn, false, an), minF, maxF, grid)).addEqualityGroup(new DefaultOmsPort(new DefaultPort(DEV, pn, true, an2), minF, maxF, grid)).addEqualityGroup(new DefaultOmsPort(base, Frequency.ofKHz(3), maxF, grid)).addEqualityGroup(new DefaultOmsPort(base, minF, Frequency.ofKHz(33), grid)).addEqualityGroup(new DefaultOmsPort(base, minF, maxF, Frequency.ofKHz(2))).testEquals();
}
Aggregations