blob: 1209da6d64b2977c64b24eea20e01fa65553e0cd (
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
29
30
31
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchdefinition.derived;
import com.yahoo.document.DataType;
import com.yahoo.document.DocumentTypeManager;
import com.yahoo.document.config.DocumentmanagerConfig;
import com.yahoo.searchdefinition.SearchDefinitionTestCase;
import org.junit.Test;
import java.util.List;
import static org.junit.Assert.assertEquals;
/**
* Tests deriving using the Deriver facade
*
* @author bratseth
*/
public class DeriverTestCase extends SearchDefinitionTestCase {
@Test
public void testDeriveDocManager() {
DocumentTypeManager dtm = new DocumentTypeManager(new DocumentmanagerConfig(
Deriver.getDocumentManagerConfig(List.of(
"src/test/derived/deriver/child.sd",
"src/test/derived/deriver/parent.sd",
"src/test/derived/deriver/grandparent.sd"))));
assertEquals(dtm.getDocumentType("child").getField("a").getDataType(), DataType.STRING);
}
}
|