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

Examples of ro.isdc.wro.model.resource.processor.impl.js.JSMinProcessor


    });
  }

  @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


    assertTrue(decorator.isMinimize());
  }

  @Test
  public void shouldComputeCorrectlySupportedResourceTypes() {
    assertTrue(Arrays.equals(new ResourceType[] {ResourceType.JS}, new ProcessorDecorator(new JSMinProcessor()).getSupportedResourceTypes()));
    assertTrue(Arrays.equals(new ResourceType[] {ResourceType.CSS}, new ProcessorDecorator(new CssMinProcessor()).getSupportedResourceTypes()));
    assertTrue(Arrays.equals(ResourceType.values(), new ProcessorDecorator(new CommentStripperProcessor()).getSupportedResourceTypes()));
  }
View Full Code Here

    assertTrue(Arrays.equals(ResourceType.values(), new ProcessorDecorator(new CommentStripperProcessor()).getSupportedResourceTypes()));
  }

  @Test
  public void shouldDetectJsMinAsMinimizeAwareProcessor() {
    assertTrue(new ProcessorDecorator(new JSMinProcessor()).isMinimize());
  }
View Full Code Here

    assertFalse(new ProcessorDecorator(new SemicolonAppenderPreProcessor()).isMinimize());
  }

  @Test(expected = NullPointerException.class)
  public void cannotAcceptNullResourceTypeForIsEligible() {
    assertTrue(new ProcessorDecorator(new JSMinProcessor()).isEligible(true, null));
  }
View Full Code Here

    assertTrue(new ProcessorDecorator(new JSMinProcessor()).isEligible(true, null));
  }

  @Test
  public void shouldComputeEligibilityForMinimizeAwareProcessorWithJsType() {
    assertTrue(new ProcessorDecorator(new JSMinProcessor()).isEligible(true, ResourceType.JS));
    assertFalse(new ProcessorDecorator(new JSMinProcessor()).isEligible(true, ResourceType.CSS));
    assertFalse(new ProcessorDecorator(new JSMinProcessor()).isEligible(false, ResourceType.JS));
    assertFalse(new ProcessorDecorator(new JSMinProcessor()).isEligible(false, ResourceType.CSS));
  }
View Full Code Here

    assertTrue(new ProcessorDecorator(noOpProcessor).isEligible(false, ResourceType.JS));
  }

  @Test
  public void shouldChangeMinimizaFlagWhenInternalMethodIsOverriden() {
    final ResourcePreProcessor processor = new ProcessorDecorator(new JSMinProcessor()) {
      @Override
      protected boolean isMinimizeInternal() {
        return false;
      }
    };
View Full Code Here

    assertFalse(new ProcessorDecorator(processor).isMinimize());
  }

  @Test
  public void shouldChangeSupportedTypesWhenInternalMethodIsOverriden() {
    final ResourcePreProcessor processor = new ProcessorDecorator(new JSMinProcessor()) {
      @Override
      protected SupportedResourceType getSupportedResourceTypeInternal() {
        return null;
      }
    };
View Full Code Here

    assertNull(null, new ProcessorDecorator(processor).getSupportedResourceType());
  }

  @Test
  public void shouldComputeIsMinimizeFlagOfDeepNestedDecoratedProcessor() {
    final ProcessorDecorator processor = new ProcessorDecorator(new ProcessorDecorator(new ProcessorDecorator(new JSMinProcessor())));
    assertTrue(processor.isMinimize());
  }
View Full Code Here

    new SupportAwareProcessorDecorator(null);
  }
 
  @Test
  public void shouldCorrectlyDetectSupportOfDeepNestedProcessor() {
    victim = new SupportAwareProcessorDecorator(new ProcessorDecorator(new ProcessorDecorator(new JSMinProcessor())));
    assertTrue(victim.isSupported());
  }
View Full Code Here

  }
 
  @Test
  public void shouldApplyProcessorOnlyOnResourcesWithExtensionJs()
      throws Exception {
    final ResourcePreProcessor decoratedProcessor = new JSMinProcessor();
    final ResourcePreProcessor processor = ExtensionsAwareProcessorDecorator.decorate(decoratedProcessor).addExtension(
        "js");
    WroTestUtils.createInjector().inject(processor);
    // we use test resource relative to TestProcessorsUtils class
    final URL url = ResourcePreProcessor.class.getResource("extensionAware");
View Full Code Here

TOP

Related Classes of ro.isdc.wro.model.resource.processor.impl.js.JSMinProcessor

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.