Package ro.isdc.wro.manager.factory

Examples of ro.isdc.wro.manager.factory.BaseWroManagerFactory


  }

  @Test
  public void testCRC32Fingerprint()
      throws Exception {
    final WroManagerFactory factory = new BaseWroManagerFactory().setModelFactory(getValidModelFactory()).setHashStrategy(
        new CRC32HashStrategy());
    final WroManager manager = factory.create();
    final String path = manager.encodeVersionIntoGroupPath("g3", ResourceType.CSS, true);
    assertEquals("1d62dbaf/g3.css?minimize=true", path);
  }
View Full Code Here


  }

  @Test
  public void testMD5Fingerprint()
      throws Exception {
    final WroManagerFactory factory = new BaseWroManagerFactory().setModelFactory(getValidModelFactory()).setHashStrategy(
        new MD5HashStrategy());
    final WroManager manager = factory.create();
    final String path = manager.encodeVersionIntoGroupPath("g3", ResourceType.CSS, true);
    assertEquals("9394d6cdd0a75a5f695c84eda410103f/g3.css?minimize=true", path);
  }
View Full Code Here

  @Test
  public void shouldDestroyDestroyableProcessorWhenManagerIsDestroyed() {
    final DestroyableProcessor preProcessor = Mockito.mock(DestroyableProcessor.class);
    final DestroyableProcessor postProcessor = Mockito.mock(DestroyableProcessor.class);
    victim = new BaseWroManagerFactory().setProcessorsFactory(
        new SimpleProcessorsFactory().addPreProcessor(preProcessor).addPostProcessor(postProcessor)).create();
    victim.destroy();
    Mockito.verify(preProcessor, Mockito.times(1)).destroy();
    Mockito.verify(postProcessor, Mockito.times(1)).destroy();
  }
View Full Code Here

  }


  @Test
  public void shouldUseTheWroManagerSet() {
    final WroManagerFactory managerFactory = new BaseWroManagerFactory();
    victim.setManagerFactory(managerFactory);
    victim.contextInitialized(mockServletContextEvent);
    Assert.assertSame(managerFactory, AbstractDecorator.getOriginalDecoratedObject(victim.getManagerFactory()));
  }
View Full Code Here

  }


  @Test
  public void shouldUseOverridenManagerFactory() {
    final WroManagerFactory managerFactory = new BaseWroManagerFactory();
    victim = new WroServletContextListener() {
      @Override
      protected WroManagerFactory newManagerFactory() {
        return managerFactory;
      }
View Full Code Here

    mockReader = new StringReader("");
    mockWriter = new StringWriter();
  }

  private void initVictim() {
    InjectorBuilder.create(new BaseWroManagerFactory()).build().inject(victim);
  }
View Full Code Here

  public void tearDown() {
    Context.unset();
  }
 
  final void initProcessor(final ResourcePreProcessor processor) {
    final BaseWroManagerFactory factory = new BaseWroManagerFactory();
    factory.setUriLocatorFactory(createLocatorFactory());
    factory.setProcessorsFactory(new SimpleProcessorsFactory().addPreProcessor(processor));
    final Injector injector = InjectorBuilder.create(factory).build();
    injector.inject(processor);
  }
View Full Code Here

    model.addGroup(new Group(GROUP_2).addResource(Resource.create(RESOURCE_JS_URI)).addResource(
        Resource.create("/path/2.js")));
    model.addGroup(new Group(MIXED_GROUP_NAME).addResource(Resource.create(RESOURCE_CSS_URI)).addResource(
        Resource.create(RESOURCE_JS_URI)));
    final WroModelFactory modelFactory = WroTestUtils.simpleModelFactory(model);
    final WroManagerFactory factory = new BaseWroManagerFactory().setModelFactory(modelFactory).setUriLocatorFactory(
        locatorFactory).setCacheStrategy(cacheStrategy);
    final Injector injector = InjectorBuilder.create(factory).build();
    return injector;
  }
View Full Code Here

  /**
   * Initialize the locator by injecting all required fields.
   */
  private void initLocator(final ServletContextUriLocator locator) {
    final Injector injector = InjectorBuilder.create(new BaseWroManagerFactory()).build();
    injector.inject(locator);
  }
View Full Code Here

    locatorFactory.addLocator(locator);
    final DispatcherStreamLocator dispatcherLocator = Mockito.mock(DispatcherStreamLocator.class);
    when(
        dispatcherLocator.getInputStream(Mockito.any(HttpServletRequest.class), Mockito.any(HttpServletResponse.class),
            Mockito.anyString())).thenReturn(WroUtil.EMPTY_STREAM);
    final Injector injector = InjectorBuilder.create(new BaseWroManagerFactory().setUriLocatorFactory(locatorFactory)).setDispatcherLocator(
        dispatcherLocator).build();
    final LocatorFactoryHolder locatorFactoryHolder = new LocatorFactoryHolder();
    injector.inject(locatorFactoryHolder);
    final String uri = "/style.css";
    locatorFactoryHolder.locatorFactory.locate(uri);
View Full Code Here

TOP

Related Classes of ro.isdc.wro.manager.factory.BaseWroManagerFactory

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.