diff options
Diffstat (limited to 'indexinglanguage')
6 files changed, 21 insertions, 21 deletions
diff --git a/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/DocumentTestCase.java b/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/DocumentTestCase.java index 740645cc895..b74d6226010 100644 --- a/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/DocumentTestCase.java +++ b/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/DocumentTestCase.java @@ -21,7 +21,7 @@ public class DocumentTestCase { docType.addField(new Field("my_str", DataType.getArray(DataType.STRING))); docType.addField(new Field("my_pos", DataType.getArray(PositionDataType.INSTANCE))); - Document doc = new Document(docType, "doc:scheme:"); + Document doc = new Document(docType, "id:scheme:my_input::"); Array<StringFieldValue> arr = new Array<>(DataType.getArray(DataType.STRING)); arr.add(new StringFieldValue("6;9")); doc.setFieldValue("my_str", arr); @@ -51,7 +51,7 @@ public class DocumentTestCase { Expression exp = Expression.fromString("input arr_a . input arr_b | index out"); { - Document doc = new Document(docType, "doc:scheme:"); + Document doc = new Document(docType, "id:scheme:my_input::"); assertNotNull(doc = Expression.execute(exp, doc)); FieldValue val = doc.getFieldValue("out"); assertNotNull(val); @@ -61,7 +61,7 @@ public class DocumentTestCase { assertEquals(0, arr.size()); } { - Document doc = new Document(docType, "doc:scheme:"); + Document doc = new Document(docType, "id:scheme:my_input::"); Array<StringFieldValue> arr = new Array<>(DataType.getArray(DataType.STRING)); arr.add(new StringFieldValue("a1")); doc.setFieldValue("arr_a", arr); @@ -75,7 +75,7 @@ public class DocumentTestCase { assertEquals(1, arr.size()); } { - Document doc = new Document(docType, "doc:scheme:"); + Document doc = new Document(docType, "id:scheme:my_input::"); Array<StringFieldValue> arr = new Array<>(DataType.getArray(DataType.STRING)); arr.add(new StringFieldValue("a1")); arr.add(new StringFieldValue("a2")); @@ -103,7 +103,7 @@ public class DocumentTestCase { Expression exp = Expression.fromString("(input str_a | split ',') . (input str_b | split ',') | index out"); { - Document doc = new Document(docType, "doc:scheme:"); + Document doc = new Document(docType, "id:scheme:my_input::"); assertNotNull(doc = Expression.execute(exp, doc)); FieldValue val = doc.getFieldValue("out"); assertNotNull(val); @@ -113,7 +113,7 @@ public class DocumentTestCase { assertEquals(0, arr.size()); } { - Document doc = new Document(docType, "doc:scheme:"); + Document doc = new Document(docType, "id:scheme:my_input::"); doc.setFieldValue("str_a", new StringFieldValue("a1")); assertNotNull(doc = Expression.execute(exp, doc)); @@ -125,7 +125,7 @@ public class DocumentTestCase { assertEquals(1, arr.size()); } { - Document doc = new Document(docType, "doc:scheme:"); + Document doc = new Document(docType, "id:scheme:my_input::"); doc.setFieldValue("str_a", new StringFieldValue("a1,a2")); doc.setFieldValue("str_b", new StringFieldValue("b1")); diff --git a/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/DocumentUpdateTestCase.java b/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/DocumentUpdateTestCase.java index dc8ffcd8d10..5480e0feca7 100644 --- a/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/DocumentUpdateTestCase.java +++ b/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/DocumentUpdateTestCase.java @@ -27,7 +27,7 @@ public class DocumentUpdateTestCase { docType.addField(new Field("my_str", DataType.getArray(DataType.STRING))); docType.addField(new Field("my_pos", DataType.getArray(PositionDataType.INSTANCE))); - DocumentUpdate docUpdate = new DocumentUpdate(docType, "doc:scheme:"); + DocumentUpdate docUpdate = new DocumentUpdate(docType, "id:scheme:my_input::"); docUpdate.addFieldUpdate(FieldUpdate.createAdd(docType.getField("my_str"), new StringFieldValue("6;9"))); docUpdate = Expression.execute(Expression.fromString("input my_str | for_each { to_pos } | index my_pos"), docUpdate); @@ -57,7 +57,7 @@ public class DocumentUpdateTestCase { public void requireThatCreateIfNonExistentFlagIsPropagated() throws ParseException { DocumentType docType = new DocumentType("my_input"); docType.addField(new Field("my_str", DataType.getArray(DataType.STRING))); - DocumentUpdate upd = new DocumentUpdate(docType, "doc:scheme:"); + DocumentUpdate upd = new DocumentUpdate(docType, "id:scheme:my_input::"); upd.addFieldUpdate(FieldUpdate.createAdd(docType.getField("my_str"), new StringFieldValue("foo"))); upd.setCreateIfNonExistent(true); diff --git a/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/ScriptTestCase.java b/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/ScriptTestCase.java index 58e80b5eb2b..0edf0f645a7 100644 --- a/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/ScriptTestCase.java +++ b/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/ScriptTestCase.java @@ -28,7 +28,7 @@ public class ScriptTestCase { @Test public void requireThatScriptExecutesStatements() { - Document input = new Document(type, "doc:scheme:"); + Document input = new Document(type, "id:scheme:mytype::"); input.setFieldValue("in-1", new StringFieldValue("6")); input.setFieldValue("in-2", new StringFieldValue("9")); @@ -43,7 +43,7 @@ public class ScriptTestCase { @Test public void requireThatEachStatementHasEmptyInput() { - Document input = new Document(type, "doc:scheme:"); + Document input = new Document(type, "id:scheme:mytype::"); input.setFieldValue(input.getField("in-1"), new StringFieldValue("69")); Expression exp = new ScriptExpression( @@ -60,7 +60,7 @@ public class ScriptTestCase { @Test public void requireThatFactoryMethodWorks() throws ParseException { - Document input = new Document(type, "doc:scheme:"); + Document input = new Document(type, "id:scheme:mytype::"); input.setFieldValue("in-1", new StringFieldValue("FOO")); Document output = Expression.execute(Expression.fromString("input 'in-1' | { index 'out-1'; lowercase | index 'out-2' }"), input); @@ -71,7 +71,7 @@ public class ScriptTestCase { @Test public void requireThatIfExpressionPassesOriginalInputAlong() throws ParseException { - Document input = new Document(type, "doc:scheme:"); + Document input = new Document(type, "id:scheme:mytype::"); Document output = Expression.execute(Expression.fromString("'foo' | if (1 < 2) { 'bar' | index 'out-1' } else { 'baz' | index 'out-1' } | index 'out-1'"), input); assertNotNull(output); assertEquals(new StringFieldValue("foo"), output.getFieldValue("out-1")); diff --git a/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/SimpleDocumentAdapterTestCase.java b/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/SimpleDocumentAdapterTestCase.java index d32c69a6340..77e81416d4e 100644 --- a/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/SimpleDocumentAdapterTestCase.java +++ b/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/SimpleDocumentAdapterTestCase.java @@ -28,7 +28,7 @@ public class SimpleDocumentAdapterTestCase { DocumentType docType = new DocumentType("my_doc"); docType.addField("foo", fooType); - Document doc = new Document(docType, "doc:scheme:"); + Document doc = new Document(docType, "id:scheme:my_doc::"); doc.setFieldValue("foo", foo); DocumentAdapter adapter = new SimpleDocumentAdapter(doc); @@ -41,7 +41,7 @@ public class SimpleDocumentAdapterTestCase { @Test public void requireThatUnknownFieldsReturnNull() { DocumentType docType = new DocumentType("my_doc"); - Document doc = new Document(docType, "doc:scheme:"); + Document doc = new Document(docType, "id:scheme:my_doc::"); DocumentAdapter adapter = new SimpleDocumentAdapter(doc); try { diff --git a/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/expressions/GetFieldTestCase.java b/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/expressions/GetFieldTestCase.java index af1a58a1de6..1ceacf3a9cb 100644 --- a/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/expressions/GetFieldTestCase.java +++ b/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/expressions/GetFieldTestCase.java @@ -55,7 +55,7 @@ public class GetFieldTestCase { DocumentType docType = new DocumentType("my_doc"); docType.addField("foo", fooType); - Document doc = new Document(docType, "doc:scheme:"); + Document doc = new Document(docType, "id:scheme:my_doc::"); doc.setFieldValue("foo", foo); ExecutionContext ctx = new ExecutionContext(new SimpleDocumentAdapter(doc)); diff --git a/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/expressions/GuardTestCase.java b/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/expressions/GuardTestCase.java index 63a2cc66a97..f5864fe054d 100644 --- a/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/expressions/GuardTestCase.java +++ b/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/expressions/GuardTestCase.java @@ -56,7 +56,7 @@ public class GuardTestCase { docType.addField(new Field("my_lng", DataType.LONG)); docType.addField(new Field("my_str", DataType.STRING)); - Document doc = new Document(docType, "doc:scheme:"); + Document doc = new Document(docType, "id:scheme:my_input::"); doc.setFieldValue("my_str", new StringFieldValue("69")); assertNotNull(doc = Expression.execute(Expression.fromString("guard { input my_str | to_int | attribute my_lng }"), doc)); assertEquals(new LongFieldValue(69), doc.getFieldValue("my_lng")); @@ -68,7 +68,7 @@ public class GuardTestCase { docType.addField(new Field("my_lng", DataType.LONG)); docType.addField(new Field("my_str", DataType.STRING)); - DocumentUpdate docUpdate = new DocumentUpdate(docType, "doc:scheme:"); + DocumentUpdate docUpdate = new DocumentUpdate(docType, "id:scheme:my_input::"); docUpdate.addFieldUpdate(FieldUpdate.createAssign(docType.getField("my_str"), new StringFieldValue("69"))); assertNotNull(docUpdate = Expression.execute(Expression.fromString("guard { input my_str | to_int | attribute my_lng }"), docUpdate)); @@ -92,7 +92,7 @@ public class GuardTestCase { docType.addField(new Field("my_lng", DataType.LONG)); docType.addField(new Field("my_str", DataType.STRING)); - Document doc = new Document(docType, "doc:scheme:"); + Document doc = new Document(docType, "id:scheme:my_input::"); doc.setFieldValue("my_str", new StringFieldValue("foo")); assertNotNull(doc = Expression.execute(Expression.fromString("guard { now | attribute my_lng }"), doc)); assertTrue(doc.getFieldValue("my_lng") instanceof LongFieldValue); @@ -104,7 +104,7 @@ public class GuardTestCase { docType.addField(new Field("my_int", DataType.INT)); docType.addField(new Field("my_str", DataType.STRING)); - DocumentUpdate docUpdate = new DocumentUpdate(docType, "doc:scheme:"); + DocumentUpdate docUpdate = new DocumentUpdate(docType, "id:scheme:my_input::"); docUpdate.addFieldUpdate(FieldUpdate.createAssign(docType.getField("my_str"), new StringFieldValue("foo"))); assertNull(Expression.execute(Expression.fromString("guard { now | attribute my_int }"), docUpdate)); } @@ -113,7 +113,7 @@ public class GuardTestCase { public void requireThatLanguageCanBeSetByUpdate() throws ParseException { DocumentType docType = new DocumentType("my_input"); docType.addField(new Field("my_str", DataType.STRING)); - DocumentUpdate docUpdate = new DocumentUpdate(docType, "doc:scheme:"); + DocumentUpdate docUpdate = new DocumentUpdate(docType, "id:scheme:my_input::"); docUpdate.addFieldUpdate(FieldUpdate.createAssign(docType.getField("my_str"), new StringFieldValue("foo"))); SimpleAdapterFactory factory = new SimpleAdapterFactory(); |