use of org.finos.legend.sdlc.server.project.extension.VoidProjectStructureExtensionProvider in project legend-sdlc by finos.
the class TestProjectStructureConfiguration method testExtensionProvider.
@Test
public void testExtensionProvider() throws IOException {
assertConfig("{\"extensionProvider\":null}", Collections.emptySet(), null, Collections.emptyList(), null);
assertConfig("{\"extensionProvider\":{\"org.finos.legend.sdlc.server.project.extension.VoidProjectStructureExtensionProvider\":{}}}", Collections.emptySet(), new VoidProjectStructureExtensionProvider(), Collections.emptyList(), null);
assertConfig("{\"extensionProvider\":{\"org.finos.legend.sdlc.server.project.extension.DefaultProjectStructureExtensionProvider\":{}}}", Collections.emptySet(), DefaultProjectStructureExtensionProvider.fromExtensions(), Collections.emptyList(), null);
assertConfig("{\"extensionProvider\":{\"org.finos.legend.sdlc.server.project.extension.DefaultProjectStructureExtensionProvider\":{\"extensions\":[{\"org.finos.legend.sdlc.server.project.extension.DefaultProjectStructureExtension\":{\"projectStructureVersion\": 0, \"extensionVersion\": 1, \"files\":{\"PANGRAM.TXT\":{\"content\":\"THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG\"}}}}, {\"org.finos.legend.sdlc.server.project.extension.DefaultProjectStructureExtension\":{\"projectStructureVersion\": 0, \"extensionVersion\": 2, \"files\":{\"pangram.txt\":{\"content\":\"the quick brown fox jumped over the lazy dog\"}}}}]}}}", Collections.emptySet(), DefaultProjectStructureExtensionProvider.fromExtensions(DefaultProjectStructureExtension.newProjectStructureExtension(0, 1, Collections.singletonMap("/PANGRAM.TXT", "THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG")), DefaultProjectStructureExtension.newProjectStructureExtension(0, 2, Collections.singletonMap("/pangram.txt", "the quick brown fox jumped over the lazy dog"))), Collections.emptyList(), null);
}
use of org.finos.legend.sdlc.server.project.extension.VoidProjectStructureExtensionProvider in project legend-sdlc by finos.
the class TestProjectStructureConfiguration method testExtensionProviderAndExtensions.
@Test
public void testExtensionProviderAndExtensions() throws IOException {
assertConfig("{\"extensionProvider\":{\"org.finos.legend.sdlc.server.project.extension.VoidProjectStructureExtensionProvider\":{}}, \"extensions\":null}", Collections.emptySet(), new VoidProjectStructureExtensionProvider(), Collections.emptyList(), null);
assertConfig("{\"extensionProvider\":{\"org.finos.legend.sdlc.server.project.extension.VoidProjectStructureExtensionProvider\":{}}, \"extensions\":[]}", Collections.emptySet(), new VoidProjectStructureExtensionProvider(), Collections.emptyList(), null);
assertDoesNotParse("{\"extensionProvider\":{\"org.finos.legend.sdlc.server.project.extension.VoidProjectStructureExtensionProvider\":{}}, \"extensions\":[{\"org.finos.legend.sdlc.server.project.extension.DefaultProjectStructureExtension\":{\"projectStructureVersion\": 0, \"extensionVersion\": 1, \"files\":{\"PANGRAM.TXT\":{\"content\":\"THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG\"}}}}, {\"org.finos.legend.sdlc.server.project.extension.DefaultProjectStructureExtension\":{\"projectStructureVersion\": 0, \"extensionVersion\": 2, \"files\":{\"pangram.txt\":{\"content\":\"the quick brown fox jumped over the lazy dog\"}}}}]}", "May not specify both extensionProvider and extensions");
}
use of org.finos.legend.sdlc.server.project.extension.VoidProjectStructureExtensionProvider in project legend-sdlc by finos.
the class AbstractBaseModule method resolveProjectStructureExtensionProvider.
private ProjectStructureExtensionProvider resolveProjectStructureExtensionProvider() {
ProjectStructureConfiguration projectStructureConfiguration = getConfiguration().getProjectStructureConfiguration();
if (projectStructureConfiguration != null) {
ProjectStructureExtensionProvider configuredProvider = projectStructureConfiguration.getProjectStructureExtensionProvider();
if (configuredProvider != null) {
return configuredProvider;
}
List<ProjectStructureExtension> extensions = projectStructureConfiguration.getProjectStructureExtensions();
if ((extensions != null) && !extensions.isEmpty()) {
return DefaultProjectStructureExtensionProvider.fromExtensions(extensions);
}
}
return new VoidProjectStructureExtensionProvider();
}
Aggregations