Class ExperimentsControlTests
java.lang.Object
net.ssehub.easy.dslCore.test.AbstractTest<net.ssehub.easy.varModel.model.Project>
test.de.uni_hildesheim.sse.AbstractTest
net.ssehub.easy.producer.scenario_tests.ExperimentsControlTests
public class ExperimentsControlTests
extends test.de.uni_hildesheim.sse.AbstractTest
A test class for blackbox testing parser and type resolution of
IVML files contributed from "external" sources. These are basically IVML tests, which
cannot be executed in IVML.tests as the reasoner dependency is not available there.
- Author:
- Holger Eichelberger
-
Nested Class Summary
Nested classes/interfaces inherited from class net.ssehub.easy.dslCore.test.AbstractTest
net.ssehub.easy.dslCore.test.AbstractTest.EqualitySetup<R extends net.ssehub.easy.basics.modelManagement.IModel> -
Field Summary
FieldsFields inherited from class test.de.uni_hildesheim.sse.AbstractTest
TESTDATA_SYSTEM_PROPERTYFields inherited from class net.ssehub.easy.dslCore.test.AbstractTest
OBSERVER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidA test for a succeeding activity graph configuration (contributed by M.voidA test for a failing activity graph configuration (contributed by M.private net.ssehub.easy.varModel.confModel.IDecisionVariableassertDecisionVariable(net.ssehub.easy.varModel.confModel.Configuration config, String name) Asserts and returns a decision variable.private static voidassertEnumValue(net.ssehub.easy.varModel.confModel.Configuration config, String expected, net.ssehub.easy.varModel.model.values.CompoundValue value, String slot) Asserts an enumeration value.private static voidassertEnumValue(net.ssehub.easy.varModel.model.datatypes.IResolutionScope scope, String expected, net.ssehub.easy.varModel.model.values.Value value) Asserts an enumeration value.private static voidassertIntValue(net.ssehub.easy.varModel.confModel.Configuration config, Integer expected, net.ssehub.easy.varModel.model.values.CompoundValue value, String slot) Asserts an integer value.voidA test for an asymmetric quantor relation (contributed by M.protected booleancheckWriteback(File file) private net.ssehub.easy.varModel.confModel.ConfigurationcreateAndAssertEqual(String name) Creates a file name, obtains the the project, asserts equality, creates a configuration and returns the configuration.private static final FilecreateFile(String name) Creates a file inAbstractTest.getTestDataDir().private net.ssehub.easy.reasoning.core.reasoner.ReasoningResultdoReasoning(net.ssehub.easy.varModel.confModel.Configuration cfg, net.ssehub.easy.reasoning.core.reasoner.ReasonerConfiguration rConfig) Performs the reasoning.voidA test for an existence quantor in a user defined operation utilized by an all quantor (contributed by M.static voidshutDown()Shuts down the test.voidA simple control file test (contributed by M.static voidstartUp()Initializes the test.voidTests "defaults1".voidTests "defaults2".voidTests "defaults3".voidTests "defaults4".private voidtestDefaults(String name) Tests variant models with same variables/expected results like "defaults1".voidtestSub()Tests inherited sub-constraints enabled/disabled through default values (from QM).voidtypeTest()Tests a quantified type expression (contributed by M.Methods inherited from class test.de.uni_hildesheim.sse.AbstractTest
assertComments, assertEqual, assertEqual, basicShutDown, basicStartUp, checkWarningCodes, getTestDataDir, setTestDataDirMethods inherited from class net.ssehub.easy.dslCore.test.AbstractTest
assertNamingAndVersion, checkEqualsAndPrepareMessage, checkEqualsAndPrepareMessage, checkEqualsAndPrint, checkEqualsAndPrint, checkErrorCodes, checkErrorCodes, checkWarnings, determineTestDataDir, file2String, isEqual, resourceInitialization, toString
-
Field Details
-
PRINT_REASONER_MESSAGES
public static final boolean PRINT_REASONER_MESSAGES- See Also:
-
-
Constructor Details
-
ExperimentsControlTests
public ExperimentsControlTests()
-
-
Method Details
-
createFile
Creates a file inAbstractTest.getTestDataDir().- Parameters:
name- the name of the file (excluding ".ivml")- Returns:
- the file
-
startUp
public static void startUp()Initializes the test. -
shutDown
public static void shutDown()Shuts down the test. -
createAndAssertEqual
private net.ssehub.easy.varModel.confModel.Configuration createAndAssertEqual(String name) throws IOException Creates a file name, obtains the the project, asserts equality, creates a configuration and returns the configuration.- Parameters:
name- the name of the project- Returns:
- the configuration
- Throws:
IOException- in case that loading fails
-
assertDecisionVariable
private net.ssehub.easy.varModel.confModel.IDecisionVariable assertDecisionVariable(net.ssehub.easy.varModel.confModel.Configuration config, String name) throws net.ssehub.easy.varModel.model.ModelQueryException Asserts and returns a decision variable.- Parameters:
config- the configuration to read fromname- the name of the variable- Returns:
- the variable if it exists
- Throws:
net.ssehub.easy.varModel.model.ModelQueryException- if finding the variable fails
-
assertEnumValue
private static void assertEnumValue(net.ssehub.easy.varModel.model.datatypes.IResolutionScope scope, String expected, net.ssehub.easy.varModel.model.values.Value value) throws net.ssehub.easy.varModel.model.ModelQueryException, net.ssehub.easy.varModel.model.IvmlException Asserts an enumeration value.- Parameters:
scope- the scope to search the expected value withinexpected- the (qualified) expected value as a string (may be null, requiring thatvalueis also null)value- the actual value- Throws:
net.ssehub.easy.varModel.model.ModelQueryException- if querying the model forexpectedfailednet.ssehub.easy.varModel.model.IvmlException- if creating the value forexpectedfailed
-
assertEnumValue
private static void assertEnumValue(net.ssehub.easy.varModel.confModel.Configuration config, String expected, net.ssehub.easy.varModel.model.values.CompoundValue value, String slot) throws net.ssehub.easy.varModel.model.ModelQueryException, net.ssehub.easy.varModel.model.IvmlException Asserts an enumeration value.- Parameters:
config- the configuration to take the value/scope fromexpected- the (qualified) expected value as a string (may be null, requiring that the value ofslotis also null)value- the actual compound valueslot- the slot withinvalueto test for- Throws:
net.ssehub.easy.varModel.model.ModelQueryException- if querying the model forexpectedfailednet.ssehub.easy.varModel.model.IvmlException- if creating the value forexpectedfailed
-
assertIntValue
private static void assertIntValue(net.ssehub.easy.varModel.confModel.Configuration config, Integer expected, net.ssehub.easy.varModel.model.values.CompoundValue value, String slot) Asserts an integer value.- Parameters:
config- the configuration to take the value/scope fromexpected- the (qualified) expected value (may be null, requiring that the value ofslotis also null)value- the actual compound valueslot- the slot withinvalueto test for
-
testDefaults
private void testDefaults(String name) throws IOException, net.ssehub.easy.varModel.model.ModelQueryException, net.ssehub.easy.varModel.model.IvmlException Tests variant models with same variables/expected results like "defaults1".- Parameters:
name- the name of the model/file- Throws:
IOException- shall not occurnet.ssehub.easy.varModel.model.ModelQueryException- shall not occurnet.ssehub.easy.varModel.model.IvmlException- shall not occur
-
testControlDefaults1
public void testControlDefaults1() throws IOException, net.ssehub.easy.varModel.model.ModelQueryException, net.ssehub.easy.varModel.model.IvmlExceptionTests "defaults1". Uses simple constraints.- Throws:
IOException- shall not occurnet.ssehub.easy.varModel.model.ModelQueryException- shall not occurnet.ssehub.easy.varModel.model.IvmlException- shall not occur
-
testControlDefaults2
public void testControlDefaults2() throws IOException, net.ssehub.easy.varModel.model.ModelQueryException, net.ssehub.easy.varModel.model.IvmlExceptionTests "defaults2". Uses shadowed slots.- Throws:
IOException- shall not occurnet.ssehub.easy.varModel.model.ModelQueryException- shall not occurnet.ssehub.easy.varModel.model.IvmlException- shall not occur
-
testControlDefaults3
public void testControlDefaults3() throws IOException, net.ssehub.easy.varModel.model.ModelQueryException, net.ssehub.easy.varModel.model.IvmlExceptionTests "defaults3". This has not completely the same semantics as "defaults1" as slots are not uninitialized (Java null) rather than containing theIVML null. Uses assigning dynamic-dispatch user-defined operations.- Throws:
IOException- shall not occurnet.ssehub.easy.varModel.model.ModelQueryException- shall not occurnet.ssehub.easy.varModel.model.IvmlException- shall not occur
-
testControlDefaults4
public void testControlDefaults4() throws IOException, net.ssehub.easy.varModel.model.ModelQueryException, net.ssehub.easy.varModel.model.IvmlExceptionTests "defaults4". Uses assigning dynamic-dispatch user-defined operations.- Throws:
IOException- shall not occurnet.ssehub.easy.varModel.model.ModelQueryException- shall not occurnet.ssehub.easy.varModel.model.IvmlException- shall not occur
-
testSub
public void testSub() throws IOException, net.ssehub.easy.varModel.model.ModelQueryException, net.ssehub.easy.varModel.model.IvmlExceptionTests inherited sub-constraints enabled/disabled through default values (from QM).- Throws:
IOException- shall not occurnet.ssehub.easy.varModel.model.ModelQueryException- shall not occurnet.ssehub.easy.varModel.model.IvmlException- shall not occur
-
simpleTest
public void simpleTest() throws IOException, net.ssehub.easy.varModel.model.ModelQueryException, net.ssehub.easy.varModel.model.IvmlExceptionA simple control file test (contributed by M. Keunecke).- Throws:
IOException- shall not occurnet.ssehub.easy.varModel.model.ModelQueryException- shall not occurnet.ssehub.easy.varModel.model.IvmlException- shall not occur
-
existsTest
public void existsTest() throws IOException, net.ssehub.easy.varModel.model.ModelQueryException, net.ssehub.easy.varModel.model.IvmlExceptionA test for an existence quantor in a user defined operation utilized by an all quantor (contributed by M. Keunecke).- Throws:
IOException- shall not occurnet.ssehub.easy.varModel.model.ModelQueryException- shall not occurnet.ssehub.easy.varModel.model.IvmlException- shall not occur
-
asymmetricTest
public void asymmetricTest() throws IOException, net.ssehub.easy.varModel.model.ModelQueryException, net.ssehub.easy.varModel.model.IvmlExceptionA test for an asymmetric quantor relation (contributed by M. Keunecke).- Throws:
IOException- shall not occurnet.ssehub.easy.varModel.model.ModelQueryException- shall not occurnet.ssehub.easy.varModel.model.IvmlException- shall not occur
-
activityTestFail
public void activityTestFail() throws IOException, net.ssehub.easy.varModel.model.ModelQueryException, net.ssehub.easy.varModel.model.IvmlExceptionA test for a failing activity graph configuration (contributed by M. Keunecke, J. Hagedorn).- Throws:
IOException- shall not occurnet.ssehub.easy.varModel.model.ModelQueryException- shall not occurnet.ssehub.easy.varModel.model.IvmlException- shall not occur
-
activityTest
public void activityTest() throws IOException, net.ssehub.easy.varModel.model.ModelQueryException, net.ssehub.easy.varModel.model.IvmlExceptionA test for a succeeding activity graph configuration (contributed by M. Keunecke, J. Hagedorn).- Throws:
IOException- shall not occurnet.ssehub.easy.varModel.model.ModelQueryException- shall not occurnet.ssehub.easy.varModel.model.IvmlException- shall not occur
-
doReasoning
private net.ssehub.easy.reasoning.core.reasoner.ReasoningResult doReasoning(net.ssehub.easy.varModel.confModel.Configuration cfg, net.ssehub.easy.reasoning.core.reasoner.ReasonerConfiguration rConfig) Performs the reasoning.- Parameters:
cfg- the configurationrConfig- the reasoner configuration- Returns:
- the reasoning result
-
checkWriteback
- Overrides:
checkWritebackin classtest.de.uni_hildesheim.sse.AbstractTest
-
typeTest
Tests a quantified type expression (contributed by M. Keunecke, J. Hagedorn).- Throws:
IOException- shall not occur
-