GroovyObject tagLib1 = attrs.getTagLibraryForTag(request,response,"firstTag");
assertNotNull(tagLib1);
}
private GrailsApplicationAttributes getAttributesForClasses(Class<?>[] classes, GroovyClassLoader gcl) {
MockApplicationContext context = new MockApplicationContext();
MockServletContext servletContext = new MockServletContext();
servletContext.setAttribute(GrailsApplicationAttributes.APPLICATION_CONTEXT,context);
GrailsApplication app = new DefaultGrailsApplication(classes,gcl);
app.initialise();
context.registerMockBean(GrailsApplication.APPLICATION_ID,app);
GrailsClass[] controllers = app.getArtefacts(ControllerArtefactHandler.TYPE);
for (int i = 0; i < controllers.length; i++) {
context.registerMockBean(controllers[i].getFullName(), controllers[i].newInstance());
}
GrailsClass[] taglibs = app.getArtefacts(TagLibArtefactHandler.TYPE);
for (int i = 0; i < taglibs.length; i++) {
context.registerMockBean(taglibs[i].getFullName(), taglibs[i].newInstance());
}
return new DefaultGrailsApplicationAttributes(servletContext);
}