import java.util.Collections;
import java.util.List;
+import junit.framework.Assert;
+
import org.junit.Test;
import org.opendaylight.controller.sal.action.Flood;
import org.opendaylight.controller.sal.action.FloodAll;
import org.opendaylight.controller.sal.core.ConstructionException;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.Node.NodeIDType;
+import org.opendaylight.controller.sal.core.NodeConnector;
import org.opendaylight.controller.sal.flowprogrammer.Flow;
import org.opendaylight.controller.sal.match.MatchType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
checkSalFlow(salFlow);
}
+ /**
+ * test of {@link ToSalConversionsUtils#fromNodeConnectorRef(Uri, Node)}
+ * @throws ConstructionException
+ */
+ @Test
+ public void testFromNodeConnectorRef() throws ConstructionException {
+ Node node = new Node(NodeIDType.OPENFLOW, 42L);
+ NodeConnector nodeConnector = ToSalConversionsUtils.fromNodeConnectorRef(new Uri("1"), node);
+ Assert.assertEquals("OF|1@OF|00:00:00:00:00:00:00:2a", nodeConnector.toString());
+ }
+
private void checkSalMatch(org.opendaylight.controller.sal.match.Match match, MtchType mt) {
switch (mt) {
case other:
//assertEquals("Wrong value for action SetDlSrc for MAC address.", "24:77:03:7C:C5:F1", new String(
// ((SetDlSrc) action).getDlAddress()));
} else if (action instanceof SetDlType) {
- assertEquals("Wrong value for action SetDlType for.", 513l, ((SetDlType) action).getDlType());
+ assertEquals("Wrong value for action SetDlType for.", 513L, ((SetDlType) action).getDlType());
} else if (action instanceof SetNextHop) {
InetAddress inetAddress = ((SetNextHop) action).getAddress();
checkIpAddresses(inetAddress, "192.168.100.100", "2001:db8:85a3::8a2e:370:7334");
private void prepareActionSetDlType(SetDlTypeActionCaseBuilder wrapper) {
SetDlTypeActionBuilder setDlTypeActionBuilder = new SetDlTypeActionBuilder();
- setDlTypeActionBuilder.setDlType(new EtherType(513l));
+ setDlTypeActionBuilder.setDlType(new EtherType(513L));
wrapper.setSetDlTypeAction(setDlTypeActionBuilder.build());
}
private EthernetType prepEthType() {
EthernetTypeBuilder ethTypeBuild = new EthernetTypeBuilder();
- ethTypeBuild.setType(new EtherType(0xffffl));
+ ethTypeBuild.setType(new EtherType(0xffffL));
return ethTypeBuild.build();
}