mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +01:00
fixed broken ClassLoaderLifeCycle unit tests
This commit is contained in:
@@ -35,7 +35,7 @@ class ClassLoaderLifeCycleTest {
|
|||||||
@Test
|
@Test
|
||||||
void shouldThrowIllegalStateExceptionAfterShutdown() {
|
void shouldThrowIllegalStateExceptionAfterShutdown() {
|
||||||
ClassLoaderLifeCycle lifeCycle = createMockedLifeCycle();
|
ClassLoaderLifeCycle lifeCycle = createMockedLifeCycle();
|
||||||
lifeCycle.init();
|
lifeCycle.initialize();
|
||||||
|
|
||||||
lifeCycle.shutdown();
|
lifeCycle.shutdown();
|
||||||
assertThrows(IllegalStateException.class, lifeCycle::getBootstrapClassLoader);
|
assertThrows(IllegalStateException.class, lifeCycle::getBootstrapClassLoader);
|
||||||
@@ -44,7 +44,7 @@ class ClassLoaderLifeCycleTest {
|
|||||||
@Test
|
@Test
|
||||||
void shouldCreateBootstrapClassLoaderOnInit() {
|
void shouldCreateBootstrapClassLoaderOnInit() {
|
||||||
ClassLoaderLifeCycle lifeCycle = ClassLoaderLifeCycle.create();
|
ClassLoaderLifeCycle lifeCycle = ClassLoaderLifeCycle.create();
|
||||||
lifeCycle.init();
|
lifeCycle.initialize();
|
||||||
|
|
||||||
assertThat(lifeCycle.getBootstrapClassLoader()).isNotNull();
|
assertThat(lifeCycle.getBootstrapClassLoader()).isNotNull();
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ class ClassLoaderLifeCycleTest {
|
|||||||
void shouldCallTheLeakPreventor() {
|
void shouldCallTheLeakPreventor() {
|
||||||
ClassLoaderLifeCycle lifeCycle = createMockedLifeCycle();
|
ClassLoaderLifeCycle lifeCycle = createMockedLifeCycle();
|
||||||
|
|
||||||
lifeCycle.init();
|
lifeCycle.initialize();
|
||||||
verify(classLoaderLeakPreventor, times(2)).runPreClassLoaderInitiators();
|
verify(classLoaderLeakPreventor, times(2)).runPreClassLoaderInitiators();
|
||||||
|
|
||||||
lifeCycle.createChildFirstPluginClassLoader(new URL[0], null, "a");
|
lifeCycle.createChildFirstPluginClassLoader(new URL[0], null, "a");
|
||||||
@@ -71,7 +71,7 @@ class ClassLoaderLifeCycleTest {
|
|||||||
|
|
||||||
ClassLoaderLifeCycle lifeCycle = createMockedLifeCycle(webappClassLoader);
|
ClassLoaderLifeCycle lifeCycle = createMockedLifeCycle(webappClassLoader);
|
||||||
lifeCycle.setClassLoaderAppendListener(c -> spy(c));
|
lifeCycle.setClassLoaderAppendListener(c -> spy(c));
|
||||||
lifeCycle.init();
|
lifeCycle.initialize();
|
||||||
|
|
||||||
ClassLoader pluginA = lifeCycle.createChildFirstPluginClassLoader(new URL[0], null, "a");
|
ClassLoader pluginA = lifeCycle.createChildFirstPluginClassLoader(new URL[0], null, "a");
|
||||||
ClassLoader pluginB = lifeCycle.createPluginClassLoader(new URL[0], null, "b");
|
ClassLoader pluginB = lifeCycle.createPluginClassLoader(new URL[0], null, "b");
|
||||||
|
|||||||
Reference in New Issue
Block a user