summaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/searchdefinition/derived/MultiStructTestCase.java
blob: fd7cdb9c95c297d7056f9809c1049529d756f986 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchdefinition.derived;

import com.yahoo.config.model.deploy.TestProperties;
import com.yahoo.config.model.application.provider.MockFileRegistry;
import com.yahoo.searchdefinition.derived.TestableDeployLogger;
import com.yahoo.searchdefinition.ApplicationBuilder;
import org.junit.Test;

/**
 * Tests deriving a configuration with structs in multiple .sd files
 *
 * @author arnej
 */
public class MultiStructTestCase extends AbstractExportingTestCase {

    @Test
    public void testDocTypeConfigs() throws Exception {
        var logger = new TestableDeployLogger();
        var props = new TestProperties().setExperimentalSdParsing(false);
        ApplicationBuilder builder = ApplicationBuilder.createFromDirectory
            ("src/test/derived/multi_struct/", new MockFileRegistry(), logger, props);
        derive("multi_struct", builder, builder.getSchema("shop"));
        assertCorrectConfigFiles("multi_struct");
    }

}