Class AbstractInferrerTest

  • Direct Known Subclasses:
    MdFieldInferrerTest

    public abstract class AbstractInferrerTest
    extends Object
    Base implementation for DD inferrer tests. All cases sharing the same testing scenario:
    • "Straight set sceanrio". The object is being set in default state by re-setting the computation condition ("re-set state") and running the inferrer. Then the computation condition is being set and the inferrer being run again. The result of the last run is being validated
    • "Reset scenario". The object is being put in "set" state, and then the "reset" state is being applied. The result of the last inferrer run is being validated.
    • "Double set scenario". The object is being put in "set" state twice. The result of the last inferrer run is being validated.
    • "Double reset scenario". The object is being put in "reset" state twice. The result of the last inferrer run is being validated.
    • Constructor Detail

      • AbstractInferrerTest

        public AbstractInferrerTest()
    • Method Detail

      • prepareMultiVersionTestInput

        protected static Collection<Object[]> prepareMultiVersionTestInput​(Collection<AbstractInferrerTest.InferrerTestScenario<? extends org.eclipse.emf.ecore.EObject>> scenarios)
        Utility method for preparing parameters to run all provided scenarios against supported compatibility modes. This method should be called from the parameter factory method of the subclass.
        Parameters:
        scenarios - The set of scenarios.
        Returns:
        The ready set of parameters.
      • setUp

        public void setUp()
      • setupEnvironmentBeforeTest

        protected void setupEnvironmentBeforeTest()
        Sets up the environment before the test run
      • runInferrer

        protected abstract void runInferrer​(org.eclipse.emf.ecore.EObject object)
        This method defines the exact inferrer run functionality. Example: mdFieldInferrer.inferFrom(object, typeProvider, compatibilityMode);
        Parameters:
        object - The target object for the inferrer.
      • testDoubleClear

        public void testDoubleClear()
      • testDoubleSet

        public void testDoubleSet()
      • testReset

        public void testReset()
        From 'set' condition state to 'clear' condition state
      • testSet

        public void testSet()
        From 'clear' condition state to 'set' condition state