public abstract class ProtocolDataUnitTest extends Object
| Modifier and Type | Field and Description |
|---|---|
protected int |
chunkSize
Size in bytes of an chunk of this object.
|
protected org.jscsi.parser.ProtocolDataUnit |
protocolDataUnit
The used Protocol Data Unit for this test.
|
protected org.jscsi.parser.AbstractMessageParser |
recognizedParser
The used parser for this Protocol Data Unit.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ProtocolDataUnitTest()
Default constructor to create a new, empty ProtocolDataUnitTest object.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
setUp(String fileContent)
This methods should be invoked to read in the byte representation with
the given file content.
|
void |
tearDown()
This method resets the settings of this ProtocolDataUnit object.
|
protected void |
testBasicHeaderSegment(boolean immediateFlag,
boolean finalFlag,
org.jscsi.parser.OperationCode opCode,
int totalAHSLength,
int dataSegmentLength,
int initiatorTaskTag)
Tests the fields, which are common in all parsers.
|
protected void |
testDataSegment(ByteBuffer etherealLog)
Tests the given Ethereal log against the parsed
IDataSegment object contained in
protocolDataUnit. |
protected void |
testDataSegment(org.jscsi.parser.datasegment.IDataSegment expectedDataSegment)
Tests the
IDataSegment instance to the parsed data segment
of the protocolDataUnit instance. |
protected void |
testDataSegment(org.jscsi.parser.datasegment.SettingsMap expectedKeyValuePair)
Tests a given
SettingsMap object against the parsed IDataSegment object
contained in protocolDataUnit . |
protected void |
testDataSegment(String etherealLog)
Tests the given Ethereal log against the parsed
IDataSegment object contained in
protocolDataUnit. |
protected void |
testDeserialize(boolean immediateFlag,
boolean finalFlag,
org.jscsi.parser.OperationCode opCode,
int totalAHSLength,
int dataSegmentLength,
int initiatorTaskTag) |
protected org.jscsi.parser.ProtocolDataUnit protocolDataUnit
protected org.jscsi.parser.AbstractMessageParser recognizedParser
protected int chunkSize
protected ProtocolDataUnitTest()
protected void testDeserialize(boolean immediateFlag,
boolean finalFlag,
org.jscsi.parser.OperationCode opCode,
int totalAHSLength,
int dataSegmentLength,
int initiatorTaskTag)
throws IOException,
org.jscsi.exception.InternetSCSIException
immediateFlag - The expected value of the immediate flag.finalFlag - The expected value of the final flag.opCode - The expected value of the operation code.totalAHSLength - The expected value of the total AHS length.dataSegmentLength - The expected value of the data segment length.initiatorTaskTag - The expected value of the initiator task tag.IOException - This exception should be never thrown.org.jscsi.exception.InternetSCSIException - This exception should be never thrown.protected void testDataSegment(org.jscsi.parser.datasegment.SettingsMap expectedKeyValuePair)
SettingsMap object against the parsed IDataSegment object
contained in protocolDataUnit .expectedKeyValuePair - SettingsMap instance, which contains all
parameters.protected final void testDataSegment(String etherealLog)
IDataSegment object contained in
protocolDataUnit.etherealLog - A String, which contains an Ethereal log.protected final void testDataSegment(ByteBuffer etherealLog)
IDataSegment object contained in
protocolDataUnit.etherealLog - A ByteBuffer, which contains an Ethereal log.protected final void testDataSegment(org.jscsi.parser.datasegment.IDataSegment expectedDataSegment)
IDataSegment instance to the parsed data segment
of the protocolDataUnit instance.expectedDataSegment - Uses this data segment for comparsion.protected void setUp(String fileContent) throws org.jscsi.exception.InternetSCSIException, IOException, DigestException
fileContent - The content of the test case to read from.org.jscsi.exception.InternetSCSIException - This exception should be never thrown.IOException - This exception should be never thrown.DigestException - This exception should be never thrown.public void tearDown()
protected void testBasicHeaderSegment(boolean immediateFlag,
boolean finalFlag,
org.jscsi.parser.OperationCode opCode,
int totalAHSLength,
int dataSegmentLength,
int initiatorTaskTag)
immediateFlag - The expected value of the immediate flag.finalFlag - The expected value of the final flag.opCode - The expected value of the operation code.totalAHSLength - The expected value of the total AHS length.dataSegmentLength - The expected value of the data segment length.initiatorTaskTag - The expected value of the initiator task tag.Copyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.