Copilot commented on code in PR #7184:
URL: https://github.com/apache/incubator-kie/pull/7184#discussion_r4237918522
##########
kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/DMNEvaluatorCompilerTest.java:
##########
@@ -192,6 +192,21 @@ void testGetEvaluatorIdentifier() {
assertThat(elseEvaluatorIdentifier).isEqualTo(elseIdentifier);
}
+ /**
+ * Regression test: DMN 1.6 models with typeRef on inputValues (as written
by the KIE DMN editor 10.1)
+ * must load without UnsupportedOperationException from
AbstractTUnaryTests.setTypeRef.
+ * See: https://github.com/apache/incubator-kie-issues/issues/...
Review Comment:
The placeholder URL does not identify the regression and points to a
different repository. Link the issue closed by this PR so this test remains
traceable.
##########
kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/compiler/DMNEvaluatorCompilerTest.java:
##########
@@ -192,6 +192,21 @@ void testGetEvaluatorIdentifier() {
assertThat(elseEvaluatorIdentifier).isEqualTo(elseIdentifier);
}
+ /**
+ * Regression test: DMN 1.6 models with typeRef on inputValues (as written
by the KIE DMN editor 10.1)
+ * must load without UnsupportedOperationException from
AbstractTUnaryTests.setTypeRef.
+ * See: https://github.com/apache/incubator-kie-issues/issues/...
+ */
+ @Test
+ void inputValuesWithTypeRefLoadsOnDMNv1_6() {
+ Resource resource =
ResourceFactory.newClassPathResource("valid_models/DMNv1_6/inputValuesTypeRef.dmn");
+ DMNRuntime dmnRuntime =
DMNRuntimeBuilder.fromDefaults().buildConfiguration()
+
.fromResources(Collections.singletonList(resource)).getOrElseThrow(RuntimeException::new);
+ assertThat(dmnRuntime).isNotNull();
+ assertThat(dmnRuntime.getModels()).hasSize(1);
+ assertThat(dmnRuntime.getModels().get(0).hasErrors()).isFalse();
Review Comment:
This regression test stops after unmarshalling, but the fix leaves
serialization broken: every DMN 1.3–1.6 `ExpressionConverter.writeAttributes`
still excludes `UnaryTests`, so marshalling this loaded model silently drops
the schema-valid `typeRef`. Please update those versioned converters to emit
`typeRef` for unary tests and add an XML unmarshal/marshal round-trip
assertion; keep the exclusion only for DMN 1.1/1.2.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]