aboutsummaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorLester Solbakken <lesters@oath.com>2018-12-18 10:37:27 +0100
committerLester Solbakken <lesters@oath.com>2018-12-18 10:37:27 +0100
commit7caa60913e4db267f7d7bdfe0e1de90ec12db13f (patch)
treebbb2e77e81d2823fc7c1048a39a7d38c20edfc44 /config-model
parent305d22637387d183be17a0582b1ced76f2b44982 (diff)
Add url config type
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/InstanceResolverTest.java9
-rw-r--r--config-model/src/test/resources/configdefinitions/function-test.def3
2 files changed, 12 insertions, 0 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/InstanceResolverTest.java b/config-model/src/test/java/com/yahoo/vespa/model/InstanceResolverTest.java
index a9a6621c751..0f58c5e3a2a 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/InstanceResolverTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/InstanceResolverTest.java
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model;
+import com.yahoo.config.UrlReference;
import com.yahoo.test.FunctionTestConfig;
import com.yahoo.test.FunctionTestConfig.*;
import com.yahoo.test.SimpletypesConfig;
@@ -47,6 +48,10 @@ public class InstanceResolverTest {
assertTrue(c.rootStruct().innerArr(0).boolVal());
assertEquals(c.rootStruct().innerArr(0).stringVal(), "deep");
assertEquals(c.myarray(0).intval(), -123424);
+ assertEquals(c.urlVal().toString(), "url");
+ assertEquals(c.urlArr(0).toString(), "url");
+ assertEquals(c.myarray(0).urlVal().toString(), "url1");
+ assertEquals(c.myarray(1).urlVal().toString(), "url2");
}
/**
@@ -88,6 +93,7 @@ public class InstanceResolverTest {
refval(":parent:").
refwithdef(":parent:").
fileVal("etc").
+ urlVal(new UrlReference("url")).
boolarr(false).
longarr(9223372036854775807L).
longarr(-9223372036854775808L).
@@ -97,6 +103,7 @@ public class InstanceResolverTest {
enumarr(Enumarr.VALUES).
refarr(Arrays.asList(":parent:", ":parent", "parent:")). // test collection based setter
fileArr("bin").
+ urlArr(new UrlReference("url")).
basicStruct(new BasicStruct.Builder().
//foo("basicFoo").
@@ -119,6 +126,7 @@ public class InstanceResolverTest {
enumval(Myarray.Enumval.INNER).
refval(":parent:").
fileVal("file0").
+ urlVal(new UrlReference("url1")).
anotherarray(new Myarray.Anotherarray.Builder().
foo(7)).
myStruct(new Myarray.MyStruct.Builder().
@@ -130,6 +138,7 @@ public class InstanceResolverTest {
enumval(Myarray.Enumval.INNER).
refval(":parent:").
fileVal("file1").
+ urlVal(new UrlReference("url2")).
anotherarray(new Myarray.Anotherarray.Builder().
foo(1).
foo(2)).
diff --git a/config-model/src/test/resources/configdefinitions/function-test.def b/config-model/src/test/resources/configdefinitions/function-test.def
index 86a110c3413..4208f7ab906 100644
--- a/config-model/src/test/resources/configdefinitions/function-test.def
+++ b/config-model/src/test/resources/configdefinitions/function-test.def
@@ -40,6 +40,7 @@ onechoice enum { ONLYFOO } default=ONLYFOO
refval reference
refwithdef reference default=":parent:"
fileVal file
+urlVal url
boolarr[] bool
intarr[] int
@@ -49,6 +50,7 @@ stringarr[] string
enumarr[] enum { ARRAY, VALUES }
refarr[] reference
fileArr[] file
+urlArr[] url
# A basic struct
basicStruct.foo string default="basic"
@@ -68,6 +70,7 @@ myarray[].stringval[] string
myarray[].enumval enum { INNER, ENUM, TYPE } default=TYPE
myarray[].refval reference # Value in array without default
myarray[].fileVal file
+myarray[].urlVal url
myarray[].anotherarray[].foo int default=-4
myarray[].myStruct.a int
myarray[].myStruct.b int default=2