Package org.jmock

Class Mockery.MockObject

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Class<?> mockedType  
      private java.lang.String name  
    • Constructor Summary

      Constructors 
      Constructor Description
      MockObject​(java.lang.Class<?> mockedType, java.lang.String name)  
    • Field Detail

      • mockedType

        private java.lang.Class<?> mockedType
      • name

        private java.lang.String name
    • Constructor Detail

      • MockObject

        public MockObject​(java.lang.Class<?> mockedType,
                          java.lang.String name)
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • invoke

        public java.lang.Object invoke​(Invocation invocation)
                                throws java.lang.Throwable
        Description copied from interface: Invokable
        Performs an action in response to an invocation.
        Specified by:
        invoke in interface Invokable
        Parameters:
        invocation - The invocation to perform.
        Returns:
        The result of the invocation, if not throwing an exception. Must return null if the invoked method has a void return type.
        Throws:
        java.lang.Throwable - An exception to be thrown to the caller, if not returning a value. Any checked exception thrown must be in the throws list of the invoked method.