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

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


    assertEquals(0, Context.countActive());
  }

  @Before
  public void setUp() {
    final ResourcePreProcessor decoratedProcessor = new JSMinProcessor();
    processor = CopyrightKeeperProcessorDecorator.decorate(decoratedProcessor);
    Context.set(Context.standaloneContext());
    WroTestUtils.createInjector().inject(decoratedProcessor);
  }
View Full Code Here


  extends SimpleProcessorsFactory {
  public DefaultProcessorsFactory() {
    addPreProcessor(new CssUrlRewritingProcessor());
    addPreProcessor(new CssImportPreProcessor());
    addPreProcessor(new SemicolonAppenderPreProcessor());
    addPreProcessor(new JSMinProcessor());
    addPreProcessor(new JawrCssMinifierProcessor());
    addPostProcessor(new CssVariablesProcessor());
  }
View Full Code Here

    map.put(CssDataUriPreProcessor.ALIAS, new CssDataUriPreProcessor());
    map.put(FallbackCssDataUriProcessor.ALIAS, new FallbackCssDataUriProcessor());
    map.put(DuplicatesAwareCssDataUriPreProcessor.ALIAS_DUPLICATE, new DuplicatesAwareCssDataUriPreProcessor());
    map.put(JawrCssMinifierProcessor.ALIAS, new JawrCssMinifierProcessor());
    map.put(CssMinProcessor.ALIAS, new CssMinProcessor());
    map.put(JSMinProcessor.ALIAS, new JSMinProcessor());
    map.put(VariablizeColorsCssProcessor.ALIAS, new VariablizeColorsCssProcessor());
    map.put(ConformColorsCssProcessor.ALIAS, new ConformColorsCssProcessor());
    map.put(SingleLineCommentStripperProcessor.ALIAS, new SingleLineCommentStripperProcessor());
    map.put(MultiLineCommentStripperProcessor.ALIAS, new MultiLineCommentStripperProcessor());
    map.put(ConsoleStripperProcessor.ALIAS, new ConsoleStripperProcessor());
View Full Code Here

  public void shouldConsiderContributeMethodsWhenManagerFactoryIsExtended() {
    final String alias = "contributed";
    victim = new ConfigurableWroManagerFactory() {
      @Override
      protected void contributePreProcessors(final Map<String, ResourcePreProcessor> map) {
        map.put(alias, new JSMinProcessor());
      }

      @Override
      protected void contributePostProcessors(final Map<String, ResourcePostProcessor> map) {
        map.put(alias, new JSMinProcessor());
      }

      @Override
      protected void contributeLocators(final Map<String, UriLocator> map) {
        map.put(alias, new UrlUriLocator());
View Full Code Here

    new ExceptionHandlingProcessorDecorator(null);
  }

  @Test
  public void shouldInvokeDecoratedProcessor() throws Exception {
    mockProcessor = Mockito.spy(new JSMinProcessor());
    victim = new ExceptionHandlingProcessorDecorator(mockProcessor);
    WroTestUtils.createInjector().inject(victim);

    final String resourceContent = "alert(  1  );";
    final StringWriter writer = new StringWriter();
View Full Code Here

    assertEquals(0, Context.countActive());
  }
 
  @Before
  public void setUp() {
    processor = new JSMinProcessor();
    Context.set(Context.standaloneContext());
    WroTestUtils.createInjector().inject(processor);
  }
View Full Code Here

 
  @Before
  public void setUp() {
    Context.set(Context.standaloneContext());
    MockitoAnnotations.initMocks(this);
    mockProcessorDecorator = Mockito.spy(new ProcessorDecorator(new JSMinProcessor()));
  }
View Full Code Here

    WroTestUtils.compareFromDifferentFoldersByExtension(testFolder, expectedFolder, "css", processor);
  }

  @Test
  public void testMinimizeAwareDecorator1() {
    final ResourcePreProcessor decoratedProcessor = new JSMinProcessor();
    final ResourcePreProcessor processor = CopyrightKeeperProcessorDecorator.decorate(decoratedProcessor);
    Assert.assertTrue(new ProcessorDecorator(processor).isMinimize());
  }
View Full Code Here

      throws Exception {
    final List<Resource> resources = new ArrayList<Resource>();
    final Resource resource = Resource.create("classpath:1.js");
    resource.setMinimize(false);
    resources.add(resource);
    final ResourcePreProcessor preProcessor = CopyrightKeeperProcessorDecorator.decorate(new JSMinProcessor() {
      @Override
      public void process(final Resource resource, final Reader reader, final Writer writer)
          throws IOException {
        Assert.fail("Should not minimize");
      }
View Full Code Here

  }
 
  @Test
  public void shouldApplyEligibleMinimizeAwareProcessors()
      throws Exception {
    final JSMinProcessor cssMinProcessor = Mockito.spy(new JSMinProcessor());
    final BaseWroManagerFactory managerFactory = new BaseWroManagerFactory();
    managerFactory.setProcessorsFactory(new SimpleProcessorsFactory().addPostProcessor(cssMinProcessor));
    managerFactory.setModelFactory(WroTestUtils.simpleModelFactory(new WroModel().addGroup(new Group("g1").addResource(Resource.create("/script.js")))));
    initVictim(new WroConfiguration(), managerFactory);
   
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.