aboutsummaryrefslogtreecommitdiffstats
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
parent80e74e098f3473e7ce41380f85efc54b174f3e3a (diff)
stop using/testing deprecated API
-rw-r--r--config-model/src/test/java/com/yahoo/schema/SchemaImporterTestCase.java4
-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
-rw-r--r--vespa_feed_perf/src/test/java/com/yahoo/vespa/feed/perf/SimpleServer.java3
4 files changed, 6 insertions, 15 deletions
diff --git a/config-model/src/test/java/com/yahoo/schema/SchemaImporterTestCase.java b/config-model/src/test/java/com/yahoo/schema/SchemaImporterTestCase.java
index 5fcd8d4baa2..929c407215a 100644
--- a/config-model/src/test/java/com/yahoo/schema/SchemaImporterTestCase.java
+++ b/config-model/src/test/java/com/yahoo/schema/SchemaImporterTestCase.java
@@ -67,7 +67,6 @@ public class SchemaImporterTestCase extends AbstractSchemaTestCase {
assertEquals(0, field.getAttributes().size());
assertNull(field.getStemming());
assertTrue(field.getNormalizing().doRemoveAccents());
- assertTrue(field.isHeader());
// Second field
field = (SDField) document.getField("description");
@@ -107,13 +106,11 @@ public class SchemaImporterTestCase extends AbstractSchemaTestCase {
field = schema.getConcreteField("categories");
assertEquals("{ input categories_src | lowercase | normalize | tokenize normalize stem:\"BEST\" | index categories; }",
field.getIndexingScript().toString());
- assertTrue(field.isHeader());
// Eight field
field= schema.getConcreteField("categoriesagain");
assertEquals("{ input categoriesagain_src | lowercase | normalize | tokenize normalize stem:\"BEST\" | index categoriesagain; }",
field.getIndexingScript().toString());
- assertTrue(field.isHeader());
// Ninth field
field= schema.getConcreteField("exactemento");
@@ -128,7 +125,6 @@ public class SchemaImporterTestCase extends AbstractSchemaTestCase {
assertEquals("category_arr", attribute.getName());
assertEquals(Attribute.Type.STRING, attribute.getType());
assertEquals(Attribute.CollectionType.ARRAY, attribute.getCollectionType());
- assertTrue(field.isHeader());
// Eleventh field
field = schema.getConcreteField("measurement_arr");
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));
diff --git a/vespa_feed_perf/src/test/java/com/yahoo/vespa/feed/perf/SimpleServer.java b/vespa_feed_perf/src/test/java/com/yahoo/vespa/feed/perf/SimpleServer.java
index 10184b35e4c..ea47a58e4b7 100644
--- a/vespa_feed_perf/src/test/java/com/yahoo/vespa/feed/perf/SimpleServer.java
+++ b/vespa_feed_perf/src/test/java/com/yahoo/vespa/feed/perf/SimpleServer.java
@@ -31,8 +31,7 @@ public class SimpleServer {
@SuppressWarnings("deprecation")
public SimpleServer(String configDir, MessageHandler msgHandler) throws IOException, ListenFailedException {
slobrok = new Slobrok();
- documentMgr = new DocumentTypeManager();
- documentMgr.configure("dir:" + configDir);
+ documentMgr = DocumentTypeManager.fromFile(configDir + "/documentmanager.cfg");
mbus = new MessageBus(new RPCNetwork(new RPCNetworkParams()
.setSlobrokConfigId(slobrok.configId())
.setIdentity(new Identity("server"))),