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

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


  }

  @Test
  public void shouldUseReservedNames()
      throws IOException {
    final ResourcePostProcessor processor = new UglifyJsProcessor() {
      @Override
      protected UglifyJs newEngine() {
        return super.newEngine().setReservedNames("name,value");
      }
    };
View Full Code Here


public class TestJsonHPackProcessor {

  @Test
  public void testPackFromFolder()
      throws Exception {
    final ResourcePostProcessor processor = JsonHPackProcessor.packProcessor();
    final URL url = getClass().getResource("jsonhpack");

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

  }

  @Test
  public void testUnpackFromFolder()
      throws Exception {
    final ResourcePostProcessor processor = JsonHPackProcessor.unpackProcessor();
    final URL url = getClass().getResource("jsonhpack");

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

    genericThreadSafeTest(false);
  }

  private void genericThreadSafeTest(boolean pack)
      throws Exception {
    final ResourcePostProcessor processor = new JsonHPackProcessor(pack);
    final Callable<Void> task = new Callable<Void>() {
      public Void call() {
        try {
          processor.process(new StringReader("{p : 1}"), new StringWriter());
        } catch (final Exception e) {
          throw new RuntimeException(e);
        }
        return null;
      }
View Full Code Here

public class TestCJsonProcessor {

  @Test
  public void testPackFromFolder()
      throws Exception {
    final ResourcePostProcessor processor = new CJsonProcessor(true) {
      @Override
      protected void onException(final WroRuntimeException e) {
        throw e;
      }
    };
View Full Code Here

  }

  @Test
  public void testUnpackFromFolder()
      throws Exception {
    final ResourcePostProcessor processor = new CJsonProcessor(false) {
      @Override
      protected void onException(final WroRuntimeException e) {
        throw e;
      }
    };
View Full Code Here

* @created Created on Nov 6, 2010
*/
public class TestDojoShrinksafeCompressorProcessor {
  @Test
  public void testFromFolder() throws IOException {
    final ResourcePostProcessor processor = new DojoShrinksafeCompressorProcessor();
    final URL url = getClass().getResource("dojo");

    final File testFolder = new File(ClassLoader.getSystemResource("test").getFile());

    final File expectedFolder = new File(url.getFile(), "expected");
View Full Code Here

        return getPostProcessorStrategies(provider);
      }
     
      @Override
      protected ResourcePostProcessor getStrategyForAlias(final String alias) {
        ResourcePostProcessor processor = super.getStrategyForAlias(alias);
        if (processor == null) {
          final String extension = FilenameUtils.getExtension(alias);
          boolean hasExtension = !StringUtils.isEmpty(extension);
          if (hasExtension) {
            final String processorName = FilenameUtils.getBaseName(alias);
View Full Code Here

      try {
        targetFile = new File(sourceFolder, toTargetFileName.transform(file.getName()));
        final InputStream targetFileStream = new FileInputStream(targetFile);
        LOG.debug("comparing with: {}", targetFile.getName());
        try {
          compare(new FileInputStream(file), targetFileStream, new ResourcePostProcessor() {
            public void process(final Reader reader, final Writer writer)
                throws IOException {
              // ResourceType doesn't matter here
              processor.process(Resource.create("file:" + file.getPath(), ResourceType.CSS), reader, writer);
            }
View Full Code Here

        targetFile = new File(targetFolder, toTargetFileName.transform(file.getName()));
        final InputStream targetFileStream = new FileInputStream(targetFile);
        LOG.debug("=========== processing: {} ===========", file.getName());
        // ResourceType doesn't matter here
        try {
          compare(new FileInputStream(file), targetFileStream, new ResourcePostProcessor() {
            public void process(final Reader reader, final Writer writer)
                throws IOException {
              // ResourceType doesn't matter here
              ResourceType resourceType = ResourceType.CSS;
              try {
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.