aboutsummaryrefslogtreecommitdiffstats
path: root/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/expressions/UnresolvedFieldValueTestCase.java
blob: 66f0b6a83a0f8219a23a1c516ac48cc2b74b5b0d (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.indexinglanguage.expressions;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

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

    @Test
    public void requireThatDataTypeIsUnresolved() {
        assertEquals(UnresolvedDataType.INSTANCE, new UnresolvedFieldValue().getDataType());
    }

    @Test
    @SuppressWarnings("deprecation")
    public void requireThatNoMethodsAreSupported() {
        UnresolvedFieldValue val = new UnresolvedFieldValue();
        try {
            val.printXml(null);
            fail();
        } catch (UnsupportedOperationException e) {

        }
        try {
            val.clear();
            fail();
        } catch (UnsupportedOperationException e) {

        }
        try {
            val.assign(new UnresolvedFieldValue());
            fail();
        } catch (UnsupportedOperationException e) {

        }
        try {
            val.serialize(null, null);
            fail();
        } catch (UnsupportedOperationException e) {

        }
        try {
            val.deserialize(null, null);
            fail();
        } catch (UnsupportedOperationException e) {

        }
    }
}