com.h3c.of.common

## Class AbstractMsgAssertor

- java.lang.Object
- - com.h3c.of.common.AbstractMsgAssertor

-     public abstract class AbstractMsgAssertor
      extends Object

  A simple abstract base class for making assertions about an openflow message.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractMsgAssertor(String friendlyname, DataPathId dpid, ProgrammableSink sink)` Constructs a message assertor.

  - ### Method Summary

    Methods
    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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractMsgAssertor

          public AbstractMsgAssertor(String friendlyname,
                             DataPathId dpid,
                             ProgrammableSink sink)

      Constructs a message assertor.
      Parameters:
        `friendlyname` - friendly name for display purposes
        `dpid` - the datapath id with which this message assertor is associated
        `sink` - the parent programmable sink

  - ### Method Detail

    - #### getName

          public String getName()

      Returns the friendly name.
      Returns:
        the friendly name

    - #### assertEquals

          protected void assertEquals(String msg,
                          Object exp,
                          Object act)

      Records an assertion error if the expected object is not equivalent to the actual object. This assertion succeeds if `exp.equals(act)` returns true.
      Parameters:
        `msg` - the assertion failure message
        `exp` - the expected object
        `act` - the actual object

    - #### assertNull

          protected void assertNull(String msg,
                        Object o)

      Records an assertion error if the specified object reference is not null.
      Parameters:
        `msg` - the assertion failure message
        `o` - the object reference

    - #### assertNotNull

          protected void assertNotNull(String msg,
                           Object o)

      Records an assertion error if the specified object reference is null.
      Parameters:
        `msg` - the assertion failure message
        `o` - the object reference

    - #### assertTrue

          protected void assertTrue(String msg,
                        boolean condition)

      Throws an assertion error if the specified condition is not true.
      Parameters:
        `msg` - the assertion failure message
        `condition` - the condition

    - #### assertFalse

          protected void assertFalse(String msg,
                         boolean condition)

      Throws an assertion error if the specified condition is not false.
      Parameters:
        `msg` - the assertion failure message
        `condition` - the condition

    - #### runAssertions

          protected abstract void runAssertions(OpenflowMessage msg)

      Concrete subclasses run assertions against a message.
      Parameters:
        `msg` - the message to assert stuff about

Copyright © 2014. All Rights Reserved.