Class AbstractMultisetSetCountTester<E>

All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
MultisetSetCountConditionallyTester, MultisetSetCountUnconditionallyTester

public abstract class AbstractMultisetSetCountTester<E> extends AbstractMultisetTester<E>
Common superclass for MultisetSetCountUnconditionallyTester and MultisetSetCountConditionallyTester. It is used by those testers to test calls to the unconditional setCount() method and calls to the conditional setCount() method when the expected present count is correct.
  • Constructor Details

    • AbstractMultisetSetCountTester

      public AbstractMultisetSetCountTester()
  • Method Details

    • assertSetCount

      private void assertSetCount(E element, int count)
    • setCountCheckReturnValue

      abstract void setCountCheckReturnValue(E element, int count)
      Call the setCount() method under test, and check its return value.
    • setCountNoCheckReturnValue

      abstract void setCountNoCheckReturnValue(E element, int count)
      Call the setCount() method under test, but do not check its return value. Callers should use this method over setCountCheckReturnValue(Object, int) when they expect setCount() to throw an exception, as checking the return value could produce an incorrect error message like "setCount() should return the original count" instead of the message passed to a later invocation of fail(), like "setCount should throw UnsupportedOperationException."
    • assertSetCountIncreasingFailure

      private void assertSetCountIncreasingFailure(E element, int count)
    • assertSetCountDecreasingFailure

      private void assertSetCountDecreasingFailure(E element, int count)
    • assertZeroToZero

      private void assertZeroToZero()
    • assertOneToOne

      private void assertOneToOne()
    • assertThreeToThree

      private void assertThreeToThree()
    • testSetCount_zeroToZero_addSupported

      public void testSetCount_zeroToZero_addSupported()
    • testSetCount_zeroToZero_removeSupported

      public void testSetCount_zeroToZero_removeSupported()
    • testSetCount_zeroToZero_unsupported

      public void testSetCount_zeroToZero_unsupported()
    • testSetCount_oneToOne_addSupported

      public void testSetCount_oneToOne_addSupported()
    • testSetCount_oneToOne_removeSupported

      public void testSetCount_oneToOne_removeSupported()
    • testSetCount_oneToOne_unsupported

      public void testSetCount_oneToOne_unsupported()
    • testSetCount_threeToThree_addSupported

      public void testSetCount_threeToThree_addSupported()
    • testSetCount_threeToThree_removeSupported

      public void testSetCount_threeToThree_removeSupported()
    • testSetCount_threeToThree_unsupported

      public void testSetCount_threeToThree_unsupported()
    • testSetCount_zeroToOne_supported

      public void testSetCount_zeroToOne_supported()
    • testSetCountZeroToOneConcurrentWithIteration

      public void testSetCountZeroToOneConcurrentWithIteration()
    • testSetCountZeroToOneConcurrentWithEntrySetIteration

      public void testSetCountZeroToOneConcurrentWithEntrySetIteration()
    • testSetCount_zeroToThree_supported

      public void testSetCount_zeroToThree_supported()
    • testSetCount_oneToThree_supported

      public void testSetCount_oneToThree_supported()
    • testSetCount_zeroToOne_unsupported

      public void testSetCount_zeroToOne_unsupported()
    • testSetCount_zeroToThree_unsupported

      public void testSetCount_zeroToThree_unsupported()
    • testSetCount_oneToThree_unsupported

      public void testSetCount_oneToThree_unsupported()
    • testSetCount_oneToZero_supported

      public void testSetCount_oneToZero_supported()
    • testSetCountOneToZeroConcurrentWithIteration

      public void testSetCountOneToZeroConcurrentWithIteration()
    • testSetCountOneToZeroConcurrentWithEntrySetIteration

      public void testSetCountOneToZeroConcurrentWithEntrySetIteration()
    • testSetCount_threeToZero_supported

      public void testSetCount_threeToZero_supported()
    • testSetCount_threeToOne_supported

      public void testSetCount_threeToOne_supported()
    • testSetCount_oneToZero_unsupported

      public void testSetCount_oneToZero_unsupported()
    • testSetCount_threeToZero_unsupported

      public void testSetCount_threeToZero_unsupported()
    • testSetCount_threeToOne_unsupported

      public void testSetCount_threeToOne_unsupported()
    • testSetCount_removeNull_nullSupported

      public void testSetCount_removeNull_nullSupported()
    • testSetCount_addNull_nullSupported

      public void testSetCount_addNull_nullSupported()
    • testSetCount_addNull_nullUnsupported

      public void testSetCount_addNull_nullUnsupported()
    • testSetCount_noOpNull_nullSupported

      public void testSetCount_noOpNull_nullSupported()
    • testSetCount_noOpNull_nullUnsupported

      public void testSetCount_noOpNull_nullUnsupported()
    • testSetCount_existingNoNopNull_nullSupported

      public void testSetCount_existingNoNopNull_nullSupported()
    • testSetCount_negative_removeSupported

      public void testSetCount_negative_removeSupported()
    • testSetCount_negative_removeUnsupported

      public void testSetCount_negative_removeUnsupported()
    • getSetCountDuplicateInitializingMethods

      public static List<Method> getSetCountDuplicateInitializingMethods()
      Returns Method instances for the setCount() tests that assume multisets support duplicates so that the test of Multisets.forSet() can suppress them.
    • getMethod

      private static Method getMethod(String methodName)