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

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


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


* @created Created on Apr 21, 2010
*/
public class TestBeautifyJsProcessor {
  @Test
  public void testFromFolder() throws IOException {
    final ResourcePostProcessor processor = new BeautifyJsProcessor();
    final URL url = getClass().getResource("beautify");

    final File testFolder = new File(url.getFile(), "test");
    final File expectedFolder = new File(url.getFile(), "expected");
    WroTestUtils.compareFromDifferentFoldersByExtension(testFolder, expectedFolder, "js", processor);
View Full Code Here

  }


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

    WroTestUtils.runConcurrently(task);
  }

  @Test
  public void shouldSupportCorrectResourceTypes() {
    WroTestUtils.assertProcessorSupportResourceTypes(new BeautifyJsProcessor(), ResourceType.JS);
  }
View Full Code Here

   * Perform a beautify operation on javascript by nicely formatting it.
   *
   * @return A new {@link BeautifyJsProcessor}.
   */
  public static BeautifyJsProcessor beautifyJs() {
    return new BeautifyJsProcessor();
  }
View Full Code Here

TOP

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

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.