java.lang.Object
test.de.iip_ecosphere.platform.transport.spring.TestCounters

class TestCounters extends Object
A test helper class to count statistics for a serializer. The StringSerializer used in testing will record its activities here. Please consider resetting the counters before/after a test.
Author:
Holger Eichelberger, SSE
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static int
     
    private static int
     
    private static int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static int
    Returns the copy-counter value.
    (package private) static int
    Returns the from-counter value.
    (package private) static int
    Returns the to-counter value.
    (package private) static void
    Increases the clone-counter (related to the clone-method of the serializers.
    (package private) static void
    Increases the from-counter (related to the from-method of the serializers.
    (package private) static void
    Increases the to-counter (related to the to-method of the serializers.
    (package private) static void
    Resets all counters.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • toCount

      private static int toCount
    • fromCount

      private static int fromCount
    • cloneCount

      private static int cloneCount
  • Constructor Details

    • TestCounters

      TestCounters()
  • Method Details

    • reset

      static void reset()
      Resets all counters.
    • increaseTo

      static void increaseTo()
      Increases the to-counter (related to the to-method of the serializers.
    • increaseFrom

      static void increaseFrom()
      Increases the from-counter (related to the from-method of the serializers.
    • increaseClone

      static void increaseClone()
      Increases the clone-counter (related to the clone-method of the serializers.
    • getToCount

      static int getToCount()
      Returns the to-counter value.
      Returns:
      the number of calls to OutputTypeTranslator.to(Object)
    • getFromCount

      static int getFromCount()
      Returns the from-counter value.
      Returns:
      the number of calls to InputTypeTranslator.from(Object)
    • getCloneCount

      static int getCloneCount()
      Returns the copy-counter value.
      Returns:
      the number of calls to Serializer.clone(Object)