summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorArne H Juul <arnej@yahooinc.com>2022-06-02 09:47:26 +0000
committergjoranv <gv@verizonmedia.com>2022-06-08 11:45:24 +0200
commit7ac67f70bc53de2030dee9bd2a8de2f2ed375cf0 (patch)
tree61454ad07073cc08d79852a913d77131699a2c60 /document
parent80e74e098f3473e7ce41380f85efc54b174f3e3a (diff)
stop using/testing deprecated API
Diffstat (limited to 'document')
-rw-r--r--document/src/test/java/com/yahoo/document/DocumentTypeManagerTestCase.java2
-rw-r--r--document/src/test/java/com/yahoo/document/serialization/SerializeAnnotationsTestCase.java12
2 files changed, 5 insertions, 9 deletions
diff --git a/document/src/test/java/com/yahoo/document/DocumentTypeManagerTestCase.java b/document/src/test/java/com/yahoo/document/DocumentTypeManagerTestCase.java
index a455fa4818e..e0efb7e572e 100644
--- a/document/src/test/java/com/yahoo/document/DocumentTypeManagerTestCase.java
+++ b/document/src/test/java/com/yahoo/document/DocumentTypeManagerTestCase.java
@@ -154,7 +154,6 @@ public class DocumentTypeManagerTestCase {
assertTrue(foobarfield0.getDataType().getCode() == 2);
Field foobarfield1 = type.getField("foobarfield1");
- assertTrue(foobarfield1.isHeader());
assertTrue(foobarfield1.getDataType().getCode() == 4);
@@ -169,7 +168,6 @@ public class DocumentTypeManagerTestCase {
assertTrue(type.hasField("bananafield0"));
Field bananafield0 = type.getField("bananafield0");
- assertTrue(bananafield0.isHeader());
assertTrue(bananafield0.getDataType().getCode() == 16);
//inheritance:
diff --git a/document/src/test/java/com/yahoo/document/serialization/SerializeAnnotationsTestCase.java b/document/src/test/java/com/yahoo/document/serialization/SerializeAnnotationsTestCase.java
index 9e58e2540a0..315bd1d5bd4 100644
--- a/document/src/test/java/com/yahoo/document/serialization/SerializeAnnotationsTestCase.java
+++ b/document/src/test/java/com/yahoo/document/serialization/SerializeAnnotationsTestCase.java
@@ -1,6 +1,7 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.document.serialization;
+import com.yahoo.document.ArrayDataType;
import com.yahoo.document.DataType;
import com.yahoo.document.DocumentTypeManager;
import com.yahoo.document.DocumentTypeManagerConfigurer;
@@ -89,10 +90,6 @@ public class SerializeAnnotationsTestCase {
SpanList root = new SpanList();
SpanTree tree = new SpanTree("html", root);
- DataType positionType = docMan.getDataType("myposition");
- StructDataType cityDataType =
- (StructDataType) docMan.getDataType("annotation.city");
-
AnnotationTypeRegistry registry = docMan.getAnnotationTypeRegistry();
AnnotationType textType = registry.getType("text");
AnnotationType beginTag = registry.getType("begintag");
@@ -101,9 +98,10 @@ public class SerializeAnnotationsTestCase {
AnnotationType paragraphType = registry.getType("paragraph");
AnnotationType cityType = registry.getType("city");
- AnnotationReferenceDataType annRefType =
- (AnnotationReferenceDataType)
- docMan.getDataType("annotationreference<text>");
+ var cityDataType = (StructDataType) cityType.getDataType();
+ var positionType = (StructDataType) cityDataType.getField("position").getDataType();
+ var refArrT = (ArrayDataType) cityDataType.getField("references").getDataType();
+ var annRefType = (AnnotationReferenceDataType) refArrT.getNestedType();
Struct position = new Struct(positionType);
position.setFieldValue("latitude", new DoubleFieldValue(37.774929));