summaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/search/query/profile/types/test/FieldTypeTestCase.java
blob: ae1e39e52d01d60dc661b3f0d428871ea4f9f2b0 (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
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.query.profile.types.test;

import com.yahoo.search.query.profile.types.FieldType;
import com.yahoo.search.query.profile.types.QueryProfileType;
import com.yahoo.search.query.profile.types.QueryProfileTypeRegistry;

/**
 * @author bratseth
 */
public class FieldTypeTestCase extends junit.framework.TestCase {

    public void testConvertToFromString() {
        QueryProfileTypeRegistry registry=new QueryProfileTypeRegistry();
        registry.register(new QueryProfileType("foo"));

        assertEquals("string", FieldType.fromString("string",registry).stringValue());
        assertEquals("boolean", FieldType.fromString("boolean",registry).stringValue());
        assertEquals("query-profile", FieldType.fromString("query-profile",registry).stringValue());
        assertEquals("query-profile:foo", FieldType.fromString("query-profile:foo",registry).stringValue());
    }

}