-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address ManagedBeanTypesTest.testGenericHierarchyBeanTypes failure on Java 21 when using tck-web-suite.xml #513
Conversation
…t fail if/when tck-web-suite.xml is used instead of tck-core-suite.xml when running "mvn clean verify -Dincontainer -Dcdi.tck-4-0.version= -Dmaven.test.failure.ignore=true" which for me seems to use tck-web-suite.xml instead of tck-core-suite.xml Signed-off-by: Scott Marlow <[email protected]>
Probably because of this? https://github.com/weld/core/blob/master/jboss-tck-runner/pom.xml#L364-L376
Standard TCK suit and webprofile contain different tests and so have different XMLs.
I don't think such property value is recognized by Weld? |
It is probably fair to expect exclusions from core TCK ( |
Yea, I was thinking the same 👍 |
Maybe we could add a test? EDIT: IIRC, it should be fairly easy using XMLUnit. |
This is what I had in mind: package org.jboss.cdi.tck.test;
import org.testng.annotations.Test;
import org.xmlunit.builder.DiffBuilder;
import org.xmlunit.diff.ComparisonResult;
import org.xmlunit.diff.ComparisonType;
import org.xmlunit.diff.Diff;
import org.xmlunit.diff.DifferenceEvaluators;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
public class ExclusionListsTest {
@Test
public void compareExclusionLists() throws IOException {
List<URL> xmls = new ArrayList<>();
ExclusionListsTest.class.getClassLoader().getResources("tck-tests.xml").asIterator().forEachRemaining(xmls::add);
assertEquals(xmls.size(), 2);
URL control = xmls.stream().filter(it -> !it.toString().contains("web")).findFirst().orElseThrow();
URL test = xmls.stream().filter(it -> it.toString().contains("web")).findFirst().orElseThrow();
Diff diff = DiffBuilder.compare(control)
.withTest(test)
.checkForSimilar()
.ignoreComments()
.ignoreWhitespace()
.withDifferenceEvaluator(DifferenceEvaluators.chain(
DifferenceEvaluators.Default,
(comparison, outcome) -> {
if (outcome != ComparisonResult.DIFFERENT) {
return outcome;
}
if (comparison.getType() == ComparisonType.CHILD_NODELIST_LENGTH
&& (Integer) comparison.getControlDetails().getValue() < (Integer) comparison.getTestDetails().getValue()) {
return ComparisonResult.SIMILAR;
}
if (comparison.getType() == ComparisonType.CHILD_LOOKUP
&& comparison.getControlDetails().getValue() == null
&& comparison.getTestDetails().getValue() != null) {
return ComparisonResult.SIMILAR;
}
return outcome;
}))
.build();
assertFalse(diff.hasDifferences(), diff.fullDescription());
}
} |
Also exclude ManagedBeanTypesTest.testGenericHierarchyBeanTypes in tck-web-suite.xml for #485
I'm not trying to use tck-web-suite.xml but seem to be doing so as I see a failure on Java 21 that might also need to be addressed elsewhere. This change is to exclude the
ManagedBeanTypesTest.testGenericHierarchyBeanTypes
test for tck-web-suite.xml as well.I'm using:
With the above, I seem to using
tck-web-suite.xml
which doesn't have the same excludes as tck-core-suite.xml.Test results are:
I'm not really sure if this pull request should be merged versus finding out why
-Dincontainer
is usingtck-web-suite.xml
which I think would be used when passing-Dincontainer=webprofile
. Thoughts?