aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/schema/processing/IndexingOutputsTestCase.java
blob: 687549f920ea68756d72451ed597ed0bddabff86 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.schema.processing;

import com.yahoo.schema.parser.ParseException;
import org.junit.Test;

import java.io.IOException;

import static com.yahoo.schema.processing.AssertSearchBuilder.assertBuildFails;


/**
 * @author Simon Thoresen Hult
 */
public class IndexingOutputsTestCase {

    @Test
    public void requireThatOutputOtherFieldThrows() throws IOException, ParseException {
        assertBuildFails("src/test/examples/indexing_output_other_field.sd",
                         "For schema 'indexing_output_other_field', field 'foo': Indexing expression 'index bar' " +
                         "attempts to write to a field other than 'foo'.");
    }

    @Test
    public void requireThatOutputConflictThrows() throws IOException, ParseException {
        assertBuildFails("src/test/examples/indexing_output_conflict.sd",
                         "For schema 'indexing_output_confict', field 'bar': For expression 'index bar': Attempting " +
                         "to assign conflicting values to field 'bar'.");
    }
}