blob: 80ebcb825f4d9ff5b95e8b9526b7086b47b52643 (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.schema.derived;
import com.yahoo.schema.Schema;
import com.yahoo.schema.ApplicationBuilder;
import com.yahoo.schema.AbstractSchemaTestCase;
import com.yahoo.schema.parser.ParseException;
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
/**
* Correct casing for derived attributes
*
* @author vegardh
*/
public class CasingTestCase extends AbstractSchemaTestCase {
@Test
public void testCasing() throws IOException, ParseException {
Schema schema = ApplicationBuilder.buildFromFile("src/test/examples/casing.sd");
assertEquals(schema.getIndex("color").getName(), "color");
assertEquals(schema.getIndex("Foo").getName(), "Foo");
assertEquals(schema.getIndex("Price").getName(), "Price");
assertEquals(schema.getAttribute("artist").getName(), "artist");
assertEquals(schema.getAttribute("Drummer").getName(), "Drummer");
assertEquals(schema.getAttribute("guitarist").getName(), "guitarist");
assertEquals(schema.getAttribute("title").getName(), "title");
assertEquals(schema.getAttribute("Trumpetist").getName(), "Trumpetist");
assertEquals(schema.getAttribute("Saxophonist").getName(), "Saxophonist");
assertEquals(schema.getAttribute("TenorSaxophonist").getName(), "TenorSaxophonist");
assertEquals(schema.getAttribute("Flutist").getName(), "Flutist");
}
}
|