import java.util.UUID;
import org.junit.Assert;
import org.junit.Test;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
public class NodeTest {
@Test
public void testNodeOpenFlowOfWrongType() {
try {
+ @SuppressWarnings("unused")
Node of1 = new Node(Node.NodeIDType.OPENFLOW, new String(
"0xDEADBEEFCAFE0001L"));
@Test
public void testNodeONEPKOfWrongType() {
try {
+ @SuppressWarnings("unused")
Node onepk1 = new Node(Node.NodeIDType.ONEPK, new Long(
0xDEADBEEFCAFE0001L));
@Test
public void testNodePCEPOfWrongType() {
try {
+ @SuppressWarnings("unused")
Node pcep1 = new Node(Node.NodeIDType.PCEP, new Long(
0xDEADBEEFCAFE0001L));
public void testExtensibleNode() {
// Add a new ID type
Assert.assertTrue(Node.NodeIDType.registerIDType("FOO", Integer.class));
-
+
// Trying to re-register the node must fail
Assert.assertFalse(Node.NodeIDType.registerIDType("FOO",
Integer.class));
// Got an unexpected exception
Assert.assertTrue(false);
}
-
+
// Now unregister the type and make sure the node doesn't get
// created
Node.NodeIDType.unRegisterIDType("FOO");
try {
+ @SuppressWarnings("unused")
Node n = new Node("FOO", new Integer(0xCAFE));
// If we reach here, something didn't go fine, an