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
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractInferrerTest.InferrerTestScenario<T extends org.eclipse.emf.ecore.EObject>
-
Field Summary
Fields Modifier and Type Field Description CompatibilityMode
compatibilityMode
org.eclipse.emf.ecore.EObject
object
AbstractInferrerTest.InferrerTestScenario
scenario
-
Constructor Summary
Constructors Constructor Description AbstractInferrerTest()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description 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.protected abstract void
runInferrer(org.eclipse.emf.ecore.EObject object)
This method defines the exact inferrer run functionality.void
setUp()
protected void
setupEnvironmentBeforeTest()
Sets up the environment before the test runvoid
testDoubleClear()
void
testDoubleSet()
void
testReset()
From 'set' condition state to 'clear' condition statevoid
testSet()
From 'clear' condition state to 'set' condition state
-
-
-
Field Detail
-
scenario
public AbstractInferrerTest.InferrerTestScenario scenario
-
compatibilityMode
public CompatibilityMode compatibilityMode
-
object
public org.eclipse.emf.ecore.EObject object
-
-
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
-
-