Package com._1c.g5.v8.dt.md.resource
Class AbstractInferrerTest
java.lang.Object
com._1c.g5.v8.dt.md.resource.AbstractInferrerTest
- Direct Known Subclasses:
MdFieldInferrerTest
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
AbstractInferrerTest.InferrerTestScenario<T extends org.eclipse.emf.ecore.EObject>
-
Field Summary
FieldsModifier and TypeFieldDescriptionorg.eclipse.emf.ecore.EObject
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.protected abstract void
runInferrer
(org.eclipse.emf.ecore.EObject object) This method defines the exact inferrer run functionality.void
setUp()
protected void
Sets up the environment before the test runvoid
void
void
From 'set' condition state to 'clear' condition statevoid
testSet()
From 'clear' condition state to 'set' condition state
-
Field Details
-
scenario
-
compatibilityMode
-
object
public org.eclipse.emf.ecore.EObject object
-
-
Constructor Details
-
AbstractInferrerTest
public AbstractInferrerTest()
-
-
Method Details
-
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
-