Package ro.isdc.wro.http.support

Examples of ro.isdc.wro.http.support.ServletContextAttributeHelper

@author Alex Objelean @created 7 May 2012 @since 1.4.6

    assertEquals("Should be classpath resource domain", CLASSPATH_RESOURCE_DOMAIN, wroTagLibConfig.getResourceDomain());
  }

  @Test
  public void wroModelIsRetrievedCorrectly() {
    ServletContextAttributeHelper servletContextAttributeHelper = mock(ServletContextAttributeHelper.class);
    WroManagerFactory managerFactory = mock(WroManagerFactory.class);
    WroManager manager = PowerMockito.mock(WroManager.class);
    WroModelFactory modelFactory = mock(WroModelFactory.class);

    WroModel modelFromTest = new WroModel();

    when(servletContextAttributeHelper.getManagerFactory()).thenReturn(managerFactory);
    when(managerFactory.create()).thenReturn(manager);
    when(manager.getModelFactory()).thenReturn(modelFactory);
    when(modelFactory.create()).thenReturn(modelFromTest);

    WroTagLibConfig wroTagLibConfig = new WroTagLibConfig(this.servletContext);
View Full Code Here


      throw new ConfigurationException("Unable to retrieve wro4j model");
    }
  }

  public ServletContextAttributeHelper getServletContextAttributeHelper() {
    return new ServletContextAttributeHelper(this.servletContext);
  }
View Full Code Here

    private ServletContext servletContext;
    private WroModel wroModel;

    public WroModel getWroModel() {
        if (wroModel == null) {
            ServletContextAttributeHelper helper = new ServletContextAttributeHelper(servletContext);
            if (helper.getManagerFactory() != null) {
                wroModel = helper.getManagerFactory().create().getModelFactory().create();
            }
        }
        return wroModel;
    }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public final void contextInitialized(final ServletContextEvent event) {
    this.servletContext = event.getServletContext();
    attributeHelper = new ServletContextAttributeHelper(this.servletContext, getListenerName());
    initListener(event.getServletContext());
  }
View Full Code Here

TOP

Related Classes of ro.isdc.wro.http.support.ServletContextAttributeHelper

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.