Search in sources :

Example 11 with YamlWriter

use of org.eclipse.winery.repository.converter.writer.YamlWriter in project winery by eclipse.

the class YamlWriterTests method testServiceTemplates.

@ParameterizedTest
@ArgumentsSource(ServiceTemplatesProvider.class)
public void testServiceTemplates(YTServiceTemplate template, String expected) {
    YamlWriter writer = new YamlWriter();
    YamlPrinter p = writer.visit(template, new YamlWriter.Parameter(0));
    assertEquals(expected, p.toString());
}
Also used : YamlPrinter(org.eclipse.winery.repository.converter.writer.YamlPrinter) YamlWriter(org.eclipse.winery.repository.converter.writer.YamlWriter) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) ArgumentsSource(org.junit.jupiter.params.provider.ArgumentsSource)

Example 12 with YamlWriter

use of org.eclipse.winery.repository.converter.writer.YamlWriter in project winery by eclipse.

the class YamlWriterTests method testImports.

@ParameterizedTest
@ArgumentsSource(ImportArgumentsProvider.class)
public void testImports(YTImportDefinition importDef, String expected) {
    YamlWriter writer = new YamlWriter();
    YamlPrinter p = writer.visit(importDef, new YamlWriter.Parameter(0).addContext("root"));
    assertEquals(expected, p.toString());
}
Also used : YamlPrinter(org.eclipse.winery.repository.converter.writer.YamlPrinter) YamlWriter(org.eclipse.winery.repository.converter.writer.YamlWriter) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) ArgumentsSource(org.junit.jupiter.params.provider.ArgumentsSource)

Example 13 with YamlWriter

use of org.eclipse.winery.repository.converter.writer.YamlWriter in project winery by eclipse.

the class YamlWriterTests method testPolicyTypeSerialization.

@ParameterizedTest
@ArgumentsSource(PolicyTypeArgumentsProvider.class)
public void testPolicyTypeSerialization(YTServiceTemplate prop, String expected) {
    YamlWriter writer = new YamlWriter();
    YamlPrinter p = writer.visit(prop, new YamlWriter.Parameter(0).addContext("root"));
    assertEquals(expected, p.toString());
}
Also used : YamlPrinter(org.eclipse.winery.repository.converter.writer.YamlPrinter) YamlWriter(org.eclipse.winery.repository.converter.writer.YamlWriter) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) ArgumentsSource(org.junit.jupiter.params.provider.ArgumentsSource)

Example 14 with YamlWriter

use of org.eclipse.winery.repository.converter.writer.YamlWriter in project winery by eclipse.

the class YamlWriterTests method testPropertyFunctionSerialization.

@ParameterizedTest
@ArgumentsSource(PropertyFunctionArgumentsProvider.class)
public void testPropertyFunctionSerialization(YTPropertyAssignment prop, String expected) {
    YamlWriter writer = new YamlWriter();
    YamlPrinter p = writer.visit(prop, new YamlWriter.Parameter(0).addContext("root"));
    assertEquals(expected, p.toString());
}
Also used : YamlPrinter(org.eclipse.winery.repository.converter.writer.YamlPrinter) YamlWriter(org.eclipse.winery.repository.converter.writer.YamlWriter) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) ArgumentsSource(org.junit.jupiter.params.provider.ArgumentsSource)

Aggregations

YamlWriter (org.eclipse.winery.repository.converter.writer.YamlWriter)14 YamlPrinter (org.eclipse.winery.repository.converter.writer.YamlPrinter)7 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)7 ArgumentsSource (org.junit.jupiter.params.provider.ArgumentsSource)7 IOException (java.io.IOException)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)3 JAXBException (javax.xml.bind.JAXBException)3 MultiException (org.eclipse.winery.model.converter.support.exception.MultiException)3 YTServiceTemplate (org.eclipse.winery.model.tosca.yaml.YTServiceTemplate)3 InputStream (java.io.InputStream)2 TDefinitions (org.eclipse.winery.model.tosca.TDefinitions)2 Path (java.nio.file.Path)1 GenericId (org.eclipse.winery.model.ids.GenericId)1 DefinitionsChildId (org.eclipse.winery.model.ids.definitions.DefinitionsChildId)1 YTArtifactDefinition (org.eclipse.winery.model.tosca.yaml.YTArtifactDefinition)1 IRepository (org.eclipse.winery.repository.backend.IRepository)1 GitBasedRepository (org.eclipse.winery.repository.backend.filebased.GitBasedRepository)1 RepositoryFileReference (org.eclipse.winery.repository.common.RepositoryFileReference)1 YamlRepository (org.eclipse.winery.repository.yaml.YamlRepository)1 FromCanonical (org.eclipse.winery.repository.yaml.converter.FromCanonical)1