* Test method for {@link org.apache.tiles.velocity.template.VelocityStyleTilesTool#get(java.lang.String)}.
*/
@Test
public void testGetAttribute() {
TilesContainer container = createMock(TilesContainer.class);
AttributeContext attributeContext = createMock(AttributeContext.class);
ApplicationContext applicationContext = createMock(ApplicationContext.class);
Attribute attribute = new Attribute("myValue");
Map<String, Object> requestScope = new HashMap<String, Object>();
Map<String, Object> applicationScope = new HashMap<String, Object>();
requestScope.put(TilesAccess.CURRENT_CONTAINER_ATTRIBUTE_NAME, container);
expect(request.getAttribute(TilesAccess.CURRENT_CONTAINER_ATTRIBUTE_NAME)).andReturn(container);
expect(applicationContext.getApplicationScope()).andReturn(applicationScope).anyTimes();
expect(servletContext.getAttribute(ApplicationAccess
.APPLICATION_CONTEXT_ATTRIBUTE)).andReturn(applicationContext)
.anyTimes();
expect(container.getAttributeContext(isA(VelocityRequest.class)))
.andReturn(attributeContext);
expect(attributeContext.getAttribute("myAttribute")).andReturn(attribute);
replay(velocityContext, request, response, servletContext, container,
attributeContext, applicationContext);
initializeTool();
assertEquals(attribute, tool.get("myAttribute"));