Class MockSupport

  • Direct Known Subclasses:
    AfterTestHook

    public class MockSupport
    extends junit.framework.Assert
    Author:
    Kir
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.jmock.core.Constraint ANYTHING  
      static org.jmock.core.Constraint NOT_NULL  
      static org.jmock.core.Constraint NULL  
    • Constructor Summary

      Constructors 
      Constructor Description
      MockSupport()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.jmock.core.constraint.And and​(org.jmock.core.Constraint left, org.jmock.core.Constraint right)  
      org.jmock.core.constraint.IsArrayContaining arrayContaining​(boolean element)  
      org.jmock.core.constraint.IsArrayContaining arrayContaining​(byte element)  
      org.jmock.core.constraint.IsArrayContaining arrayContaining​(char element)  
      org.jmock.core.constraint.IsArrayContaining arrayContaining​(double element)  
      org.jmock.core.constraint.IsArrayContaining arrayContaining​(float element)  
      org.jmock.core.constraint.IsArrayContaining arrayContaining​(int element)  
      org.jmock.core.constraint.IsArrayContaining arrayContaining​(long element)  
      org.jmock.core.constraint.IsArrayContaining arrayContaining​(short element)  
      org.jmock.core.constraint.IsArrayContaining arrayContaining​(Object element)  
      org.jmock.core.constraint.IsArrayContaining arrayContaining​(org.jmock.core.Constraint elementConstraint)  
      void assertThat​(boolean actual, org.jmock.core.Constraint constraint)  
      void assertThat​(byte actual, org.jmock.core.Constraint constraint)  
      void assertThat​(char actual, org.jmock.core.Constraint constraint)  
      void assertThat​(double actual, org.jmock.core.Constraint constraint)  
      void assertThat​(float actual, org.jmock.core.Constraint constraint)  
      void assertThat​(int actual, org.jmock.core.Constraint constraint)  
      void assertThat​(long actual, org.jmock.core.Constraint constraint)  
      void assertThat​(short actual, org.jmock.core.Constraint constraint)  
      void assertThat​(Object actual, org.jmock.core.Constraint constraint)  
      <T> void assertThat​(String reason, T actual, org.hamcrest.Matcher<T> matcher)  
      <T> void assertThat​(T actual, org.hamcrest.Matcher<T> matcher)  
      org.jmock.core.InvocationMatcher atLeastOnce()  
      org.jmock.core.constraint.IsCollectionContaining collectionContaining​(Object element)  
      org.jmock.core.constraint.IsCollectionContaining collectionContaining​(org.jmock.core.Constraint elementConstraint)  
      org.jmock.core.constraint.IsCompatibleType compatibleType​(Class baseType)  
      org.jmock.core.constraint.StringContains contains​(String substring)  
      <T> org.hamcrest.Matcher<Iterable<? extends T>> containsInAnyOrder​(org.hamcrest.Matcher<? super T>... items)  
      <T> org.hamcrest.Matcher<Iterable<? extends T>> containsInAnyOrder​(T... items)  
      <T> org.hamcrest.Matcher<Iterable<? extends T>> containsInOrder​(org.hamcrest.Matcher<? super T>... items)  
      <T> org.hamcrest.Matcher<Iterable<? extends T>> containsInOrder​(T... items)  
      String defaultMockNameForType​(Class mockedType)  
      org.jmock.core.Stub doAll​(org.jmock.core.Stub[] stubs)  
      org.jmock.core.Stub doAll​(org.jmock.core.Stub stub1, org.jmock.core.Stub stub2)  
      org.jmock.core.Stub doAll​(org.jmock.core.Stub stub1, org.jmock.core.Stub stub2, org.jmock.core.Stub stub3)  
      org.jmock.core.Stub doAll​(org.jmock.core.Stub stub1, org.jmock.core.Stub stub2, org.jmock.core.Stub stub3, org.jmock.core.Stub stub4)  
      org.jmock.core.constraint.StringEndsWith endsWith​(String substring)  
      org.jmock.core.constraint.IsEqual eq​(boolean operand)  
      org.jmock.core.constraint.IsEqual eq​(byte operand)  
      org.jmock.core.constraint.IsEqual eq​(char operand)  
      org.jmock.core.constraint.IsEqual eq​(double operand)  
      org.jmock.core.constraint.IsCloseTo eq​(double operand, double error)  
      org.jmock.core.constraint.IsEqual eq​(float operand)  
      org.jmock.core.constraint.IsEqual eq​(int operand)  
      org.jmock.core.constraint.IsEqual eq​(long operand)  
      org.jmock.core.constraint.IsEqual eq​(short operand)  
      org.jmock.core.constraint.IsEqual eq​(Object operand)  
      org.jmock.core.InvocationMatcher exactly​(int expectedCount)  
      org.jmock.core.constraint.HasProperty hasProperty​(String propertyName)  
      org.jmock.core.constraint.HasPropertyWithValue hasProperty​(String propertyName, org.jmock.core.Constraint expectation)  
      org.jmock.core.constraint.IsInstanceOf isA​(Class operandClass)  
      org.jmock.core.constraint.IsGreaterThan isGreaterThan​(Comparable lowerLimit)  
      org.jmock.core.constraint.IsIn isIn​(Object[] array)  
      org.jmock.core.constraint.IsIn isIn​(Collection collection)  
      org.jmock.core.constraint.IsLessThan isLessThan​(Comparable upperLimit)  
      org.jmock.core.constraint.IsMapContaining mapContaining​(Object key, Object value)  
      org.jmock.core.constraint.IsMapContaining mapContaining​(org.jmock.core.Constraint keyConstraint, org.jmock.core.Constraint valueConstraint)  
      org.jmock.core.constraint.IsMapContaining mapWithKey​(Object key)  
      org.jmock.core.constraint.IsMapContaining mapWithKey​(org.jmock.core.Constraint keyConstraint)  
      org.jmock.core.constraint.IsMapContaining mapWithValue​(Object value)  
      org.jmock.core.constraint.IsMapContaining mapWithValue​(org.jmock.core.Constraint valueConstraint)  
      org.jmock.Mock mock​(Class mockedType)  
      org.jmock.Mock mock​(Class mockedType, String roleName)  
      org.jmock.core.InvocationMatcher never()  
      org.jmock.core.InvocationMatcher never​(String errorMessage)  
      Object newDummy​(Class dummyType)  
      Object newDummy​(Class dummyType, String name)  
      Object newDummy​(String name)  
      static <T> org.hamcrest.Matcher<T> not​(org.hamcrest.Matcher<T> matcher)  
      org.jmock.core.constraint.IsNot not​(org.jmock.core.Constraint c)  
      org.jmock.core.InvocationMatcher once()  
      org.jmock.core.Stub onConsecutiveCalls​(org.jmock.core.Stub[] stubs)  
      org.jmock.core.Stub onConsecutiveCalls​(org.jmock.core.Stub stub1, org.jmock.core.Stub stub2)  
      org.jmock.core.Stub onConsecutiveCalls​(org.jmock.core.Stub stub1, org.jmock.core.Stub stub2, org.jmock.core.Stub stub3)  
      org.jmock.core.Stub onConsecutiveCalls​(org.jmock.core.Stub stub1, org.jmock.core.Stub stub2, org.jmock.core.Stub stub3, org.jmock.core.Stub stub4)  
      org.jmock.core.constraint.Or or​(org.jmock.core.Constraint left, org.jmock.core.Constraint right)  
      org.jmock.core.Stub returnIterator​(Object[] array)  
      org.jmock.core.Stub returnIterator​(Collection collection)  
      org.jmock.core.Stub returnValue​(boolean result)  
      org.jmock.core.Stub returnValue​(byte result)  
      org.jmock.core.Stub returnValue​(char result)  
      org.jmock.core.Stub returnValue​(double result)  
      org.jmock.core.Stub returnValue​(float result)  
      org.jmock.core.Stub returnValue​(int result)  
      org.jmock.core.Stub returnValue​(long result)  
      org.jmock.core.Stub returnValue​(short result)  
      org.jmock.core.Stub returnValue​(Object o)  
      org.jmock.core.constraint.IsSame same​(Object operand)  
      void setUpMocks()  
      org.jmock.core.constraint.StringStartsWith startsWith​(String substring)  
      org.jmock.core.constraint.StringContains stringContains​(String substring)  
      void tearDownMocks()  
      org.jmock.core.Stub throwException​(Throwable throwable)  
      org.jmock.core.constraint.HasToString toString​(org.jmock.core.Constraint toStringConstraint)  
      void verify()  
      • Methods inherited from class junit.framework.Assert

        assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
    • Field Detail

      • ANYTHING

        public static final org.jmock.core.Constraint ANYTHING
      • NULL

        public static final org.jmock.core.Constraint NULL
      • NOT_NULL

        public static final org.jmock.core.Constraint NOT_NULL
    • Constructor Detail

      • MockSupport

        public MockSupport()
    • Method Detail

      • verify

        public void verify()
      • atLeastOnce

        public org.jmock.core.InvocationMatcher atLeastOnce()
      • defaultMockNameForType

        public String defaultMockNameForType​(Class mockedType)
      • doAll

        public org.jmock.core.Stub doAll​(org.jmock.core.Stub stub1,
                                         org.jmock.core.Stub stub2)
      • doAll

        public org.jmock.core.Stub doAll​(org.jmock.core.Stub stub1,
                                         org.jmock.core.Stub stub2,
                                         org.jmock.core.Stub stub3)
      • doAll

        public org.jmock.core.Stub doAll​(org.jmock.core.Stub stub1,
                                         org.jmock.core.Stub stub2,
                                         org.jmock.core.Stub stub3,
                                         org.jmock.core.Stub stub4)
      • doAll

        public org.jmock.core.Stub doAll​(org.jmock.core.Stub[] stubs)
      • exactly

        public org.jmock.core.InvocationMatcher exactly​(int expectedCount)
      • mock

        public org.jmock.Mock mock​(Class mockedType)
      • mock

        public org.jmock.Mock mock​(Class mockedType,
                                   String roleName)
      • never

        public org.jmock.core.InvocationMatcher never()
      • never

        public org.jmock.core.InvocationMatcher never​(String errorMessage)
      • once

        public org.jmock.core.InvocationMatcher once()
      • onConsecutiveCalls

        public org.jmock.core.Stub onConsecutiveCalls​(org.jmock.core.Stub stub1,
                                                      org.jmock.core.Stub stub2)
      • onConsecutiveCalls

        public org.jmock.core.Stub onConsecutiveCalls​(org.jmock.core.Stub stub1,
                                                      org.jmock.core.Stub stub2,
                                                      org.jmock.core.Stub stub3)
      • onConsecutiveCalls

        public org.jmock.core.Stub onConsecutiveCalls​(org.jmock.core.Stub stub1,
                                                      org.jmock.core.Stub stub2,
                                                      org.jmock.core.Stub stub3,
                                                      org.jmock.core.Stub stub4)
      • onConsecutiveCalls

        public org.jmock.core.Stub onConsecutiveCalls​(org.jmock.core.Stub[] stubs)
      • returnIterator

        public org.jmock.core.Stub returnIterator​(Object[] array)
      • returnIterator

        public org.jmock.core.Stub returnIterator​(Collection collection)
      • returnValue

        public org.jmock.core.Stub returnValue​(Object o)
      • returnValue

        public org.jmock.core.Stub returnValue​(boolean result)
      • returnValue

        public org.jmock.core.Stub returnValue​(byte result)
      • returnValue

        public org.jmock.core.Stub returnValue​(char result)
      • returnValue

        public org.jmock.core.Stub returnValue​(double result)
      • returnValue

        public org.jmock.core.Stub returnValue​(float result)
      • returnValue

        public org.jmock.core.Stub returnValue​(int result)
      • returnValue

        public org.jmock.core.Stub returnValue​(long result)
      • returnValue

        public org.jmock.core.Stub returnValue​(short result)
      • throwException

        public org.jmock.core.Stub throwException​(Throwable throwable)
      • and

        public org.jmock.core.constraint.And and​(org.jmock.core.Constraint left,
                                                 org.jmock.core.Constraint right)
      • arrayContaining

        public org.jmock.core.constraint.IsArrayContaining arrayContaining​(boolean element)
      • arrayContaining

        public org.jmock.core.constraint.IsArrayContaining arrayContaining​(byte element)
      • arrayContaining

        public org.jmock.core.constraint.IsArrayContaining arrayContaining​(char element)
      • arrayContaining

        public org.jmock.core.constraint.IsArrayContaining arrayContaining​(double element)
      • arrayContaining

        public org.jmock.core.constraint.IsArrayContaining arrayContaining​(float element)
      • arrayContaining

        public org.jmock.core.constraint.IsArrayContaining arrayContaining​(int element)
      • arrayContaining

        public org.jmock.core.constraint.IsArrayContaining arrayContaining​(long element)
      • arrayContaining

        public org.jmock.core.constraint.IsArrayContaining arrayContaining​(Object element)
      • arrayContaining

        public org.jmock.core.constraint.IsArrayContaining arrayContaining​(short element)
      • arrayContaining

        public org.jmock.core.constraint.IsArrayContaining arrayContaining​(org.jmock.core.Constraint elementConstraint)
      • assertThat

        public void assertThat​(boolean actual,
                               org.jmock.core.Constraint constraint)
      • assertThat

        public void assertThat​(byte actual,
                               org.jmock.core.Constraint constraint)
      • assertThat

        public void assertThat​(char actual,
                               org.jmock.core.Constraint constraint)
      • assertThat

        public void assertThat​(double actual,
                               org.jmock.core.Constraint constraint)
      • assertThat

        public void assertThat​(float actual,
                               org.jmock.core.Constraint constraint)
      • assertThat

        public void assertThat​(int actual,
                               org.jmock.core.Constraint constraint)
      • assertThat

        public void assertThat​(long actual,
                               org.jmock.core.Constraint constraint)
      • assertThat

        public void assertThat​(Object actual,
                               org.jmock.core.Constraint constraint)
      • assertThat

        public void assertThat​(short actual,
                               org.jmock.core.Constraint constraint)
      • assertThat

        public <T> void assertThat​(T actual,
                                   org.hamcrest.Matcher<T> matcher)
      • assertThat

        public <T> void assertThat​(String reason,
                                   T actual,
                                   org.hamcrest.Matcher<T> matcher)
      • collectionContaining

        public org.jmock.core.constraint.IsCollectionContaining collectionContaining​(Object element)
      • collectionContaining

        public org.jmock.core.constraint.IsCollectionContaining collectionContaining​(org.jmock.core.Constraint elementConstraint)
      • compatibleType

        public org.jmock.core.constraint.IsCompatibleType compatibleType​(Class baseType)
      • contains

        public org.jmock.core.constraint.StringContains contains​(String substring)
      • endsWith

        public org.jmock.core.constraint.StringEndsWith endsWith​(String substring)
      • eq

        public org.jmock.core.constraint.IsEqual eq​(boolean operand)
      • eq

        public org.jmock.core.constraint.IsEqual eq​(byte operand)
      • eq

        public org.jmock.core.constraint.IsEqual eq​(char operand)
      • eq

        public org.jmock.core.constraint.IsEqual eq​(double operand)
      • eq

        public org.jmock.core.constraint.IsCloseTo eq​(double operand,
                                                      double error)
      • eq

        public org.jmock.core.constraint.IsEqual eq​(float operand)
      • eq

        public org.jmock.core.constraint.IsEqual eq​(int operand)
      • eq

        public org.jmock.core.constraint.IsEqual eq​(long operand)
      • eq

        public org.jmock.core.constraint.IsEqual eq​(Object operand)
      • eq

        public org.jmock.core.constraint.IsEqual eq​(short operand)
      • hasProperty

        public org.jmock.core.constraint.HasProperty hasProperty​(String propertyName)
      • hasProperty

        public org.jmock.core.constraint.HasPropertyWithValue hasProperty​(String propertyName,
                                                                          org.jmock.core.Constraint expectation)
      • isA

        public org.jmock.core.constraint.IsInstanceOf isA​(Class operandClass)
      • isIn

        public org.jmock.core.constraint.IsIn isIn​(Object[] array)
      • isIn

        public org.jmock.core.constraint.IsIn isIn​(Collection collection)
      • isLessThan

        public org.jmock.core.constraint.IsLessThan isLessThan​(Comparable upperLimit)
      • isGreaterThan

        public org.jmock.core.constraint.IsGreaterThan isGreaterThan​(Comparable lowerLimit)
      • mapContaining

        public org.jmock.core.constraint.IsMapContaining mapContaining​(Object key,
                                                                       Object value)
      • mapContaining

        public org.jmock.core.constraint.IsMapContaining mapContaining​(org.jmock.core.Constraint keyConstraint,
                                                                       org.jmock.core.Constraint valueConstraint)
      • mapWithKey

        public org.jmock.core.constraint.IsMapContaining mapWithKey​(Object key)
      • mapWithKey

        public org.jmock.core.constraint.IsMapContaining mapWithKey​(org.jmock.core.Constraint keyConstraint)
      • mapWithValue

        public org.jmock.core.constraint.IsMapContaining mapWithValue​(Object value)
      • mapWithValue

        public org.jmock.core.constraint.IsMapContaining mapWithValue​(org.jmock.core.Constraint valueConstraint)
      • containsInOrder

        public <T> org.hamcrest.Matcher<Iterable<? extends T>> containsInOrder​(T... items)
      • containsInOrder

        public <T> org.hamcrest.Matcher<Iterable<? extends T>> containsInOrder​(org.hamcrest.Matcher<? super T>... items)
      • containsInAnyOrder

        public <T> org.hamcrest.Matcher<Iterable<? extends T>> containsInAnyOrder​(T... items)
      • containsInAnyOrder

        public <T> org.hamcrest.Matcher<Iterable<? extends T>> containsInAnyOrder​(org.hamcrest.Matcher<? super T>... items)
      • newDummy

        public Object newDummy​(Class dummyType)
      • not

        public org.jmock.core.constraint.IsNot not​(org.jmock.core.Constraint c)
      • not

        public static <T> org.hamcrest.Matcher<T> not​(org.hamcrest.Matcher<T> matcher)
      • or

        public org.jmock.core.constraint.Or or​(org.jmock.core.Constraint left,
                                               org.jmock.core.Constraint right)
      • same

        public org.jmock.core.constraint.IsSame same​(Object operand)
      • startsWith

        public org.jmock.core.constraint.StringStartsWith startsWith​(String substring)
      • stringContains

        public org.jmock.core.constraint.StringContains stringContains​(String substring)
      • toString

        public org.jmock.core.constraint.HasToString toString​(org.jmock.core.Constraint toStringConstraint)