Package net.ssehub.easy.dslCore.test
Class AbstractTest.EqualitySetup<R extends net.ssehub.easy.basics.modelManagement.IModel>
java.lang.Object
net.ssehub.easy.dslCore.test.AbstractTest.EqualitySetup<R>
- Type Parameters:
R- the model type
- Enclosing class:
AbstractTest<R extends net.ssehub.easy.basics.modelManagement.IModel>
protected static class AbstractTest.EqualitySetup<R extends net.ssehub.easy.basics.modelManagement.IModel>
extends Object
Setup data needed to compare test results for equality.
- Author:
- Holger Eichelberger
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEqualitySetup(File file, String expectedName, String expectedVersion) Creates an instance with no trace output and empty parameters.EqualitySetup(File file, String expectedName, String expectedVersion, File expectedTrace) Creates an instance with empty parameters.EqualitySetup(File file, String expectedName, String expectedVersion, File expectedTrace, Map<String, Object> parameter) Creates an instance with empty parameters. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns wehther equal comparison shall be enabled.The expected failure code.Returns the expected fail reason (if the execution failed).Returns the expected name of the model.Returns the file containing the expected output.Returns the file containing the expected execution trace.Returns the expected version of the model.getFile()Returns the file containing the model.getModel()Returns the (overriding) model.Returns the parameter mappings, i.e., the name of the top-level input parameter and their individual values.Returns the name of the start element for execution.voidsetEnableEquals(boolean enableEquals) Enables or disables the actual equals test and passes through to execution.voidsetExpectedFailCode(Integer failCode) Defines an optional expected failure code.voidsetExpectedFailReason(String failReason) Sets an optional reason for expected execution failure.voidsetExpectedOutputFile(File expectedOutputFile) Defines the file containing the expected output.voidSets the (overriding) model.voidsetStartElement(String startElement) Changes the name of the start element for execution.
-
Field Details
-
file
-
expectedName
-
expectedVersion
-
startElement
-
expectedTrace
-
parameter
-
expectedOutputFile
-
enableEquals
private boolean enableEquals -
expectedFailCode
-
expectedFailReason
-
model
-
-
Constructor Details
-
EqualitySetup
Creates an instance with no trace output and empty parameters.- Parameters:
file- the file containing the modelexpectedName- the expected name of (at least one) containing project, (may be null to disable check)expectedVersion- the expected version ofexpectedName
-
EqualitySetup
Creates an instance with empty parameters.- Parameters:
file- the file containing the modelexpectedName- the expected name of (at least one) containing project, (may be null to disable check)expectedVersion- the expected version ofexpectedNameexpectedTrace- the expected execution trace (may be null if only parsing shall be tested)
-
EqualitySetup
public EqualitySetup(File file, String expectedName, String expectedVersion, File expectedTrace, Map<String, Object> parameter) Creates an instance with empty parameters.- Parameters:
file- the file containing the modelexpectedName- the expected name of (at least one) containing project, (may be null to disable check)expectedVersion- the expected version ofexpectedNameexpectedTrace- the expected execution trace (may be null if only parsing shall be tested)parameter- mapping
-
-
Method Details
-
setModel
Sets the (overriding) model. If using this method, ensure that the model you are using is identical to the model used during tests.- Parameters:
model- the model (may be null for none)
-
getModel
Returns the (overriding) model.- Returns:
- the model (may be null if there is none)
-
getFile
Returns the file containing the model.- Returns:
- the file containing the model
-
getExpectedName
Returns the expected name of the model.- Returns:
- the expected name
-
getExpectedVersion
Returns the expected version of the model.- Returns:
- the expected version
-
getExpectedTrace
Returns the file containing the expected execution trace.- Returns:
- the file containing the execution trace
-
getParameter
Returns the parameter mappings, i.e., the name of the top-level input parameter and their individual values.- Returns:
- the parameter mapping
-
getStartElement
Returns the name of the start element for execution.- Returns:
- the name of the start element ("main" by default)
-
setStartElement
Changes the name of the start element for execution.- Parameters:
startElement- the new name of the start element
-
getExpectedOutputFile
Returns the file containing the expected output.- Returns:
- the file containing the expected output
-
setExpectedOutputFile
Defines the file containing the expected output.- Parameters:
expectedOutputFile- the file containing the expected output
-
enableEquals
public boolean enableEquals()Returns wehther equal comparison shall be enabled.- Returns:
trueif enabled,falseelse
-
setEnableEquals
public void setEnableEquals(boolean enableEquals) Enables or disables the actual equals test and passes through to execution.- Parameters:
enableEquals- whether equals shall be enabled (defaulttrue)
-
setExpectedFailReason
Sets an optional reason for expected execution failure.- Parameters:
failReason- the reason for failing (may be null for none)
-
getExpectedFailReason
Returns the expected fail reason (if the execution failed).- Returns:
- the reason or null if unknown, not set or not failing
-
setExpectedFailCode
Defines an optional expected failure code.- Parameters:
failCode- the failure code
-
getExpectedFailCode
The expected failure code.- Returns:
- the failure code (may be null if not set)
-