summaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com
diff options
context:
space:
mode:
authorArne H Juul <arnej@yahooinc.com>2022-03-16 09:29:27 +0000
committerArne H Juul <arnej@yahooinc.com>2022-03-16 09:29:52 +0000
commitfb88b3e3de250a62dfcee3a444b62c745866331f (patch)
tree5854575935d36fb1557a954a8bdceb7137c6cdd9 /config-model/src/test/java/com
parentd109d256d805f2835788b1bf4e3cf1bd020c719d (diff)
check some more details for sanity
Diffstat (limited to 'config-model/src/test/java/com')
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/AnnotationReferenceTestCase.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/AnnotationReferenceTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/AnnotationReferenceTestCase.java
index ea89e805ed2..f3c15937d24 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/AnnotationReferenceTestCase.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/AnnotationReferenceTestCase.java
@@ -2,6 +2,7 @@
package com.yahoo.searchdefinition;
import com.yahoo.document.DataType;
+import com.yahoo.document.StructDataType;
import com.yahoo.document.Field;
import com.yahoo.document.annotation.AnnotationReferenceDataType;
import com.yahoo.searchdefinition.Schema;
@@ -12,6 +13,7 @@ import org.junit.Test;
import static com.yahoo.config.model.test.TestUtil.joinLines;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
/**
* @author arnej
@@ -44,7 +46,17 @@ public class AnnotationReferenceTestCase {
var builder = new ApplicationBuilder(new TestProperties().setExperimentalSdParsing(true));
builder.addSchema(sd);
builder.build(true);
- checkForAnnRef(builder.getSchema().getDocument());
+ var doc = builder.getSchema().getDocument();
+ checkForAnnRef(doc);
+ var complex = doc.findAnnotation("complex");
+ System.err.println("annotation: "+complex);
+ var dt = complex.getDataType();
+ System.err.println("associated datatype: "+dt);
+ assertTrue(dt instanceof StructDataType);
+ var struct = (StructDataType)dt;
+ var field = struct.getField("owner");
+ System.err.println("owner field: "+field);
+ assertTrue(field.getDataType() instanceof AnnotationReferenceDataType);
}
void checkForAnnRef(SDDocumentType doc) {