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

    Fields
    Modifier and Type
    Field
    Description
    static final boolean
     

    Fields inherited from class test.de.uni_hildesheim.sse.AbstractTest

    TESTDATA_SYSTEM_PROPERTY

    Fields inherited from class net.ssehub.easy.dslCore.test.AbstractTest

    OBSERVER
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    A test for a succeeding activity graph configuration (contributed by M.
    void
    A test for a failing activity graph configuration (contributed by M.
    private net.ssehub.easy.varModel.confModel.IDecisionVariable
    assertDecisionVariable(net.ssehub.easy.varModel.confModel.Configuration config, String name)
    Asserts and returns a decision variable.
    private static void
    assertEnumValue(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 void
    assertEnumValue(net.ssehub.easy.varModel.model.datatypes.IResolutionScope scope, String expected, net.ssehub.easy.varModel.model.values.Value value)
    Asserts an enumeration value.
    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.
    void
    A test for an asymmetric quantor relation (contributed by M.
    protected boolean
     
    private net.ssehub.easy.varModel.confModel.Configuration
    Creates a file name, obtains the the project, asserts equality, creates a configuration and returns the configuration.
    private static final File
    Creates a file in AbstractTest.getTestDataDir().
    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.
    void
    A test for an existence quantor in a user defined operation utilized by an all quantor (contributed by M.
    static void
    Shuts down the test.
    void
    A simple control file test (contributed by M.
    static void
    Initializes the test.
    void
    Tests "defaults1".
    void
    Tests "defaults2".
    void
    Tests "defaults3".
    void
    Tests "defaults4".
    private void
    Tests variant models with same variables/expected results like "defaults1".
    void
    Tests inherited sub-constraints enabled/disabled through default values (from QM).
    void
    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, setTestDataDir

    Methods inherited from class net.ssehub.easy.dslCore.test.AbstractTest

    assertNamingAndVersion, checkEqualsAndPrepareMessage, checkEqualsAndPrepareMessage, checkEqualsAndPrint, checkEqualsAndPrint, checkErrorCodes, checkErrorCodes, checkWarnings, determineTestDataDir, file2String, isEqual, resourceInitialization, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ExperimentsControlTests

      public ExperimentsControlTests()
  • Method Details

    • createFile

      private static final File createFile(String name)
      Creates a file in AbstractTest.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 from
      name - 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 within
      expected - the (qualified) expected value as a string (may be null, requiring that value is also null)
      value - the actual value
      Throws:
      net.ssehub.easy.varModel.model.ModelQueryException - if querying the model for expected failed
      net.ssehub.easy.varModel.model.IvmlException - if creating the value for expected failed
    • 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 from
      expected - the (qualified) expected value as a string (may be null, requiring that the value of slot is also null)
      value - the actual compound value
      slot - the slot within value to test for
      Throws:
      net.ssehub.easy.varModel.model.ModelQueryException - if querying the model for expected failed
      net.ssehub.easy.varModel.model.IvmlException - if creating the value for expected failed
    • 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 from
      expected - the (qualified) expected value (may be null, requiring that the value of slot is also null)
      value - the actual compound value
      slot - the slot within value to 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 occur
      net.ssehub.easy.varModel.model.ModelQueryException - shall not occur
      net.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.IvmlException
      Tests "defaults1". Uses simple constraints.
      Throws:
      IOException - shall not occur
      net.ssehub.easy.varModel.model.ModelQueryException - shall not occur
      net.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.IvmlException
      Tests "defaults2". Uses shadowed slots.
      Throws:
      IOException - shall not occur
      net.ssehub.easy.varModel.model.ModelQueryException - shall not occur
      net.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.IvmlException
      Tests "defaults3". This has not completely the same semantics as "defaults1" as slots are not uninitialized (Java null) rather than containing the IVML null. Uses assigning dynamic-dispatch user-defined operations.
      Throws:
      IOException - shall not occur
      net.ssehub.easy.varModel.model.ModelQueryException - shall not occur
      net.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.IvmlException
      Tests "defaults4". Uses assigning dynamic-dispatch user-defined operations.
      Throws:
      IOException - shall not occur
      net.ssehub.easy.varModel.model.ModelQueryException - shall not occur
      net.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.IvmlException
      Tests inherited sub-constraints enabled/disabled through default values (from QM).
      Throws:
      IOException - shall not occur
      net.ssehub.easy.varModel.model.ModelQueryException - shall not occur
      net.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.IvmlException
      A simple control file test (contributed by M. Keunecke).
      Throws:
      IOException - shall not occur
      net.ssehub.easy.varModel.model.ModelQueryException - shall not occur
      net.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.IvmlException
      A test for an existence quantor in a user defined operation utilized by an all quantor (contributed by M. Keunecke).
      Throws:
      IOException - shall not occur
      net.ssehub.easy.varModel.model.ModelQueryException - shall not occur
      net.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.IvmlException
      A test for an asymmetric quantor relation (contributed by M. Keunecke).
      Throws:
      IOException - shall not occur
      net.ssehub.easy.varModel.model.ModelQueryException - shall not occur
      net.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.IvmlException
      A test for a failing activity graph configuration (contributed by M. Keunecke, J. Hagedorn).
      Throws:
      IOException - shall not occur
      net.ssehub.easy.varModel.model.ModelQueryException - shall not occur
      net.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.IvmlException
      A test for a succeeding activity graph configuration (contributed by M. Keunecke, J. Hagedorn).
      Throws:
      IOException - shall not occur
      net.ssehub.easy.varModel.model.ModelQueryException - shall not occur
      net.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 configuration
      rConfig - the reasoner configuration
      Returns:
      the reasoning result
    • checkWriteback

      protected boolean checkWriteback(File file)
      Overrides:
      checkWriteback in class test.de.uni_hildesheim.sse.AbstractTest
    • typeTest

      public void typeTest() throws IOException
      Tests a quantified type expression (contributed by M. Keunecke, J. Hagedorn).
      Throws:
      IOException - shall not occur