Removed unnecessary "throws" statements from types unit tests, that caused troubles in loxi import process into floodlight.
diff --git a/java_gen/pre-written/src/test/java/org/openflow/types/IPv4Test.java b/java_gen/pre-written/src/test/java/org/openflow/types/IPv4Test.java
index a5ac1be..8125b04 100644
--- a/java_gen/pre-written/src/test/java/org/openflow/types/IPv4Test.java
+++ b/java_gen/pre-written/src/test/java/org/openflow/types/IPv4Test.java
@@ -7,7 +7,6 @@
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
import org.openflow.exceptions.OFParseError;
-import org.openflow.exceptions.OFShortRead;
public class IPv4Test {
byte[][] testAddresses = new byte[][] {
@@ -42,21 +41,21 @@
"1.x.3.4",
"1.2x.3.4"
};
-
+
String[] ipsWithMask = {
"1.2.3.4/24",
"192.168.130.140/255.255.192.0",
"127.0.0.1/8",
"8.8.8.8",
};
-
+
boolean[] hasMask = {
true,
true,
true,
false
};
-
+
byte[][][] ipsWithMaskValues = {
new byte[][] { new byte[] { (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04 }, new byte[] { (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00 } },
new byte[][] { new byte[] { (byte)0xC0, (byte)0xA8, (byte)0x82, (byte)0x8C }, new byte[] { (byte)0xFF, (byte)0xFF, (byte)0xC0, (byte)0x00 } },
@@ -86,7 +85,7 @@
}
@Test
- public void testReadFrom() throws OFParseError, OFShortRead {
+ public void testReadFrom() throws OFParseError {
for(int i=0; i < testAddresses.length; i++ ) {
IPv4 ip = IPv4.read4Bytes(ChannelBuffers.copiedBuffer(testAddresses[i]));
assertEquals(testInts[i], ip.getInt());
@@ -97,7 +96,7 @@
@Test
- public void testInvalidIPs() throws OFParseError, OFShortRead {
+ public void testInvalidIPs() throws OFParseError {
for(String invalid : invalidIPs) {
try {
IPv4.of(invalid);
@@ -107,9 +106,9 @@
}
}
}
-
+
@Test
- public void testOfMasked() throws OFParseError, OFShortRead {
+ public void testOfMasked() throws OFParseError {
for (int i = 0; i < ipsWithMask.length; i++) {
IPv4WithMask value = IPv4WithMask.of(ipsWithMask[i]);
if (!hasMask[i]) {
@@ -122,7 +121,7 @@
for (int j = 0; j < ipBytes.length; j++) {
ipBytes[j] &= ipsWithMaskValues[i][1][j];
}
-
+
assertArrayEquals(ipBytes, value.getValue().getBytes());
assertArrayEquals(ipsWithMaskValues[i][1], value.getMask().getBytes());
}
diff --git a/java_gen/pre-written/src/test/java/org/openflow/types/IPv6Test.java b/java_gen/pre-written/src/test/java/org/openflow/types/IPv6Test.java
index 71ab28e..352b8bc 100644
--- a/java_gen/pre-written/src/test/java/org/openflow/types/IPv6Test.java
+++ b/java_gen/pre-written/src/test/java/org/openflow/types/IPv6Test.java
@@ -11,7 +11,6 @@
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
import org.openflow.exceptions.OFParseError;
-import org.openflow.exceptions.OFShortRead;
public class IPv6Test {
@@ -21,33 +20,33 @@
"ffe0::",
"1:2:3:4:5:6:7:8"
};
-
+
String[] ipsWithMask = {
"1::1/80",
"1:2:3:4::/ffff:ffff:ffff:ff00::",
"ffff:ffee:1::/ff00:ff00:ff00:ff00::",
"8:8:8:8:8:8:8:8",
};
-
+
byte[][] masks = {
- new byte[] { (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
- (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
- (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00,
+ new byte[] { (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 },
- new byte[] { (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
- (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00,
- (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ new byte[] { (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff,
+ (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 },
- new byte[] { (byte)0xff, (byte)0x00, (byte)0xff, (byte)0x00,
- (byte)0xff, (byte)0x00, (byte)0xff, (byte)0x00,
- (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ new byte[] { (byte)0xff, (byte)0x00, (byte)0xff, (byte)0x00,
+ (byte)0xff, (byte)0x00, (byte)0xff, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 },
- new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
- (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
- (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 }
};
-
+
boolean[] hasMask = {
true,
true,
@@ -70,11 +69,11 @@
byte[] address = inetAddress.getAddress();
assertEquals(address.length, value.getValue().getBytes().length);
-
+
for (int j = 0; j < address.length; j++) {
address[j] &= masks[i][j];
}
-
+
assertArrayEquals(value.getValue().getBytes(), address);
assertArrayEquals(masks[i], value.getMask().getBytes());
}
@@ -104,7 +103,7 @@
}
@Test
- public void testReadFrom() throws OFParseError, OFShortRead, UnknownHostException {
+ public void testReadFrom() throws OFParseError, UnknownHostException {
for(int i=0; i < testStrings.length; i++ ) {
byte[] bytes = Inet6Address.getByName(testStrings[i]).getAddress();
IPv6 ip = IPv6.read16Bytes(ChannelBuffers.copiedBuffer(bytes));
@@ -126,7 +125,7 @@
};
@Test
- public void testInvalidIPs() throws OFParseError, OFShortRead {
+ public void testInvalidIPs() throws OFParseError {
for(String invalid : invalidIPs) {
try {
IPv6.of(invalid);
@@ -138,7 +137,7 @@
}
@Test
- public void testZeroCompression() throws OFParseError, OFShortRead {
+ public void testZeroCompression() throws OFParseError {
assertEquals("::", IPv6.of("::").toString(true, false));
assertEquals("0:0:0:0:0:0:0:0", IPv6.of("::").toString(false, false));
assertEquals("0000:0000:0000:0000:0000:0000:0000:0000", IPv6.of("::").toString(false, true));
diff --git a/java_gen/pre-written/src/test/java/org/openflow/types/MacAddressTest.java b/java_gen/pre-written/src/test/java/org/openflow/types/MacAddressTest.java
index 78728e1..2be3046 100644
--- a/java_gen/pre-written/src/test/java/org/openflow/types/MacAddressTest.java
+++ b/java_gen/pre-written/src/test/java/org/openflow/types/MacAddressTest.java
@@ -9,7 +9,6 @@
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
import org.openflow.exceptions.OFParseError;
-import org.openflow.exceptions.OFShortRead;
public class MacAddressTest {
byte[][] testAddresses = new byte[][] {
@@ -62,7 +61,7 @@
}
@Test
- public void testReadFrom() throws OFParseError, OFShortRead {
+ public void testReadFrom() throws OFParseError {
for(int i=0; i < testAddresses.length; i++ ) {
MacAddress ip = MacAddress.read6Bytes(ChannelBuffers.copiedBuffer(testAddresses[i]));
assertEquals(testInts[i], ip.getLong());
@@ -73,7 +72,7 @@
@Test
- public void testInvalidMacss() throws OFParseError, OFShortRead {
+ public void testInvalidMacss() throws OFParseError {
for(String invalid : invalidMacs) {
try {
MacAddress.of(invalid);