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

Examples of ro.isdc.wro.model.resource.processor.decorator.ExceptionHandlingProcessorDecorator


      @Override
      public String toString() {
        return CssImportPreProcessor.class.getSimpleName();
      }
    };
    final ResourcePreProcessor processor = new ExceptionHandlingProcessorDecorator(cssImportProcessor) {
      @Override
      protected boolean isIgnoreFailingProcessor() {
        return true;
      }
    };
View Full Code Here


  @Test
  public void testExceptions()
      throws IOException {
    final URL url = getClass().getResource("coffeeScript/exceptions");
    final AtomicInteger counter = new AtomicInteger();
    processor = new ExceptionHandlingProcessorDecorator(new RhinoCoffeeScriptProcessor() {
      @Override
      protected void onException(final Exception e) {
        counter.incrementAndGet();
        super.onException(e);
      }
View Full Code Here

  @Test
  public void testExceptions()
    throws IOException {
    final URL url = getClass().getResource("coffeeScript/exceptions");
    final AtomicInteger counter = new AtomicInteger();
    final ResourcePreProcessor processor = new ExceptionHandlingProcessorDecorator(new NodeCoffeeScriptProcessor() {
      @Override
      protected void onException(final Exception e, final String content) {
        counter.incrementAndGet();
        throw WroRuntimeException.wrap(e);
      }
View Full Code Here

  @Test
  public void shouldFailWhenInvalidTypeScriptIsProcessed()
      throws Exception {
    final URL url = getClass().getResource("typescript");
    final File testFolder = new File(url.getFile(), "invalid");
    final ResourcePreProcessor decorated = new ExceptionHandlingProcessorDecorator(victim);
    WroTestUtils.createInjector().inject(decorated);
    WroTestUtils.forEachFileInFolder(testFolder, new Function<File, Void>() {
      @Override
      public Void apply(final File input)
          throws Exception {
        try {
          decorated.process(Resource.create(input.getPath(), ResourceType.JS), new FileReader(input),
              new StringWriter());
          Assert.fail("Expected to fail, but didn't");
        } catch (final WroRuntimeException e) {
          // expected to throw exception, continue
        }
View Full Code Here

    };
    /**
     * Ignore processor failure, since we are interesting in detecting change only. A failure is treated as lack of
     * change.
     */
    final ResourcePreProcessor processor = new ExceptionHandlingProcessorDecorator(cssImportProcessor) {
      @Override
      protected boolean isIgnoreFailingProcessor() {
        return true;
      }
    };
View Full Code Here

  }

  @Test
  public void shouldHandleWrongCss()
      throws Exception {
    final ResourcePostProcessor processor = new ExceptionHandlingProcessorDecorator(new CssMinProcessor());
   
    final URL url = getClass().getResource("cssmin");
   
    final File testFolder = new File(url.getFile(), "test");
    final File expectedFolder = new File(url.getFile(), "expectedInvalid");
View Full Code Here

      }
    }
  }

  private ExceptionHandlingProcessorDecorator decorateProcessor(final ResourcePreProcessor processor) {
    return new ExceptionHandlingProcessorDecorator(new BenchmarkProcessorDecorator(
        processor)) {
      @Override
      protected boolean isIgnoreFailingProcessor() {
        return true;
      };
View Full Code Here

TOP

Related Classes of ro.isdc.wro.model.resource.processor.decorator.ExceptionHandlingProcessorDecorator

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.