Skip to content
Snippets Groups Projects
Commit 9aaeffae authored by Shudong Zhou's avatar Shudong Zhou
Browse files

Unit test fixes

parent 15982261
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,7 @@ public class ICMPTest {
}
@Test
public void testDeserialize() throws PacketParsingException {
public void testDeserialize() throws Exception {
IPacket packet = new IPv4();
packet.deserialize(pktSerialized, 0, pktSerialized.length);
byte[] pktSerialized1 = packet.serialize();
......
......@@ -85,7 +85,7 @@ public class IPv4Test {
};
@Test
public void testDeserialize() throws PacketParsingException {
public void testDeserialize() throws Exception {
IPv4 packet = new IPv4();
packet.deserialize(pktSerialized, 0, pktSerialized.length);
byte[] pktSerialized1 = packet.serialize();
......@@ -93,7 +93,7 @@ public class IPv4Test {
}
@Test
public void testDeserializePadded() throws PacketParsingException {
public void testDeserializePadded() throws Exception {
// A real TLSv1 packet with crap added to the end
byte[] pktSerializedPadded = new byte[] { 0x45, 0x00,
0x00, 0x2e, 0x41, (byte) 0xbe, 0x40, 0x00, 0x40, 0x06,
......@@ -112,7 +112,7 @@ public class IPv4Test {
}
@Test
public void testDeserializeFragment() throws PacketParsingException {
public void testDeserializeFragment() throws Exception {
// IP packet with more frag bit set
byte[] pktSerializedFirstFrag = new byte[] { 0x45, 0x00,
0x00, 0x2e, 0x41, (byte) 0xbe, 0x20, 0x00, 0x40, 0x06,
......@@ -145,7 +145,7 @@ public class IPv4Test {
}
@Test
public void testDeserializeDontFragment() throws PacketParsingException {
public void testDeserializeDontFragment() throws Exception {
// IP packet with more frag bit set
byte[] pktSerializedDontFrag = new byte[] { 0x45, 0x00,
0x00, 0x2e, 0x41, (byte) 0xbe, 0x60, 0x00, 0x40, 0x06,
......
......@@ -100,7 +100,7 @@ public class PacketTest {
this.packets = new IPacket[] { pkt1, pkt2, pkt3, pkt4 };
}
protected void doTestClone(IPacket pkt) throws PacketParsingException {
protected void doTestClone(IPacket pkt) throws Exception {
if (pkt.getPayload() != null)
doTestClone(pkt.getPayload());
IPacket newPkt = (IPacket)pkt.clone();
......@@ -136,7 +136,7 @@ public class PacketTest {
}
@Test
public void testClone() throws PacketParsingException {
public void testClone() throws Exception {
for (IPacket pkt: packets) {
doTestClone(pkt);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment