Package ro.isdc.wro.extensions.processor.js

Examples of ro.isdc.wro.extensions.processor.js.JsLintProcessor


  /**
   * {@inheritDoc}
   */
  @Override
  protected ResourcePreProcessor createResourceProcessor() {
    final ResourcePreProcessor processor = new JsLintProcessor() {
      @Override
      public void process(final Resource resource, final Reader reader, final Writer writer)
          throws IOException {
        getProgressIndicator().onProcessingResource(resource);
        if (resource != null) {
View Full Code Here


      }
    }));
    map.put(JsLintProcessor.ALIAS, new LazyProcessorDecorator(new LazyInitializer<ResourcePreProcessor>() {
      @Override
      protected ResourcePreProcessor initialize() {
        return new JsLintProcessor();
      }
    }));
    map.put(CssLintProcessor.ALIAS, new LazyProcessorDecorator(new LazyInitializer<ResourcePreProcessor>() {
      @Override
      protected ResourcePreProcessor initialize() {
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  protected ResourcePreProcessor newLinterProcessor() {
    return new JsLintProcessor();
  }
View Full Code Here

  }

  @Test(expected = LinterException.class)
  public void testWithOptionsSet()
      throws Exception {
    final ResourcePostProcessor processor = new JsLintProcessor() {
      @Override
      protected void onLinterException(final LinterException e, final Resource resource) {
        throw e;
      };
    }.setOptionsAsString("maxerr=1");
View Full Code Here

  }

  @Test(expected = LinterException.class)
  public void shouldFailWhenScriptContainsErrors()
      throws Exception {
    final ResourcePostProcessor processor = new JsLintProcessor() {
      @Override
      protected void onLinterException(final LinterException e, final Resource resource) {
        throw e;
      }
      @Override
      protected String createDefaultOptions() {
        return "maxerr=1";
      }
    };
    processor.process(new StringReader("alert(;"), new StringWriter());
  }
View Full Code Here

  }

  @Test
  public void canBeExecutedMultipleTimes()
      throws Exception {
    final JsLintProcessor processor = new JsLintProcessor();
    final Callable<Void> task = new Callable<Void>() {
      @Override
      public Void call() {
        try {
          processor.process(null, new StringReader("var i = 1;"), new StringWriter());
        } catch (final Exception e) {
          throw new RuntimeException(e);
        }
        return null;
      }
View Full Code Here

TOP

Related Classes of ro.isdc.wro.extensions.processor.js.JsLintProcessor

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.