ScopeVariableResolverFactory extends
        ReadOnlyVariableResolverFactory { @Override public VariableResolver createVariableResolver(String name) { return new ScopeVariableResolver(name); } ScopeVariableResolverFactory(TilesRequestContextHolder requestHolder); @Override VariableResolver createVariableResolver(String name); boolean isTarget(String name);  }
@Test public void testCreateVariableResolver() { Map<String, Object> requestScope = new HashMap<String, Object>(); requestScope.put("one", 1); expect(request.getContext("request")).andReturn(requestScope).times(2); Map<String, Object> applicationScope = new HashMap<String, Object>(); applicationScope.put("two", 2); expect(request.getContext("application")).andReturn(applicationScope); replay(request, applicationContext); VariableResolver resolver = factory.createVariableResolver("requestScope"); assertEquals(0, resolver.getFlags()); assertEquals("requestScope", resolver.getName()); assertEquals(Map.class, resolver.getType()); assertEquals(requestScope, resolver.getValue()); resolver.setStaticType(Object.class); assertEquals(Map.class, resolver.getType()); resolver = factory.createVariableResolver("requestScope"); assertEquals(requestScope, resolver.getValue()); resolver = factory.createVariableResolver("applicationScope"); assertEquals(applicationScope, resolver.getValue()); verify(request, applicationContext); }