Class ArtifactInfoTest
- java.lang.Object
-
- test.de.iip_ecosphere.platform.services.spring.ArtifactInfoTest
-
public class ArtifactInfoTest extends java.lang.ObjectTests the YAML descriptor implementation and theValidator.- Author:
- Holger Eichelberger, SSE
-
-
Constructor Summary
Constructors Constructor Description ArtifactInfoTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static voidassertEndpoint(de.iip_ecosphere.platform.services.spring.yaml.YamlEndpoint endpoint, int port, java.lang.String host)Asserts properties of anYamlEndpoint.private static voidassertProcess(de.iip_ecosphere.platform.services.spring.yaml.YamlProcess process, java.lang.String artifact, java.lang.String executable, boolean started, int waitTime, java.lang.String... cmdArgs)AssertsYamlProcessinformation.private static voidassertRelation(de.iip_ecosphere.platform.services.spring.yaml.YamlRelation relation, java.lang.String channel, int port, java.lang.String host)Asserts properties of aYamlRelation.private static voidassertServiceBasics(de.iip_ecosphere.platform.services.spring.yaml.YamlService service, java.lang.String id, java.lang.String name, java.lang.String version, java.lang.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(java.util.List<java.lang.String> list, java.lang.String... expected)Asserts a list of strings w.r.t.private static java.lang.Class<?>assertTypedData(de.iip_ecosphere.platform.services.TypedDataConnectorDescriptor desc, java.lang.String id, java.lang.String name, java.lang.String description, java.lang.String type)Asserts properties of a typed connector descriptor.private static java.lang.Class<?>assertTypedData(de.iip_ecosphere.platform.services.TypedDataDescriptor desc, java.lang.String name, java.lang.String description, java.lang.String type)Asserts properties of a typed data descriptor.voidtestFileDescriptorTest()TestsDescriptorTest.voidtestInvalidYaml()Tests a structurally correct but invalid YAML file.voidtestResolution()Tests the class resolution.voidtestYaml()Tests the YAML reader.
-
-
-
Method Detail
-
testYaml
public void testYaml() throws java.io.IOExceptionTests the YAML reader.- Throws:
java.io.IOException- shall not occur
-
testResolution
public void testResolution() throws java.io.IOExceptionTests the class resolution.- Throws:
java.io.IOException- shall not occur
-
assertTypedData
private static java.lang.Class<?> assertTypedData(de.iip_ecosphere.platform.services.TypedDataConnectorDescriptor desc, java.lang.String id, java.lang.String name, java.lang.String description, java.lang.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 java.lang.Class<?> assertTypedData(de.iip_ecosphere.platform.services.TypedDataDescriptor desc, java.lang.String name, java.lang.String description, java.lang.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
public void testInvalidYaml() throws java.io.IOExceptionTests a structurally correct but invalid YAML file.- Throws:
java.io.IOException- shall not occur
-
assertStringList
private static void assertStringList(java.util.List<java.lang.String> list, java.lang.String... expected)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, java.lang.String id, java.lang.String name, java.lang.String version, java.lang.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, java.lang.String channel, int port, java.lang.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, java.lang.String host)Asserts properties of anYamlEndpoint.- Parameters:
port- the port number to be used/substitutedhost- the host name to be used/substitutedendpoint- the endpoint to be asserted
-
assertProcess
private static void assertProcess(de.iip_ecosphere.platform.services.spring.yaml.YamlProcess process, java.lang.String artifact, java.lang.String executable, boolean started, int waitTime, java.lang.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
public void testFileDescriptorTest() throws java.io.IOExceptionTestsDescriptorTest.- Throws:
java.io.IOException- in case that descriptors/files cannot be read
-
-