Package ro.isdc.wro.model.resource.processor

Examples of ro.isdc.wro.model.resource.processor.ResourcePostProcessor


   *          {@link ResourcePreProcessor} to use as a {@link ResourceProcessor}.
   * @return instance of {@link ResourceProcessor}.
   */
  public static ResourcePostProcessor newResourceProcessor(final Resource resource,
      final ResourcePreProcessor preProcessor) {
    return new ResourcePostProcessor() {
      public void process(final Reader reader, final Writer writer)
          throws IOException {
        preProcessor.process(resource, reader, writer);
      }
    };
View Full Code Here


    });
  }

  @Test
  public void shouldCreateHelperWithPostProcessor() {
    new ProcessorDecorator(new ResourcePostProcessor() {
      public void process(final Reader reader, final Writer writer)
          throws IOException {
      }
    });
  }
View Full Code Here

    });
  }

  @Test
  public void shouldPreserveProcessorMetadataAfterTransform() {
    final ResourcePostProcessor postProcessor = new JSMinProcessor();
    final ProcessorDecorator decorator = new ProcessorDecorator(postProcessor);
    assertTrue(Arrays.equals(new ResourceType[] {ResourceType.JS}, decorator.getSupportedResourceTypes()));
    assertTrue(decorator.isMinimize());
  }
View Full Code Here

  }

  @Test
  public void shouldDecoratePostProcessor() {
    final String expected = "TestProcessor";
    final ResourcePostProcessor postProcessor = new ResourcePostProcessor() {
      public void process(final Reader reader, final Writer writer)
          throws IOException {
      }
      @Override
      public String toString() {
View Full Code Here

  }

  @Test
  public void shouldNotInvokeMinimizePostProcessorWhenMinimizeIsNotRequired()
      throws Exception {
    final ResourcePostProcessor processor = Mockito.spy(new JSMinProcessor());
    victim = new MinimizeAwareProcessorDecorator(processor, false);
    initVictim();
    victim.process(mockReader, mockWriter);
    Mockito.verify(processor, Mockito.never()).process(Mockito.any(Reader.class), Mockito.any(Writer.class));
  }
View Full Code Here

TOP

Related Classes of ro.isdc.wro.model.resource.processor.ResourcePostProcessor

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.