public abstract class AbstractMsgAssertor extends Object
Constructor and Description |
---|
AbstractMsgAssertor(String friendlyname,
DataPathId dpid,
ProgrammableSink sink)
Constructs a message assertor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
assertEquals(String msg,
Object exp,
Object act)
Records an assertion error if the expected object is not equivalent
to the actual object.
|
protected void |
assertFalse(String msg,
boolean condition)
Throws an assertion error if the specified condition is not false.
|
protected void |
assertNotNull(String msg,
Object o)
Records an assertion error if the specified object reference is null.
|
protected void |
assertNull(String msg,
Object o)
Records an assertion error if the specified object
reference is not null.
|
protected void |
assertTrue(String msg,
boolean condition)
Throws an assertion error if the specified condition is not true.
|
String |
getName()
Returns the friendly name.
|
protected abstract void |
runAssertions(OpenflowMessage msg)
Concrete subclasses run assertions against a message.
|
public AbstractMsgAssertor(String friendlyname, DataPathId dpid, ProgrammableSink sink)
friendlyname
- friendly name for display purposesdpid
- the datapath id with which this message assertor is
associatedsink
- the parent programmable sinkpublic String getName()
protected void assertEquals(String msg, Object exp, Object act)
exp.equals(act)
returns true.msg
- the assertion failure messageexp
- the expected objectact
- the actual objectprotected void assertNull(String msg, Object o)
msg
- the assertion failure messageo
- the object referenceprotected void assertNotNull(String msg, Object o)
msg
- the assertion failure messageo
- the object referenceprotected void assertTrue(String msg, boolean condition)
msg
- the assertion failure messagecondition
- the conditionprotected void assertFalse(String msg, boolean condition)
msg
- the assertion failure messagecondition
- the conditionprotected abstract void runAssertions(OpenflowMessage msg)
msg
- the message to assert stuff aboutCopyright © 2015. All Rights Reserved.