Ilyas Patel
unread,Jun 11, 2012, 7:12:46 AM6/11/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to SiteMesh 3 Users
I have created a new custom decorator which extends a
AbstractDecoratorMapper. The new class calls methods in the abstract
class using super. The problem I have is when trying to write the unit
test, I'm not sure how to write a test as I would not know what
SiteMesh passes to the init methods. I am using JMock if that can help
answer.
Here is the decorator:
public final class PartnerDecoratorMapper extends
AbstractDecoratorMapper {
@Override
public void init(Config config, Properties properties,
DecoratorMapper parent) throws InstantiationException {
super.init(config, properties, parent);
}
@Override
public Decorator getDecorator(HttpServletRequest request, Page
page) {
if (super.getDecorator(request,
page).getName().equalsIgnoreCase("default")) {
return getNamedDecorator(request,
"externalPartnerDefault");
}
return super.getDecorator(request, page);
}
}