Package ro.isdc.wro.config

Examples of ro.isdc.wro.config.Context


    assertEquals(0, Context.countActive());
  }

  @Before
  public void setUp() {
    final Context context = Context.standaloneContext();
    Context.set(context);
    victim = buildValidModel();
  }
View Full Code Here


  /**
   * @VisibleForTesting
   */
  InputStream locateWithDispatcher(final String uri)
      throws IOException {
    final Context context = Context.get();
    if (dispatcherLocator == null) {
      LOG.error("DispatcherLocator was not injected properly. This is a BUG.");
      throw new IllegalStateException("DispatcherLocator not injected properly");
    }
    // The order of stream retrieval is important. We are trying to get the dispatcherStreamLocator in order to handle
    // jsp resources (if such exist). Switching the order would cause jsp to not be interpreted by the container.
    return dispatcherLocator.getInputStream(context.getRequest(), context.getResponse(), uri);
  }
View Full Code Here

  }

  @Before
  public void setUp() {
    MockitoAnnotations.initMocks(this);
    final Context context = Context.webContext(Mockito.mock(HttpServletRequest.class),
        Mockito.mock(HttpServletResponse.class, Mockito.RETURNS_DEEP_STUBS), Mockito.mock(FilterConfig.class));
    Context.set(context, newConfigWithUpdatePeriodValue(0));

    managerFactory = new BaseWroManagerFactory().setModelFactory(getValidModelFactory()).setResourceAuthorizationManager(
        mockAuthorizationManager);
View Full Code Here

  @Test
  public void testManagerWithSchedulerAndUpdatePeriodSet()
      throws Exception {
    final HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
    Mockito.when(request.getRequestURI()).thenReturn("/app/g1.css");
    final Context context = Context.webContext(request,
        Mockito.mock(HttpServletResponse.class, Mockito.RETURNS_DEEP_STUBS), Mockito.mock(FilterConfig.class));
    final WroConfiguration config = new WroConfiguration();
    // make it run each 1 second
    config.setModelUpdatePeriod(1);
    config.setCacheUpdatePeriod(1);
View Full Code Here

*/
public class TestCacheValue {
  private static final String RAW_CONTENT = "[RAW_CONTENT]";
  @Before
  public void setUp() {
    final Context ctx = Context.standaloneContext();
    Context.set(ctx);
  }
View Full Code Here

  }

  @Before
  public void setUp() {
    MockitoAnnotations.initMocks(this);
    final Context context = Context.webContext(request, response, filterConfig);
    Context.set(context);
    processor = new CssUrlRewritingProcessor() {
      @Inject
      private ResourceAuthorizationManager authorizationManager;
View Full Code Here

    when(mockRequest.getRequestURL()).thenReturn(new StringBuffer(""));
    when(mockRequest.getServletPath()).thenReturn("");
    when(mockFilterConfig.getServletContext()).thenReturn(mockServletContext);

    final Context context = Context.webContext(mockRequest, mockResponse, mockFilterConfig);
    final WroConfiguration config = new WroConfiguration();
    config.setConnectionTimeout(100);
    Context.set(context, config);

    victim = new ServletContextUriLocator();
View Full Code Here

    when(mockFilterConfig.getServletContext()).thenReturn(mockServletContext);
    when(mockLocatorFactory.locate(Mockito.anyString())).thenReturn(WroUtil.EMPTY_STREAM);
    when(mockLocator.locate(Mockito.anyString())).thenReturn(WroUtil.EMPTY_STREAM);
    when(mockLocatorFactory.getInstance(Mockito.anyString())).thenReturn(mockLocator);

    final Context context = Context.webContext(mockRequest, mockResponse, mockFilterConfig);
    Context.set(context);
    // force parallel execution
    Context.get().getConfig().setParallelPreprocessing(true);
    Context.get().getConfig().setIgnoreFailingProcessor(true);
    initExecutor();
View Full Code Here

    assertEquals(0, Context.countActive());
  }
 
  @Before
  public void setUp() {
    final Context context = Context.standaloneContext();
    Context.set(context);
    context.getConfig().setCacheUpdatePeriod(0);
    context.getConfig().setModelUpdatePeriod(0);
  }
View Full Code Here

  @Override
  public void process(final Reader reader, final Writer writer)
      throws IOException {
    final StopWatch stopWatch = new StopWatch();
    stopWatch.start("lessify");
    Context context = Context.get();
    HttpServletRequest request = context.getRequest();
    String uri = request.getRequestURI();
    try {
      logger.debug("lessifying: {}", uri);
      LessCompiler less = new LessCompiler();
      String content = IOUtils.toString(reader);
View Full Code Here

TOP

Related Classes of ro.isdc.wro.config.Context

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.