Class RealTests

java.lang.Object
net.ssehub.easy.dslCore.test.AbstractTest<net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
test.de.uni_hildesheim.sse.vil.buildlang.AbstractTest<net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
Direct Known Subclasses:
LocalRealTests

public class RealTests extends AbstractRealTests
Real use case tests. Although Maven is available, we run the tests without Maven in order to avoid external resolution issues and to allow for offline use. Thus, maven is commented out if used.
Author:
Holger Eichelberger, El-Sharkawy
  • Field Details

    • RELATIVE_CURL_EXECUTABLES

      protected static final String[] RELATIVE_CURL_EXECUTABLES
    • tests

      private static RealTests tests
  • Constructor Details

    • RealTests

      public RealTests()
  • Method Details

    • addTestDataLocations

      protected void addTestDataLocations()
      Overrides:
      addTestDataLocations in class test.de.uni_hildesheim.sse.vil.buildlang.AbstractTest<net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
    • startUp

      public static void startUp()
      Starts up the test.
    • shutDown

      public static void shutDown()
      Tears down the test.
    • getTestFolder

      protected File getTestFolder()
      Specified by:
      getTestFolder in class test.de.uni_hildesheim.sse.vil.buildlang.AbstractTest<net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
    • cleanTempFolder

      protected void cleanTempFolder(File baseFolder)
      Deletes a newly created folder inside the temp folder. Should be called after the creation of new tests.
      Parameters:
      baseFolder - A project folder created during a test.
    • assertEqual

      protected void assertEqual(String file, String expectedName, int... expectedErrorCodes) throws IOException
      Asserts equality of the models and the parsed/analyzed result, i.e. it reads file as a model, analyzes it, compares the obtained errors with expectedErrorCodes, compares the contents of file with the printed (analyzed) model and checks the project information directly obtained from file. It is assumed that no version shall be checked.
      Parameters:
      file - the name of the file containing the model (without suffix)
      expectedName - the expected name of the model
      expectedErrorCodes - the expected and allowed error codes (errors occurring multiple times need to be listed multiple times here)
      Throws:
      IOException - problems finding or reading the model file
    • assertEqual

      protected void assertEqual(String file, String expectedName, String expectedVersion, int... expectedErrorCodes) throws IOException
      Asserts equality of the models and the parsed/analyzed result, i.e. it reads file as a model, analyzes it, compares the obtained errors with expectedErrorCodes, compares the contents of file with the printed (analyzed) model and checks the project information directly obtained from file. It is assumed that the name of the model is the same as of the file.
      Parameters:
      file - the name of the file containing the model (without suffix)
      expectedName - the expected name of the model
      expectedVersion - the expected version of expectedName
      expectedErrorCodes - the expected and allowed error codes (errors occurring multiple times need to be listed multiple times here)
      Throws:
      IOException - problems finding or reading the model file
    • assertEqual

      protected void assertEqual(String file, int... expectedErrorCodes) throws IOException
      Asserts equality of the models and the parsed/analyzed result, i.e. it reads file as a model, analyzes it, compares the obtained errors with expectedErrorCodes, compares the contents of file with the printed (analyzed) model and checks the project information directly obtained from file. It is assumed that the name of the model is the same as of the file and no version.
      Parameters:
      file - the name of the file containing the model (without suffix)
      expectedErrorCodes - the expected and allowed error codes (errors occurring multiple times need to be listed multiple times here)
      Throws:
      IOException - problems finding or reading the model file
    • assertCurlOut

      protected void assertCurlOut(File base) throws IOException
      Assert the output of the curl wrapper to be expected.
      Parameters:
      base - the base directory
      Throws:
      IOException - in case of I/O problems (shall not happen)
    • executeIndenicaCase

      protected File executeIndenicaCase(String projectName, String ivmlVersion, String vilVersion, String... makeExecutable) throws IOException
      Executes an INDENICA case.
      Parameters:
      projectName - the name of the project
      ivmlVersion - the version of the IVML file (may be null)
      vilVersion - the version of the VIL build file (may be null)
      makeExecutable - those files (in relative paths) within the temporary copy of the project to be made executable
      Returns:
      the base directory of the instantiated project (null for no assert)
      Throws:
      IOException - in case of I/O problems
    • testIndenicaPlRmsPlatform2

      public void testIndenicaPlRmsPlatform2() throws IOException
      Tests the complete VIL setup for the INDENICA RMS platform.
      Throws:
      IOException - should not occur
    • testIndenicaPlYmsPlatform

      public void testIndenicaPlYmsPlatform() throws IOException
      Tests the complete VIL setup for the INDENICA YMS platform.
      Throws:
      IOException - should not occur
    • testEP1

      public void testEP1() throws IOException
      Tests the initial Easy-Producer 1 build file.
      Throws:
      IOException - should not occur
    • testYMS1

      public void testYMS1() throws IOException
      Tests the initial YMS build file (contributed by Christian).
      Throws:
      IOException - should not occur
    • testElevator

      public void testElevator() throws IOException
      Tests the elevator case.
      Throws:
      IOException - should not occur
    • enumerateJavaFiles

      protected void enumerateJavaFiles(File location, List<File> files)
      Enumerate Java files in location and store results in files.
      Parameters:
      location - the location to enumerate
      files - the resulting java files (modified as a side effect)
    • testInstantiateNumericCSVInstantiation

      public void testInstantiateNumericCSVInstantiation() throws IOException
      Tests whether the instantiation process of templates will work.
      Throws:
      IOException - If the produced file was not saved or the expected file was not found for comparison
    • testSvncontrol

      public void testSvncontrol() throws IOException
      Tests the SVNControl test case.
      Throws:
      IOException - shall not occur
    • testSvncontrol

      private void testSvncontrol(String[] versions) throws IOException
      Tests the SVNcontrol use case for given versions.
      Parameters:
      versions - the version of the models, index 0 IVML, index 1 VIL build file (may be null)
      Throws:
      IOException - shall not occur
    • assertExists

      protected static void assertExists(File base, String name, String extension)
      Asserts the existence of the given source file and the related class file.
      Parameters:
      base - the base folder
      name - the name/path of the file (without extension)
      extension - the primary extension which leads to the class file
    • assertExists

      protected static void assertExists(File file)
      Asserts the existence of the given file.
      Parameters:
      file - the file
    • testQualiMasterApril14

      public void testQualiMasterApril14() throws IOException
      Tests the very initial QualiMaster test case.
      Throws:
      IOException - shall not occur
    • testQualiMasterMay14

      public void testQualiMasterMay14() throws IOException
      Tests the very initial QualiMaster test case.
      Throws:
      IOException - shall not occur
    • testQualiMasterFeb15

      public void testQualiMasterFeb15() throws IOException
      Tests the QualiMaster model / derivation in its state at the first review (February 2015).
      Throws:
      IOException - shall not occur
    • testQualiMasterFeb16

      public void testQualiMasterFeb16() throws IOException
      Tests the QualiMaster model / derivation in its state at the second review (February 2016).
      Throws:
      IOException - shall not occur
    • testQualiMasterMar15

      public void testQualiMasterMar15() throws IOException
      Tests the QualiMaster model / derivation for VIL field migration (March 2015).
      Throws:
      IOException - shall not occur
    • testQualiMasterJun15

      public void testQualiMasterJun15() throws IOException
      Tests the QualiMaster model / derivation (June 2015, without rt-VIL).
      Throws:
      IOException - shall not occur
    • testQualiMasterFeb17Impl

      protected void testQualiMasterFeb17Impl(AbstractScenarioTest.Mode mode) throws IOException
      Tests the QualiMaster model / derivation (February 2017, without rt-VIL). Seems to fail on Jenkins. This is a slightly modified version to ensure creation of artifacts in repeatable sequence.
      Parameters:
      mode - the test execution mode
      Throws:
      IOException - shall not occur
    • testQualiMasterFeb17

      public void testQualiMasterFeb17() throws IOException
      Tests the QualiMaster model / derivation (February 2017, without rt-VIL). Seems to fail on Jenkins. This is a slightly modified version to ensure creation of artifacts in repeatable sequence.
      Throws:
      IOException - shall not occur
    • testQualiMasterSep17Impl

      protected void testQualiMasterSep17Impl(AbstractScenarioTest.Mode mode) throws IOException
      Tests the QualiMaster model / derivation (February 2017, experimentally modified, without rt-VIL). Seems to fail on Jenkins. This is a modified version for evaluating VIL/VTL.
      Parameters:
      mode - the test execution mode
      Throws:
      IOException - shall not occur
    • testQualiMasterSep17

      public void testQualiMasterSep17() throws IOException
      Tests the QualiMaster model / derivation (February 2017, experimentally modified, without rt-VIL). Seems to fail on Jenkins. This is a modified version for evaluating VIL/VTL.
      Throws:
      IOException - shall not occur
    • testQualiMasterMay21

      public void testQualiMasterMay21() throws IOException
      Tests the QualiMaster model / derivation (June 2015, without rt-VIL).
      Throws:
      IOException - shall not occur
    • testIipEcosphereOct21

      public void testIipEcosphereOct21() throws IOException
      Tests the IIP-Ecosphere model / instantiation (October 21).
      Throws:
      IOException - shall not occur
    • testIipEcosphereNov21

      public void testIipEcosphereNov21() throws IOException
      Tests the IIP-Ecosphere model / instantiation (November 21).
      Throws:
      IOException - shall not occur
    • testIipEcosphereSep22

      public void testIipEcosphereSep22() throws IOException
      Tests the IIP-Ecosphere model / instantiation (September 21).
      Throws:
      IOException - shall not occur
    • testIipEcosphereTest

      public void testIipEcosphereTest() throws IOException
      Tests the IIP-Ecosphere model / instantiation (for debugging).
      Throws:
      IOException - shall not occur
    • testOktoflowJun24

      public void testOktoflowJun24() throws IOException
      Tests the oktoflow model / instantiation (June 24).
      Throws:
      IOException - shall not occur
    • executeIipCase

      protected void executeIipCase(String folder, String modelName, String vilStartRuleName, String... cfgFolder) throws IOException
      Executes an IIP-Ecosphere case.
      Parameters:
      folder - the case folder
      modelName - the name of the model to load and execute (expected files/created files in folder of same name)
      vilStartRuleName - the name of the VIL start rule to execute
      cfgFolder - additional IVML configuration folders, may be null
      Throws:
      IOException - if execution/comparison fails
    • getTracerFactory

      protected net.ssehub.easy.instantiation.core.model.execution.TracerFactory getTracerFactory()
      Description copied from class: AbstractScenarioTest
      Creates the tracer factory.
      Overrides:
      getTracerFactory in class AbstractScenarioTest
      Returns:
      the tracer factory