KEYCLOAK-13368 TestClassProvider undertow server not stopped after testsuite

This commit is contained in:
mposolda 2020-03-20 15:50:51 +01:00 committed by Stian Thorgersen
parent 6cc897e319
commit 61fd66e107
2 changed files with 19 additions and 2 deletions

View file

@ -35,6 +35,7 @@ import org.jboss.arquillian.core.api.annotation.Observes;
import org.jboss.arquillian.test.spi.annotation.ClassScoped;
import org.jboss.arquillian.test.spi.annotation.SuiteScoped;
import org.jboss.arquillian.test.spi.event.suite.AfterClass;
import org.jboss.arquillian.test.spi.event.suite.AfterSuite;
import org.jboss.arquillian.test.spi.event.suite.BeforeClass;
import org.jboss.arquillian.test.spi.event.suite.BeforeSuite;
import org.jboss.logging.Logger;
@ -595,8 +596,14 @@ public class AuthServerTestEnricher {
suiteContext.getServerLogChecker().updateLastCheckedPositionsOfAllFilesToEndOfFile();
}
public void startTestClassProvider(@Observes(precedence = 100) BeforeSuite beforeSuite) {
new TestClassProvider().start();
public void startTestClassProvider(@Observes(precedence = 1) BeforeSuite beforeSuite) {
TestClassProvider testClassProvider = new TestClassProvider();
testClassProvider.start();
suiteContext.setTestClassProvider(testClassProvider);
}
public void stopTestClassProvider(@Observes(precedence = -1) AfterSuite afterSuite) {
suiteContext.getTestClassProvider().stop();
}
private static final Pattern UNEXPECTED_UNCAUGHT_ERROR = Pattern.compile(

View file

@ -51,6 +51,8 @@ public final class SuiteContext {
private TextFileChecker serverLogChecker;
private TestClassProvider testClassProvider;
/**
* True if the testsuite is running in the adapter backward compatibility testing mode,
* i.e. if the tests are running against newer auth server
@ -73,6 +75,14 @@ public final class SuiteContext {
this.serverLogChecker = serverLogChecker;
}
public TestClassProvider getTestClassProvider() {
return testClassProvider;
}
public void setTestClassProvider(TestClassProvider testClassProvider) {
this.testClassProvider = testClassProvider;
}
public boolean isAdminPasswordUpdated() {
return adminPasswordUpdated;
}