Package ro.isdc.wro.manager.factory

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


  }

  @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 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

    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

  private ResourceChangeDetector victim;

  @Before
  public void setUp() {
    Context.set(Context.standaloneContext());
    final WroManagerFactory managerFactory = new BaseWroManagerFactory()
        .setUriLocatorFactory(new SimpleUriLocatorFactory().addLocator(WroTestUtils.createResourceMockingLocator()));
    final Injector injector = InjectorBuilder.create(managerFactory).build();
    injector.inject(this);
  }
View Full Code Here

  /**
   * @param wroManagerFactory
   */
  private void initExecutor(final ResourcePreProcessor... preProcessors) {
    final WroManagerFactory wroManagerFactory = createWroManager(preProcessors);
    final Injector injector = InjectorBuilder.create(wroManagerFactory).build();
    victim = new PreProcessorExecutor();
    injector.inject(victim);
  }
View Full Code Here

        return new ByteArrayInputStream("".getBytes());
      }
    };
    final UriLocatorFactory locatorFactory = new SimpleUriLocatorFactory().addLocator(emptyStreamLocator);
    // init executor
    final WroManagerFactory managerFactory = new BaseWroManagerFactory().setUriLocatorFactory(locatorFactory);
    InjectorBuilder.create(managerFactory).build().inject(victim);

    final List<Resource> resources = new ArrayList<Resource>();
    resources.add(Resource.create("/resource.js"));
    victim.processAndMerge(resources, true);
View Full Code Here

      throws Exception {
    final List<Resource> resources = new ArrayList<Resource>();
    resources.add(Resource.create("var a=1;//comment", ResourceType.JS));
    resources.add(Resource.create("a=2;", ResourceType.JS));
    final UriLocatorFactory locatorFactory = new SimpleUriLocatorFactory().addLocator(WroTestUtils.createResourceMockingLocator());
    final WroManagerFactory managerFactory = new BaseWroManagerFactory().setUriLocatorFactory(locatorFactory).setProcessorsFactory(
        new SimpleProcessorsFactory());
    InjectorBuilder.create(managerFactory).build().inject(victim);

    final String result = victim.processAndMerge(resources, false);
    compare("var a=1;//comment\na=2;\n", result);
View Full Code Here

      throws Exception {
    final List<Resource> resources = new ArrayList<Resource>();
    resources.add(Resource.create("1\n\n", ResourceType.JS));
    resources.add(Resource.create("2", ResourceType.JS));
    final UriLocatorFactory locatorFactory = new SimpleUriLocatorFactory().addLocator(WroTestUtils.createResourceMockingLocator());
    final WroManagerFactory managerFactory = new BaseWroManagerFactory().setUriLocatorFactory(locatorFactory).setProcessorsFactory(
        new SimpleProcessorsFactory());
    InjectorBuilder.create(managerFactory).build().inject(victim);

    final String result = victim.processAndMerge(resources, false);
    compare("1\n2", result);
View Full Code Here

TOP

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

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.