psdi.unittest

Class UnitTestContext

  • java.lang.Object
    • psdi.unittest.UnitTestContext


  • public class UnitTestContext
    extends java.lang.Object
    Represents the context associated with the test case execution thread.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static UnitTestContext createCurrentContext()
      Creates context if its not there and returns it
      static void destroyCurrentContext()
      Destroys the context => releases all resources held in the context
      boolean getBooleanProperty(java.lang.String propName) 
      static UnitTestContext getCurrentContext()
      Returns Integration Context
      java.util.Date getDateProperty(java.lang.String propName)
      Return proprty value for specified property as Date
      java.lang.Double getDoubleProperty(java.lang.String propName)
      Return proprty value for specified property as Double
      java.lang.Integer getIntegerProperty(java.lang.String propName)
      Return proprty value for specified property as Integer
      java.lang.Long getLongProperty(java.lang.String propName)
      Return proprty value for specified property as Long
      java.util.Map getProperties()
      returns Map of all context properties.
      java.lang.Object getProperty(java.lang.String propName)
      Return property value for specified property
      java.lang.String getStringProperty(java.lang.String propName)
      Return proprty value for specified property as string
      void removeProperty(java.lang.String propName)
      Removes property propName.
      void setDoubleProperty(java.lang.String propName, double val)
      Sets property with double value
      void setIntegerProperty(java.lang.String propName, int val)
      Sets property with integer value
      void setProperties(java.util.Map data)
      Sets properties from the list
      void setProperty(java.lang.String propName, java.lang.Object value)
      Sets property with any value
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getProperties

        public java.util.Map getProperties()
        returns Map of all context properties.
        Returns:
        Map of all context properties.
      • getProperty

        public java.lang.Object getProperty(java.lang.String propName)
        Return property value for specified property
        Parameters:
        propName - property name
        Returns:
        property value
      • getStringProperty

        public java.lang.String getStringProperty(java.lang.String propName)
        Return proprty value for specified property as string
        Parameters:
        propName - property name
        Returns:
        property value as string
      • getIntegerProperty

        public java.lang.Integer getIntegerProperty(java.lang.String propName)
        Return proprty value for specified property as Integer
        Parameters:
        propName - property name
        Returns:
        property value as Integer
      • getLongProperty

        public java.lang.Long getLongProperty(java.lang.String propName)
        Return proprty value for specified property as Long
        Parameters:
        propName - property name
        Returns:
        property value as Long
      • setIntegerProperty

        public void setIntegerProperty(java.lang.String propName,
                                       int val)
        Sets property with integer value
        Parameters:
        propName - property name
        val - property value
      • setDoubleProperty

        public void setDoubleProperty(java.lang.String propName,
                                      double val)
        Sets property with double value
        Parameters:
        propName - property name
        val - property value
      • getDoubleProperty

        public java.lang.Double getDoubleProperty(java.lang.String propName)
        Return proprty value for specified property as Double
        Parameters:
        propName - property name
        Returns:
        property value as Double
      • getDateProperty

        public java.util.Date getDateProperty(java.lang.String propName)
        Return proprty value for specified property as Date
        Parameters:
        propName - property name
        Returns:
        property value as Date
      • getBooleanProperty

        public boolean getBooleanProperty(java.lang.String propName)
      • setProperty

        public void setProperty(java.lang.String propName,
                                java.lang.Object value)
        Sets property with any value
        Parameters:
        propName - property name
        val - property value
      • removeProperty

        public void removeProperty(java.lang.String propName)
        Removes property propName.
        Parameters:
        propName - name of the property.
      • setProperties

        public void setProperties(java.util.Map data)
        Sets properties from the list
        Parameters:
        data - set of properties for the context.
      • getCurrentContext

        public static UnitTestContext getCurrentContext()
        Returns Integration Context
        Returns:
        the current IntegrationContext for this thread
      • createCurrentContext

        public static UnitTestContext createCurrentContext()
        Creates context if its not there and returns it
        Returns:
        the current context for this thread
      • destroyCurrentContext

        public static void destroyCurrentContext()
        Destroys the context => releases all resources held in the context