Class ArtifactInfoTest
java.lang.Object
test.de.iip_ecosphere.platform.services.spring.AbstractTest
test.de.iip_ecosphere.platform.services.spring.ArtifactInfoTest
Tests the YAML descriptor implementation and the
Validator.- Author:
- Holger Eichelberger, SSE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidassertEndpoint(de.iip_ecosphere.platform.services.spring.yaml.YamlEndpoint endpoint, int port, String host) Asserts properties of anYamlEndpoint.private static voidassertProcess(de.iip_ecosphere.platform.services.spring.yaml.YamlProcess process, String artifact, String executable, boolean started, int waitTime, String... cmdArgs) AssertsYamlProcessinformation.private static voidassertRelation(de.iip_ecosphere.platform.services.spring.yaml.YamlRelation relation, String channel, int port, String host) Asserts properties of aYamlRelation.private static voidassertServiceBasics(de.iip_ecosphere.platform.services.spring.yaml.YamlService service, String id, String name, String version, String descr) Asserts basic properties of aYamlService.private static voidassertServiceCharacteristics(de.iip_ecosphere.platform.services.spring.yaml.YamlService service, boolean deployable, de.iip_ecosphere.platform.services.environment.ServiceKind kind) Asserts additional characteristics of aYamlService.private static voidassertStringList(List<String> list, String... expected) Asserts a list of strings w.r.t.private static Class<?> assertTypedData(de.iip_ecosphere.platform.services.TypedDataConnectorDescriptor desc, String id, String name, String description, String type) Asserts properties of a typed connector descriptor.private static Class<?> assertTypedData(de.iip_ecosphere.platform.services.TypedDataDescriptor desc, String name, String description, String type) Asserts properties of a typed data descriptor.voidTestsDescriptorTest.voidTests a structurally correct but invalid YAML file.voidTests the class resolution.voidtestYaml()Tests the YAML reader.
-
Constructor Details
-
ArtifactInfoTest
public ArtifactInfoTest()
-
-
Method Details
-
testYaml
Tests the YAML reader.- Throws:
IOException- shall not occur
-
testResolution
Tests the class resolution.- Throws:
IOException- shall not occur
-
assertTypedData
private static Class<?> assertTypedData(de.iip_ecosphere.platform.services.TypedDataConnectorDescriptor desc, String id, String name, String description, String type) Asserts properties of a typed connector descriptor.- Parameters:
desc- the connector descriptorid- the identifier of the descriptor (not tested if null)name- the name of the parameterdescription- the descriptiontype- the type (not tested if null)- Returns:
- the type of the typed data as class (may be null, but not if
typewas given and asserted)
-
assertTypedData
private static Class<?> assertTypedData(de.iip_ecosphere.platform.services.TypedDataDescriptor desc, String name, String description, String type) Asserts properties of a typed data descriptor.- Parameters:
desc- the data descriptorname- the name of the parameterdescription- the descriptiontype- the type (not tested if null)- Returns:
- the type of the typed data as class (may be null, but not if
typewas given and asserted)
-
testInvalidYaml
Tests a structurally correct but invalid YAML file.- Throws:
IOException- shall not occur
-
assertStringList
Asserts a list of strings w.r.t. theexpectedvalues.- Parameters:
list- the listexpected- the expected values
-
assertServiceBasics
private static void assertServiceBasics(de.iip_ecosphere.platform.services.spring.yaml.YamlService service, String id, String name, String version, String descr) Asserts basic properties of aYamlService.- Parameters:
service- the service instance to be assertedid- the expected service idname- the expected service nameversion- the expected service versiondescr- the expected description
-
assertServiceCharacteristics
private static void assertServiceCharacteristics(de.iip_ecosphere.platform.services.spring.yaml.YamlService service, boolean deployable, de.iip_ecosphere.platform.services.environment.ServiceKind kind) Asserts additional characteristics of aYamlService.- Parameters:
service- the service instance to be asserteddeployable- whether it is expected that the service is deployablekind- the expected service kind
-
assertRelation
private static void assertRelation(de.iip_ecosphere.platform.services.spring.yaml.YamlRelation relation, String channel, int port, String host) Asserts properties of aYamlRelation.- Parameters:
relation- the relation to be assertedchannel- the expected channel name/idport- the port number to be used/substitutedhost- the host name to be used/substituted
-
assertEndpoint
private static void assertEndpoint(de.iip_ecosphere.platform.services.spring.yaml.YamlEndpoint endpoint, int port, String host) Asserts properties of anYamlEndpoint.- Parameters:
endpoint- the endpoint to be assertedport- the port number to be used/substitutedhost- the host name to be used/substituted
-
assertProcess
private static void assertProcess(de.iip_ecosphere.platform.services.spring.yaml.YamlProcess process, String artifact, String executable, boolean started, int waitTime, String... cmdArgs) AssertsYamlProcessinformation.- Parameters:
process- the process to assertartifact- the expected artifactexecutable- the expected executablestarted- whether the process is marked as already startedwaitTime- the expected wait timecmdArgs- the expected command line arguments
-
testFileDescriptorTest
TestsDescriptorTest.- Throws:
IOException- in case that descriptors/files cannot be read
-