Add JUnit testing for NodeConfiguration class. 08/18108/1
authorAlexis de Talhouët <adetalhouet@inocybe.com>
Fri, 10 Apr 2015 13:10:22 +0000 (09:10 -0400)
committerAlexis de Talhouët <adetalhouet@inocybe.com>
Fri, 10 Apr 2015 13:10:22 +0000 (09:10 -0400)
Change-Id: Iddf2dcfb3c6c24acf473a16ab055751182f66c00
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
openstack/net-virt/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/NodeConfigurationTest.java [new file with mode: 0644]

diff --git a/openstack/net-virt/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/NodeConfigurationTest.java b/openstack/net-virt/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/NodeConfigurationTest.java
new file mode 100644 (file)
index 0000000..3446328
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2015 Inocybe and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.ovsdb.openstack.netvirt;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Test;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
+
+/**
+ * Unit test for {@link NodeConfiguration}
+ */
+public class NodeConfigurationTest {
+
+    @Test
+    public void testNodeConfiguration() {
+        NodeConfiguration nodeConf = new NodeConfiguration();
+
+        assertEquals("Error, did not populate the internal vlan queue correctly", Constants.MAX_VLAN - 1, nodeConf.getInternalVlans().size());
+        assertNotNull("Error, tenant vlan map has not been initialized", nodeConf.getTenantVlanMap());
+    }
+}