summaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/searchdefinition/derived/AnnotationsTestCase.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/test/java/com/yahoo/searchdefinition/derived/AnnotationsTestCase.java')
-rwxr-xr-xconfig-model/src/test/java/com/yahoo/searchdefinition/derived/AnnotationsTestCase.java42
1 files changed, 31 insertions, 11 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/AnnotationsTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/AnnotationsTestCase.java
index b9f471f4cc7..65d6c15d3e2 100755
--- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/AnnotationsTestCase.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/AnnotationsTestCase.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.searchdefinition.derived;
+import com.yahoo.config.model.deploy.TestProperties;
import com.yahoo.searchdefinition.parser.ParseException;
import org.junit.Test;
@@ -13,55 +14,74 @@ public class AnnotationsTestCase extends AbstractExportingTestCase {
@Test
public void requireThatStructRegistersIfOnlyUsedByAnnotation() throws IOException, ParseException {
- assertCorrectDeriving("annotationsstruct");
+ assertCorrectDeriving("annotationsstruct",
+ new TestProperties().setExperimentalSdParsing(true));
}
@Test
public void requireThatStructRegistersIfOnlyUsedAsArrayByAnnotation() throws IOException, ParseException {
- assertCorrectDeriving("annotationsstructarray");
+ assertCorrectDeriving("annotationsstructarray",
+ new TestProperties().setExperimentalSdParsing(true));
}
@Test
public void testSimpleAnnotationDeriving() throws IOException, ParseException {
- assertCorrectDeriving("annotationssimple");
+ assertCorrectDeriving("annotationssimple",
+ new TestProperties().setExperimentalSdParsing(true));
}
@Test
public void testAnnotationDerivingWithImplicitStruct() throws IOException, ParseException {
- assertCorrectDeriving("annotationsimplicitstruct");
+ assertCorrectDeriving("annotationsimplicitstruct",
+ new TestProperties().setExperimentalSdParsing(true));
}
@Test
public void testAnnotationDerivingInheritance() throws IOException, ParseException {
- assertCorrectDeriving("annotationsinheritance");
+ assertCorrectDeriving("annotationsinheritance",
+ new TestProperties().setExperimentalSdParsing(true));
}
@Test
public void testAnnotationDerivingInheritance2() throws IOException, ParseException {
- assertCorrectDeriving("annotationsinheritance2");
+ assertCorrectDeriving("annotationsinheritance2",
+ new TestProperties().setExperimentalSdParsing(true));
}
@Test
public void testSimpleReference() throws IOException, ParseException {
- assertCorrectDeriving("annotationsreference");
+ assertCorrectDeriving("annotationsreference",
+ new TestProperties().setExperimentalSdParsing(true));
}
@Test
public void testAdvancedReference() throws IOException, ParseException {
- assertCorrectDeriving("annotationsreference2");
+ assertCorrectDeriving("annotationsreference2",
+ new TestProperties().setExperimentalSdParsing(true));
}
@Test
public void testAnnotationsPolymorphy() throws IOException, ParseException {
- assertCorrectDeriving("annotationspolymorphy");
+ assertCorrectDeriving("annotationspolymorphy",
+ new TestProperties().setExperimentalSdParsing(true));
}
/**
* An annotation declared before document {} won't work, no doc type to add it to.
*/
@Test(expected = IllegalArgumentException.class)
- public void testAnnotationOutsideOfDocumment() throws IOException, ParseException {
- assertCorrectDeriving("annotationsoutsideofdocument");
+ public void testAnnotationOutsideOfDocumentOld() throws IOException, ParseException {
+ assertCorrectDeriving("annotationsoutsideofdocument",
+ new TestProperties().setExperimentalSdParsing(false));
+ }
+
+ /**
+ * An annotation declared before document {} should work.
+ */
+ @Test
+ public void testAnnotationOutsideOfDocumentNew() throws IOException, ParseException {
+ assertCorrectDeriving("annotationsoutsideofdocument",
+ new TestProperties().setExperimentalSdParsing(true));
}
}