Skip to content
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

synchronize exclusion lists across impl and web + remove tck-tests-previous.xml #515

Merged
merged 3 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Jakarta Contexts and Dependency Injection TCK CI
on:
workflow_dispatch:
pull_request:
branches: [ master ]

jobs:
build:
Expand Down
37 changes: 0 additions & 37 deletions impl/src/main/resources/tck-tests-previous.xml

This file was deleted.

9 changes: 5 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
<arquillian.container.se.api.version>1.0.1.Final</arquillian.container.se.api.version>
<apache.httpclient.version>3.1</apache.httpclient.version>
<htmlunit.version>2.50.0</htmlunit.version>
<selenium.version>4.7.2</selenium.version>
<selenium.version>4.7.2</selenium.version>
<xmlunit.version>2.9.1</xmlunit.version>
<!-- Required for distribution build, should be overriden for each build -->
<cdi.tck.version>${project.version}</cdi.tck.version>
<weld.version>5.0.0.SP2</weld.version>
Expand Down Expand Up @@ -192,12 +193,12 @@
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>${selenium.version}</version>
</dependency>
</dependency>

<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>5.3.1</version>
<artifactId>webdrivermanager</artifactId>
<version>5.3.1</version>
</dependency>

<dependency>
Expand Down
7 changes: 7 additions & 0 deletions web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@
<version>2.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<version>${xmlunit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
37 changes: 0 additions & 37 deletions web/src/main/resources/tck-tests-previous.xml

This file was deleted.

47 changes: 46 additions & 1 deletion web/src/main/resources/tck-tests.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="CDI TCK" verbose="0" configfailurepolicy="continue" useDefaultListeners="false">
<suite name="CDI TCK" verbose="0" configfailurepolicy="continue">

<listeners>
<!-- Required - avoid randomly mixed test method execution -->
Expand All @@ -23,6 +23,51 @@
</packages>

<classes>
<!-- https://github.com/jakartaee/cdi-tck/issues/431 -->
<!-- This test is disabled in 4.0 not to break existing impls and should be re-enabled for 4.1 release -->
<class name="org.jboss.cdi.tck.tests.full.extensions.lifecycle.bbd.broken.passivatingScope.AddingPassivatingScopeTest">
<methods>
<exclude name=".*"/>
</methods>
</class>

<!-- https://github.com/jakartaee/cdi-tck/issues/440 -->
<class name="org.jboss.cdi.tck.tests.full.extensions.lifecycle.processBeanAttributes.specialization.VetoTest">
<methods>
<exclude name=".*"/>
</methods>
</class>

<!-- https://github.com/jakartaee/cdi-tck/issues/453 -->
<class name="org.jboss.cdi.tck.tests.implementation.simple.lifecycle.SimpleBeanLifecycleTest">
<methods>
<exclude name="testCreateReturnsSameBeanPushed"/>
</methods>
</class>
<class name="org.jboss.cdi.tck.tests.context.DestroyForSameCreationalContextTest">
<methods>
<exclude name="testDestroyForSameCreationalContextOnly"/>
</methods>
</class>

<!-- https://github.com/jakartaee/cdi-tck/issues/485 -->
<class name="org.jboss.cdi.tck.tests.definition.bean.types.ManagedBeanTypesTest">
<methods>
<exclude name=".*"/>
</methods>
</class>

<!-- https://github.com/jakartaee/cdi-tck/issues/468 -->
<class name="org.jboss.cdi.tck.interceptors.tests.contract.invocationContext.InvocationContextTest">
<methods>
<exclude name="testGetTargetMethod"/>
</methods>
</class>
<class name="org.jboss.cdi.tck.tests.interceptors.definition.inheritance.InterceptorBindingInheritanceTest">
<methods>
<exclude name=".*"/>
</methods>
</class>

<!-- CDITCK-587 -->
<class name="org.jboss.cdi.tck.tests.event.observer.transactional.roolback.TransactionalObserverRollbackTest">
Expand Down
53 changes: 53 additions & 0 deletions web/src/test/java/org/jboss/cdi/tck/test/ExclusionListsTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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(),
"Exclusion list in `web` must contain the exclusion list in `impl` as a prefix:\n" + diff.fullDescription());
}
}
Loading