Search in sources :

Example 1 with LegendSDLCTestCaseCollector

use of org.finos.legend.sdlc.test.junit.LegendSDLCTestCaseCollector in project legend-sdlc by finos.

the class MappingTestCase method collectTestCases.

@LegendSDLCTestCaseCollector(collectorClass = Mapping.class)
public static void collectTestCases(PureModel pureModel, PureModelContextData pureModelContextData, MutableList<PlanTransformer> planTransformers, RichIterable<? extends Root_meta_pure_router_extension_RouterExtension> extensions, String pureVersion, Entity entity, Consumer<? super LegendSDLCTestCase> testCaseConsumer) {
    Mapping mapping = findPackageableElement(pureModelContextData.getElementsOfType(Mapping.class), entity.getPath());
    Optional.ofNullable(mapping.tests).orElse(Collections.emptyList()).stream().map(test -> new MappingTestCase(pureModel, pureModelContextData, mapping, test, planTransformers, extensions, pureVersion)).forEach(testCaseConsumer);
}
Also used : PrintWriter(java.io.PrintWriter) PureModel(org.finos.legend.engine.language.pure.compiler.toPureGraph.PureModel) MappingTestRunner(org.finos.legend.engine.test.runner.mapping.MappingTestRunner) Mapping(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.mapping.Mapping) StringWriter(java.io.StringWriter) MappingTest(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.mapping.mappingTest.MappingTest) TestResult(org.finos.legend.engine.test.runner.shared.TestResult) MutableList(org.eclipse.collections.api.list.MutableList) Root_meta_pure_router_extension_RouterExtension(org.finos.legend.pure.generated.Root_meta_pure_router_extension_RouterExtension) Consumer(java.util.function.Consumer) RichIterable(org.eclipse.collections.api.RichIterable) Connection(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.connection.Connection) PureModelContextData(org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextData) Entity(org.finos.legend.sdlc.domain.model.entity.Entity) LegendSDLCTestCase(org.finos.legend.sdlc.test.junit.LegendSDLCTestCase) LegendSDLCTestCaseCollector(org.finos.legend.sdlc.test.junit.LegendSDLCTestCaseCollector) Optional(java.util.Optional) RichMappingTestResult(org.finos.legend.engine.test.runner.mapping.RichMappingTestResult) Collections(java.util.Collections) PlanTransformer(org.finos.legend.engine.plan.generation.transformers.PlanTransformer) Mapping(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.mapping.Mapping) LegendSDLCTestCaseCollector(org.finos.legend.sdlc.test.junit.LegendSDLCTestCaseCollector)

Aggregations

PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 Collections (java.util.Collections)1 Optional (java.util.Optional)1 Consumer (java.util.function.Consumer)1 RichIterable (org.eclipse.collections.api.RichIterable)1 MutableList (org.eclipse.collections.api.list.MutableList)1 PureModel (org.finos.legend.engine.language.pure.compiler.toPureGraph.PureModel)1 PlanTransformer (org.finos.legend.engine.plan.generation.transformers.PlanTransformer)1 PureModelContextData (org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextData)1 Connection (org.finos.legend.engine.protocol.pure.v1.model.packageableElement.connection.Connection)1 Mapping (org.finos.legend.engine.protocol.pure.v1.model.packageableElement.mapping.Mapping)1 MappingTest (org.finos.legend.engine.protocol.pure.v1.model.packageableElement.mapping.mappingTest.MappingTest)1 MappingTestRunner (org.finos.legend.engine.test.runner.mapping.MappingTestRunner)1 RichMappingTestResult (org.finos.legend.engine.test.runner.mapping.RichMappingTestResult)1 TestResult (org.finos.legend.engine.test.runner.shared.TestResult)1 Root_meta_pure_router_extension_RouterExtension (org.finos.legend.pure.generated.Root_meta_pure_router_extension_RouterExtension)1 Entity (org.finos.legend.sdlc.domain.model.entity.Entity)1 LegendSDLCTestCase (org.finos.legend.sdlc.test.junit.LegendSDLCTestCase)1 LegendSDLCTestCaseCollector (org.finos.legend.sdlc.test.junit.LegendSDLCTestCaseCollector)1