Class AbstractIvmlTests
java.lang.Object
test.de.iip_ecosphere.platform.configuration.AbstractIvmlTests
- Direct Known Subclasses:
AbstractIvmlSerializerConfigTests,IvmlApiTests,IvmlContainerLxcTests,IvmlContainerTests,IvmlKodexMeshTests,IvmlMetaModelTests,IvmlRoutingTestTests,IvmlSimpleMesh3Tests,IvmlSimpleMeshTests
Base class for IVML model tests.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classReusable test configuration/setup. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static final voidassertAllFiles(File folder) Generically asserts all files infolderand recursively in contained folders.private voidassertDatatype(File typeFolder, File serFolder, String name, String extension) Tests for the existence of all files related to a Data Type.protected voidassertDeploymentYaml(File base, String name) Asserts the structure of a deployment Yaml file (from service.environment perspective).protected voidassertEcsRuntime(File gen) Asserts file and contents of the ECS runtime component.private static FileassertFile(File file) Asserts that the specified file exists and has contents.protected static FileassertFile(File base, String name) Asserts that the specified file exists and has contents.protected static voidassertFileContains(File base, String name, String... search) Asserts that the specified file exists, has contents and contains the specifiedsearchstring(s).protected voidassertJavaDatatype(File folder, String name) Tests for the existence of all files related to a Java Data Type.protected voidassertJavaInterface(File folder, String name, boolean old, boolean connector) Tests for the existence of all files related to a Java Service Mesh Node.protected voidassertJavaNode(File folder, String name, boolean connector) Tests for the existence of all files related to a Java Service Mesh Node.protected static de.iip_ecosphere.platform.configuration.ConfigurationLifecycleDescriptorAsserts and returns an instance of the configuration lifecycle descriptor.protected voidassertPlatform(File gen) Asserts file and contents of the platform (server) component.protected voidassertPythonDatatype(File folder, String name) Tests for the existence of all files related to a Python Data Type.protected voidassertPythonDatatypeImpl(File folder, String name) Tests for the existence of all files related to a Python Data Type implementation.protected voidassertServiceManager(File gen) Asserts file and contents of the service manager component.protected static FileassertTemplateZip(File gen, String name) Asserts the eclipse template ZIP file, usually indicating the the template generation was executed successfully.protected voidextractPythonServiceEnv(File srcMainPython) Extracts the python service environment implementation (via Maven and main project).static de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurergenApi(de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurer cfg) Helper method to configure for partial instantiation, i.e., generated platform APIs only.static de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurergenApps(de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurer cfg) Helper method to configure for partial instantiation, i.e., apps only and no platform components.static de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurergenAppsNoDeps(de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurer cfg) Helper method to configure for partial instantiation, i.e., apps without dependencies and no platform components.protected static booleanReturns whether a simplified build due to the first (CI) build shall be performed.protected voidpythonSourceCodeCheck(File srcMainPython, String pyFile) Checks a python source code file (in packages with folders).protected static FilerelocateTestModel(File file) Returnsfilerelocated intotestModelBaseif not null.static voidsetTestMetaModelFolder(File folder) Sets the#metaModelFolder.static voidsetTestModelBase(File base) Sets#testModelBase.static de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurersetTracing(de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurer cfg, String level) Helper method to set the tracing level.
-
Field Details
-
TEST_BASE_FOLDER
-
MODEL_BASE_FOLDER
-
ASSERT_FILE_EXTENSIONS
-
ASSERT_FILE_NAME_EXCLUSIONS
-
isIipBuildInitial
-
testModelBase
-
testMetaModelFolder
-
-
Constructor Details
-
AbstractIvmlTests
public AbstractIvmlTests()
-
-
Method Details
-
relocateTestModel
Returnsfilerelocated intotestModelBaseif not null.- Parameters:
file- the file to relocate- Returns:
fileor file relocated intotestModelBase.
-
setTestModelBase
Sets#testModelBase.- Parameters:
base- the base folder, may be null for none- See Also:
-
setTestMetaModelFolder
Sets the#metaModelFolder.- Parameters:
folder- the meta model folder, may be null for "./src/main/easy"
-
isIipBuildInitial
protected static boolean isIipBuildInitial()Returns whether a simplified build due to the first (CI) build shall be performed. Depends on JVM/system propertyiip.build.initial.- Returns:
truefor initial build,falseelse
-
assertLifecycleDescriptor
protected static de.iip_ecosphere.platform.configuration.ConfigurationLifecycleDescriptor assertLifecycleDescriptor()Asserts and returns an instance of the configuration lifecycle descriptor.- Returns:
- the configuration lifecycle descriptor instance
-
extractPythonServiceEnv
Extracts the python service environment implementation (via Maven and main project). Required forpythonSourceCodeCheck(File, String).- Parameters:
srcMainPython- the target folder where to extract the service environment to- Throws:
IOException- if the service environment archive cannot be extracted
-
pythonSourceCodeCheck
Checks a python source code file (in packages with folders).- Parameters:
srcMainPython- the main (parent) source folder for python filespyFile- the python file to check (packages as folders)- Throws:
IOException- in case that expected files cannot be found or inspected
-
assertDeploymentYaml
Asserts the structure of a deployment Yaml file (from service.environment perspective). Disabled ifisIipBuildInitial().- Parameters:
base- the base foldername- the name/path to the file
-
assertJavaInterface
Tests for the existence of all files related to a Java Service Mesh Node.- Parameters:
folder- the basic source folder including base packagename- the name of the service (as identifier)old- old (separated) or new shared interface styleconnector- whether the node is a connector
-
assertJavaNode
Tests for the existence of all files related to a Java Service Mesh Node.- Parameters:
folder- the basic source folder including base packagename- the name of the service (as identifier)connector- whether the node is a connector
-
assertJavaDatatype
Tests for the existence of all files related to a Java Data Type.- Parameters:
folder- the basic source folder including base packagename- the name of the datatype (as identifier)
-
assertPythonDatatypeImpl
Tests for the existence of all files related to a Python Data Type implementation.- Parameters:
folder- the basic source foldername- the name of the datatype (as identifier)
-
assertPythonDatatype
Tests for the existence of all files related to a Python Data Type.- Parameters:
folder- the basic source foldername- the name of the datatype (as identifier)
-
assertDatatype
Tests for the existence of all files related to a Data Type.- Parameters:
typeFolder- the folder containing the datatypesserFolder- the folder containing the datatypes serializers (may betypeFolder, ignored if null)name- the name of the datatype (as identifier)extension- the file name extension
-
assertEcsRuntime
Asserts file and contents of the ECS runtime component.- Parameters:
gen- the generation base folder- Throws:
IOException- in case that expected files cannot be found or inspected
-
assertServiceManager
Asserts file and contents of the service manager component.- Parameters:
gen- the generation base folder- Throws:
IOException- in case that expected files cannot be found or inspected
-
assertPlatform
Asserts file and contents of the platform (server) component.- Parameters:
gen- the generation base folder- Throws:
IOException- in case that expected files cannot be found or inspected
-
assertFile
Asserts that the specified file exists and has contents.- Parameters:
base- the base foldername- the name/path to the file- Returns:
- the actual asserted file (
base+name)
-
assertTemplateZip
Asserts the eclipse template ZIP file, usually indicating the the template generation was executed successfully. This assert is disabled ifisIipBuildInitial().- Parameters:
gen- the gen foldername- the name of the project- Returns:
- the actual asserted file
-
assertFile
Asserts that the specified file exists and has contents. This assert is disabled ifisIipBuildInitial().- Parameters:
file- the file- Returns:
file
-
assertAllFiles
Generically asserts all files infolderand recursively in contained folders.- Parameters:
folder- the folder to asserts the files within
-
assertFileContains
protected static void assertFileContains(File base, String name, String... search) throws IOException Asserts that the specified file exists, has contents and contains the specifiedsearchstring(s). Is disabled whenisIipBuildInitial().- Parameters:
base- the base foldername- the name/path to the filesearch- the content/search strings to assert- Throws:
IOException- if the file cannot be read
-
genApi
public static de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurer genApi(de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurer cfg) Helper method to configure for partial instantiation, i.e., generated platform APIs only.- Parameters:
cfg- the configurer instance- Returns:
cfg
-
genApps
public static de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurer genApps(de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurer cfg) Helper method to configure for partial instantiation, i.e., apps only and no platform components.- Parameters:
cfg- the configurer instance- Returns:
cfg
-
genAppsNoDeps
public static de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurer genAppsNoDeps(de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurer cfg) Helper method to configure for partial instantiation, i.e., apps without dependencies and no platform components.- Parameters:
cfg- the configurer instance- Returns:
cfg
-
setTracing
public static de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurer setTracing(de.iip_ecosphere.platform.configuration.PlatformInstantiator.InstantiationConfigurer cfg, String level) Helper method to set the tracing level.- Parameters:
cfg- the configurer instancelevel- ALL|FUNC|TOP- Returns:
cfg
-