Package ro.isdc.wro.http

Examples of ro.isdc.wro.http.WroFilter


  }


  @Test
  public void shouldLoadWroConfigurationFromServletContextAttribute() throws Exception {
    final WroFilter filter = new WroFilter();
    final WroConfiguration expectedConfig = new WroConfiguration();
    final ServletContextAttributeHelper helper = new ServletContextAttributeHelper(mockServletContext);
    Mockito.when(mockServletContext.getAttribute(helper.getAttributeName(Attribute.CONFIGURATION))).thenReturn(expectedConfig);
    filter.init(mockFilterConfig);
    Assert.assertSame(expectedConfig, filter.getConfiguration());
  }
View Full Code Here


    Assert.assertSame(expectedConfig, filter.getConfiguration());
  }

  @Test
  public void shouldLoadWroManagerFactoryFromServletContextAttribute() throws Exception {
    final WroFilter filter = new WroFilter();
    final WroManagerFactory expectedManagerFactory = new BaseWroManagerFactory();
    final ServletContextAttributeHelper helper = new ServletContextAttributeHelper(mockServletContext);
    Mockito.when(mockServletContext.getAttribute(helper.getAttributeName(Attribute.MANAGER_FACTORY))).thenReturn(expectedManagerFactory);
    //reset it because it was initialized in test setup.
    filter.setWroManagerFactory(null);
    filter.init(mockFilterConfig);
    Assert.assertSame(expectedManagerFactory, AbstractDecorator.getOriginalDecoratedObject(filter.getWroManagerFactory()));
  }
View Full Code Here

TOP

Related Classes of ro.isdc.wro.http.WroFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.