From 93d08249c72c137ca3e214540211de66fc2f684a Mon Sep 17 00:00:00 2001 From: Chao Wang Date: Wed, 15 Nov 2023 11:05:23 +0800 Subject: [PATCH] [WFCORE-6609] remove obsolete JMockit --- elytron/pom.xml | 20 +------------------ .../extension/elytron/DomainTestCase.java | 5 ----- .../extension/elytron/SaslTestCase.java | 4 ---- .../extension/elytron/TestEnvironment.java | 15 -------------- pom.xml | 1 - testbom/pom.xml | 6 ------ 6 files changed, 1 insertion(+), 50 deletions(-) diff --git a/elytron/pom.xml b/elytron/pom.xml index 094f1638eaf..bee11f115f1 100644 --- a/elytron/pom.xml +++ b/elytron/pom.xml @@ -286,12 +286,6 @@ - - org.jmockit - jmockit - test - - org.mock-server mockserver-netty @@ -387,24 +381,12 @@ - - maven-dependency-plugin - - - getClasspathFilenames - - properties - - - - - org.apache.maven.plugins maven-surefire-plugin false - -javaagent:${org.jmockit:jmockit:jar} ${surefire.jacoco.args} ${modular.jdk.args} -Dorg.wildfly.extension.elytron.restore-default-ssl-context=true -Dauthconfigprovider.factory=org.wildfly.security.auth.jaspi.ElytronAuthConfigFactory + ${surefire.jacoco.args} ${modular.jdk.args} -Dorg.wildfly.extension.elytron.restore-default-ssl-context=true -Dauthconfigprovider.factory=org.wildfly.security.auth.jaspi.ElytronAuthConfigFactory diff --git a/elytron/src/test/java/org/wildfly/extension/elytron/DomainTestCase.java b/elytron/src/test/java/org/wildfly/extension/elytron/DomainTestCase.java index 372feb3ada3..0b999eb3525 100644 --- a/elytron/src/test/java/org/wildfly/extension/elytron/DomainTestCase.java +++ b/elytron/src/test/java/org/wildfly/extension/elytron/DomainTestCase.java @@ -27,7 +27,6 @@ import org.jboss.msc.service.ServiceName; import org.junit.Assert; import org.junit.Test; -import org.junit.runner.RunWith; import org.wildfly.security.asn1.ASN1Encodable; import org.wildfly.security.auth.permission.LoginPermission; import org.wildfly.security.auth.principal.NamePrincipal; @@ -51,13 +50,10 @@ import org.wildfly.security.x500.cert.SubjectAlternativeNamesExtension; import org.wildfly.security.x500.cert.X509CertificateBuilder; -import mockit.integration.junit4.JMockit; - /** * @author Jan Kalina */ -@RunWith(JMockit.class) public class DomainTestCase extends AbstractSubsystemTest { public DomainTestCase() { @@ -81,7 +77,6 @@ private ModelNode assertFail(ModelNode response) { } private void init() throws Exception { - TestEnvironment.mockCallerModuleClassloader(); services = super.createKernelServicesBuilder(new TestEnvironment()).setSubsystemXmlResource("domain-test.xml").build(); if (!services.isSuccessfulBoot()) { if (services.getBootError() != null) { diff --git a/elytron/src/test/java/org/wildfly/extension/elytron/SaslTestCase.java b/elytron/src/test/java/org/wildfly/extension/elytron/SaslTestCase.java index cad2ac42168..618d90c210f 100644 --- a/elytron/src/test/java/org/wildfly/extension/elytron/SaslTestCase.java +++ b/elytron/src/test/java/org/wildfly/extension/elytron/SaslTestCase.java @@ -26,7 +26,6 @@ import org.jboss.msc.service.ServiceName; import org.junit.Assert; import org.junit.Test; -import org.junit.runner.RunWith; import org.wildfly.security.auth.callback.ChannelBindingCallback; import org.wildfly.security.auth.callback.CredentialCallback; import org.wildfly.security.auth.server.SaslAuthenticationFactory; @@ -37,12 +36,10 @@ import org.wildfly.security.password.spec.ClearPasswordSpec; import org.wildfly.security.sasl.util.SaslMechanismInformation; -import mockit.integration.junit4.JMockit; /** * @author Jan Kalina */ -@RunWith(JMockit.class) public class SaslTestCase extends AbstractSubsystemTest { public SaslTestCase() { @@ -52,7 +49,6 @@ public SaslTestCase() { private KernelServices services = null; private void init() throws Exception { - TestEnvironment.mockCallerModuleClassloader(); // to allow loading classes from testsuite services = super.createKernelServicesBuilder(new TestEnvironment()).setSubsystemXmlResource("sasl-test.xml").build(); if (!services.isSuccessfulBoot()) { if (services.getBootError() != null) { diff --git a/elytron/src/test/java/org/wildfly/extension/elytron/TestEnvironment.java b/elytron/src/test/java/org/wildfly/extension/elytron/TestEnvironment.java index 6f0f8de3a0a..9c4cebd4391 100644 --- a/elytron/src/test/java/org/wildfly/extension/elytron/TestEnvironment.java +++ b/elytron/src/test/java/org/wildfly/extension/elytron/TestEnvironment.java @@ -34,9 +34,6 @@ import org.wildfly.security.x500.cert.SelfSignedX509CertificateAndSigningKey; import org.wildfly.security.x500.cert.X509CertificateBuilder; -import mockit.Mock; -import mockit.MockUp; - class TestEnvironment extends AdditionalInitialization { static final int LDAPS1_PORT = 11391; @@ -194,18 +191,6 @@ public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOEx }); } - // classloader obtaining mock to load classes from testsuite - private static class ClassLoadingAttributeDefinitionsMock extends MockUp { - @Mock - static ClassLoader resolveClassLoader(String module) { - return SaslTestCase.class.getClassLoader(); - } - } - - static void mockCallerModuleClassloader() { - new ClassLoadingAttributeDefinitionsMock(); - } - static void activateService(KernelServices services, RuntimeCapability capability, String... dynamicNameElements) throws InterruptedException { ServiceName serviceName = capability.getCapabilityServiceName(dynamicNameElements); ServiceController serviceController = services.getContainer().getService(serviceName); diff --git a/pom.xml b/pom.xml index 8b13a450d5a..270c59658be 100644 --- a/pom.xml +++ b/pom.xml @@ -228,7 +228,6 @@ 3.8.12.Final ${version.org.jboss.xnio} ${version.org.jboss.xnio} - 1.39 5.8.1 3.10.0 1.1.6 diff --git a/testbom/pom.xml b/testbom/pom.xml index d23e7ba381c..52e5a68d166 100644 --- a/testbom/pom.xml +++ b/testbom/pom.xml @@ -239,12 +239,6 @@ ${version.org.jboss.spec.javax.servlet.jboss-servlet-api_4.0_spec} test - - org.jmockit - jmockit - ${version.org.jmockit} - test - org.mock-server mockserver-netty