X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=third-party%2Fopenflow-codec%2Fsrc%2Ftest%2Fjava%2Forg%2Fopenflow%2Fcodec%2Fprotocol%2Finstruction%2FOFPInstructionExperimenterTest.java;fp=third-party%2Fopenflow-codec%2Fsrc%2Ftest%2Fjava%2Forg%2Fopenflow%2Fcodec%2Fprotocol%2Finstruction%2FOFPInstructionExperimenterTest.java;h=0000000000000000000000000000000000000000;hb=64fe0fbca1a6c2b77ad25f568d73a7eb64236d16;hp=759cb0e7cea57d4bc93f983ada33ebce40864a8d;hpb=8b9a3ff2bbc83941254b46b818cbbae5cc1a3a5b;p=openflowjava.git diff --git a/third-party/openflow-codec/src/test/java/org/openflow/codec/protocol/instruction/OFPInstructionExperimenterTest.java b/third-party/openflow-codec/src/test/java/org/openflow/codec/protocol/instruction/OFPInstructionExperimenterTest.java deleted file mode 100644 index 759cb0e7..00000000 --- a/third-party/openflow-codec/src/test/java/org/openflow/codec/protocol/instruction/OFPInstructionExperimenterTest.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.openflow.codec.protocol.instruction; - -import junit.framework.TestCase; - -import org.openflow.codec.io.DataBuffers; -import org.openflow.codec.io.IDataBuffer; -import org.openflow.codec.protocol.instruction.OFPInstructionExperimenter; -import org.openflow.codec.protocol.instruction.OFPInstructionType; - -/** - * test class to verify instruction structure - * - * @author AnilGujele - * - */ -public class OFPInstructionExperimenterTest extends TestCase { - - private IDataBuffer buffer = DataBuffers.allocate(1024); - - protected void tearDown() throws Exception { - buffer.clear(); - } - - public void testOFInstructionExperimenterCreation() { - OFPInstructionExperimenter instruction = new OFPInstructionExperimenter(); - assertTrue(instruction.type.equals(OFPInstructionType.EXPERIMENTER)); - - } - - public void testClone() throws CloneNotSupportedException { - OFPInstructionExperimenter instruction = new OFPInstructionExperimenter(); - instruction.setExperimenterId((byte) 2); - OFPInstructionExperimenter instructionCloned = (OFPInstructionExperimenter) instruction.clone(); - TestCase.assertEquals(instruction, instructionCloned); - - instruction.setExperimenterId((byte) 1); - TestCase.assertNotSame(instruction, instructionCloned); - - instruction = (OFPInstructionExperimenter) instructionCloned.clone(); - TestCase.assertEquals(instruction, instructionCloned); - } - - public void testReadWriteSuccess() { - OFPInstructionExperimenter instruction = new OFPInstructionExperimenter(); - instruction.setExperimenterId((byte) 2); - instruction.writeTo(buffer); - buffer.flip(); - - OFPInstructionExperimenter instructionTemp = new OFPInstructionExperimenter(); - instructionTemp.readFrom(buffer); - TestCase.assertEquals(instruction, instructionTemp); - - } - - public void testToString() { - OFPInstructionExperimenter instruction = new OFPInstructionExperimenter(); - instruction.setExperimenterId((byte) 2); - instruction.writeTo(buffer); - buffer.flip(); - - OFPInstructionExperimenter instructionTemp = new OFPInstructionExperimenter(); - instructionTemp.readFrom(buffer); - TestCase.assertEquals(instruction.toString(), instructionTemp.toString()); - } - - public void testEqualHashcode() { - - OFPInstructionExperimenter instruction = new OFPInstructionExperimenter(); - instruction.setExperimenterId((byte) 2); - instruction.writeTo(buffer); - buffer.flip(); - - OFPInstructionExperimenter instructionTemp = new OFPInstructionExperimenter(); - instructionTemp.readFrom(buffer); - - TestCase.assertTrue(instruction.equals(instructionTemp)); - TestCase.assertEquals(instruction.hashCode(), instructionTemp.hashCode()); - } - -}