blob: 70f6187be120a09ae872117ef67e31c0efdd3620 (
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
32
33
34
35
36
37
38
39
|
// 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.document.DocumentTypeManager;
import com.yahoo.searchdefinition.ApplicationBuilder;
import org.junit.Test;
import static org.junit.Assert.assertThrows;
/**
* Verifies that a struct in a document type is preferred over another document type
* of the same name.
*
* @author bratseth
*/
public class NameCollisionTestCase extends AbstractExportingTestCase {
@Test
public void testNameCollision() throws Exception {
var ex = assertThrows(IllegalArgumentException.class, () -> {
assertCorrectDeriving("namecollision", "collisionstruct",
new TestProperties().setExperimentalSdParsing(false),
new TestableDeployLogger());
var docman = DocumentTypeManager.fromFile("temp/namecollision/documentmanager.cfg");
});
System.err.println("MSG 1: "+ex.getClass()+" -> "+ex.getMessage());
var ey = assertThrows(IllegalArgumentException.class, () -> {
assertCorrectDeriving("namecollision", "collisionstruct",
new TestProperties().setExperimentalSdParsing(true),
new TestableDeployLogger());
var docman = DocumentTypeManager.fromFile("temp/namecollision/documentmanager.cfg");
});
System.err.println("MSG 2: "+ey.getMessage());
}
}
|