Skip to content

Commit

Permalink
Merge pull request #5766 from soul2zimate/remove-jmockit-main
Browse files Browse the repository at this point in the history
[WFCORE-6609] remove obsolete JMockit
  • Loading branch information
yersan authored Nov 17, 2023
2 parents 07a310e + 93d0824 commit 2178f92
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 50 deletions.
20 changes: 1 addition & 19 deletions elytron/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,6 @@
</exclusions>
</dependency>

<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mock-server</groupId>
<artifactId>mockserver-netty</artifactId>
Expand Down Expand Up @@ -387,24 +381,12 @@
</executions>
</plugin>

<plugin><!-- to obtain jmockit jar path -->
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>getClasspathFilenames</id>
<goals>
<goal>properties</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<reuseForks>false</reuseForks>
<argLine>-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</argLine>
<argLine>${surefire.jacoco.args} ${modular.jdk.args} -Dorg.wildfly.extension.elytron.restore-default-ssl-context=true -Dauthconfigprovider.factory=org.wildfly.security.auth.jaspi.ElytronAuthConfigFactory</argLine>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -51,13 +50,10 @@
import org.wildfly.security.x500.cert.SubjectAlternativeNamesExtension;
import org.wildfly.security.x500.cert.X509CertificateBuilder;

import mockit.integration.junit4.JMockit;


/**
* @author <a href="mailto:[email protected]">Jan Kalina</a>
*/
@RunWith(JMockit.class)
public class DomainTestCase extends AbstractSubsystemTest {

public DomainTestCase() {
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -37,12 +36,10 @@
import org.wildfly.security.password.spec.ClearPasswordSpec;
import org.wildfly.security.sasl.util.SaslMechanismInformation;

import mockit.integration.junit4.JMockit;

/**
* @author <a href="mailto:[email protected]">Jan Kalina</a>
*/
@RunWith(JMockit.class)
public class SaslTestCase extends AbstractSubsystemTest {

public SaslTestCase() {
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<ClassLoadingAttributeDefinitions> {
@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);
Expand Down
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@
<version.org.jboss.xnio>3.8.12.Final</version.org.jboss.xnio>
<version.org.jboss.xnio.xnio-api>${version.org.jboss.xnio}</version.org.jboss.xnio.xnio-api>
<version.org.jboss.xnio.xnio-nio>${version.org.jboss.xnio}</version.org.jboss.xnio.xnio-nio>
<version.org.jmockit>1.39</version.org.jmockit>
<version.org.mock-server.mockserver-netty>5.8.1</version.org.mock-server.mockserver-netty>
<version.org.mockito>3.10.0</version.org.mockito>
<version.org.projectodd.vdx>1.1.6</version.org.projectodd.vdx>
Expand Down
6 changes: 0 additions & 6 deletions testbom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,6 @@
<version>${version.org.jboss.spec.javax.servlet.jboss-servlet-api_4.0_spec}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
<version>${version.org.jmockit}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mock-server</groupId>
<artifactId>mockserver-netty</artifactId>
Expand Down

0 comments on commit 2178f92

Please sign in to comment.