@Test public void specified_context_class_is_compatible() { ServletContext context = mockServletContext(); train_getInitParameter(context, ContextLoader.CONTEXT_CLASS_PARAM, TapestryApplicationContext.class.getName()); replay(); CustomizingContextLoader ccl = new CustomizingContextLoader(null); assertSame(ccl.determineContextClass(context), TapestryApplicationContext.class); verify(); }
@Override protected Class determineContextClass(ServletContext servletContext) throws ApplicationContextException { String contextClassName = servletContext.getInitParameter(CONTEXT_CLASS_PARAM); if (InternalUtils.isNonBlank(contextClassName)) { Class result = super.determineContextClass(servletContext); if (!TapestryApplicationContext.class.isAssignableFrom(result)) throw new IllegalArgumentException(String.format( "When using the Tapestry/Spring integration library, you must specifiy a context class that extends from %s. Class %s does not. Update the '%s' servlet context init parameter.", TapestryApplicationContext.class.getName(), result.getName(), CONTEXT_CLASS_PARAM)); return result; } return TapestryApplicationContext.class; }
CustomizingContextLoader extends ContextLoader { @Override protected Class determineContextClass(ServletContext servletContext) throws ApplicationContextException { String contextClassName = servletContext.getInitParameter(CONTEXT_CLASS_PARAM); if (InternalUtils.isNonBlank(contextClassName)) { Class result = super.determineContextClass(servletContext); if (!TapestryApplicationContext.class.isAssignableFrom(result)) throw new IllegalArgumentException(String.format( "When using the Tapestry/Spring integration library, you must specifiy a context class that extends from %s. Class %s does not. Update the '%s' servlet context init parameter.", TapestryApplicationContext.class.getName(), result.getName(), CONTEXT_CLASS_PARAM)); return result; } return TapestryApplicationContext.class; } }
CustomizingContextLoader extends ContextLoader { @Override protected Class determineContextClass(ServletContext servletContext) throws ApplicationContextException { String contextClassName = servletContext.getInitParameter(CONTEXT_CLASS_PARAM); if (InternalUtils.isNonBlank(contextClassName)) { Class result = super.determineContextClass(servletContext); if (!TapestryApplicationContext.class.isAssignableFrom(result)) throw new IllegalArgumentException(String.format( "When using the Tapestry/Spring integration library, you must specifiy a context class that extends from %s. Class %s does not. Update the '%s' servlet context init parameter.", TapestryApplicationContext.class.getName(), result.getName(), CONTEXT_CLASS_PARAM)); return result; } return TapestryApplicationContext.class; } CustomizingContextLoader(ApplicationContextCustomizer customizer); }
CustomizingContextLoader extends ContextLoader { @Override protected Class determineContextClass(ServletContext servletContext) throws ApplicationContextException { String contextClassName = servletContext.getInitParameter(CONTEXT_CLASS_PARAM); if (InternalUtils.isNonBlank(contextClassName)) { Class result = super.determineContextClass(servletContext); if (!TapestryApplicationContext.class.isAssignableFrom(result)) throw new IllegalArgumentException(String.format( "When using the Tapestry/Spring integration library, you must specifiy a context class that extends from %s. Class %s does not. Update the '%s' servlet context init parameter.", TapestryApplicationContext.class.getName(), result.getName(), CONTEXT_CLASS_PARAM)); return result; } return TapestryApplicationContext.class; } CustomizingContextLoader(ApplicationContextCustomizer customizer);  }
CustomizingContextLoader extends ContextLoader { @Override protected Class determineContextClass(ServletContext servletContext) throws ApplicationContextException { String contextClassName = servletContext.getInitParameter(CONTEXT_CLASS_PARAM); if (InternalUtils.isNonBlank(contextClassName)) { Class result = super.determineContextClass(servletContext); if (!TapestryApplicationContext.class.isAssignableFrom(result)) throw new IllegalArgumentException(String.format( "When using the Tapestry/Spring integration library, you must specifiy a context class that extends from %s. Class %s does not. Update the '%s' servlet context init parameter.", TapestryApplicationContext.class.getName(), result.getName(), CONTEXT_CLASS_PARAM)); return result; } return TapestryApplicationContext.class; } CustomizingContextLoader(ApplicationContextCustomizer customizer);   }