fixed test
This commit is contained in:
parent
1fc046fb3d
commit
2e299a7ebd
Binary file not shown.
|
@ -134,6 +134,10 @@ public class TestAnnotationConfiguration
|
|||
assertTrue(testSciJar.exists());
|
||||
URLClassLoader webAppLoader = new URLClassLoader(new URL[]{testSciJar.toURI().toURL()}, Thread.currentThread().getContextClassLoader());
|
||||
|
||||
ClassLoader orig = Thread.currentThread().getContextClassLoader();
|
||||
try
|
||||
{
|
||||
|
||||
//test 3.1 webapp loads both server and app scis
|
||||
AnnotationConfiguration config = new AnnotationConfiguration();
|
||||
WebAppContext context = new WebAppContext();
|
||||
|
@ -141,7 +145,9 @@ public class TestAnnotationConfiguration
|
|||
context.getMetaData().setWebXml(Resource.newResource(web31true));
|
||||
context.getServletContext().setEffectiveMajorVersion(3);
|
||||
context.getServletContext().setEffectiveMinorVersion(1);
|
||||
Thread.currentThread().setContextClassLoader(webAppLoader);
|
||||
List<ServletContainerInitializer> scis = config.getNonExcludedInitializers(context);
|
||||
|
||||
assertNotNull(scis);
|
||||
assertEquals(2, scis.size());
|
||||
assertTrue(sciNames.contains(scis.get(0).getClass().getName()));
|
||||
|
@ -187,6 +193,11 @@ public class TestAnnotationConfiguration
|
|||
assertTrue(sciNames.contains(scis.get(0).getClass().getName()));
|
||||
assertTrue(sciNames.contains(scis.get(1).getClass().getName()));
|
||||
}
|
||||
finally
|
||||
{
|
||||
Thread.currentThread().setContextClassLoader(orig);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue