Package ro.isdc.wro.manager.factory

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


  @Before
  public void setUp() {
    Context.set(Context.standaloneContext());
    MockitoAnnotations.initMocks(this);
    managerFactory = new BaseWroManagerFactory();
    victim = ResourceChangeHandler.create(managerFactory, log);
  }
View Full Code Here


      throws Exception {
    MockitoAnnotations.initMocks(this);
    when(mockFilterConfig.getServletContext()).thenReturn(mockServletContext);
    when(mockResponse.getWriter()).thenReturn(new PrintWriter(new StringWriter()));
    victim = new WroFilter();
    victim.setWroManagerFactory(new BaseWroManagerFactory().setModelFactory(WroTestUtils.simpleModelFactory(new WroModel())));
    victim.init(mockFilterConfig);
  }
View Full Code Here

  private Injector injector;

  @Before
  public void setUp() {
    Context.set(Context.standaloneContext());
    injector = InjectorBuilder.create(new BaseWroManagerFactory()).build();
  }
View Full Code Here

    victim = new ModelAsJsonRequestHandler();

    final WroModel wroModel = createSimpleModelStub();

    when(mockModelFactory.create()).thenReturn(wroModel);
    final WroManagerFactory managerFactory = new BaseWroManagerFactory().setModelFactory(mockModelFactory);
    final Injector injector = InjectorBuilder.create(managerFactory).build();
    injector.inject(victim);

    // Setup response writer
    outputStream = new ByteArrayOutputStream();
View Full Code Here

  @Test
  public void shouldNotProvideProxyUriForExternalResources()
      throws IOException {
    when(mockModelFactory.create()).thenReturn(createWroModelExternalModelStub());
    final WroManagerFactory managerFactory = new BaseWroManagerFactory().setModelFactory(mockModelFactory);
    victim = new ModelAsJsonRequestHandler();
    final Injector injector = InjectorBuilder.create(managerFactory).build();
    injector.inject(victim);

    victim.handle(mockRequest, mockResponse);
View Full Code Here

  }

  @Before
  public void setUp() {
    Context.set(Context.standaloneContext());
    victim = new BaseWroManagerFactory();
  }
View Full Code Here

    victim = new BaseWroManagerFactory();
  }

  @Test
  public void defaultModelFactoryIsXml() {
    new BaseWroManagerFactory() {
      @Override
      protected WroModelFactory newModelFactory() {
        final WroModelFactory modelFactory = super.newModelFactory();
        assertEquals(SmartWroModelFactory.class, modelFactory.getClass());
        return modelFactory;
View Full Code Here

  }

  @Test
  public void shouldWorkAsAPreProcessorWithCssImportPreProcessor()
      throws Exception {
    final BaseWroManagerFactory managerFactory = new BaseWroManagerFactory();
    managerFactory.setProcessorsFactory(new SimpleProcessorsFactory().addPreProcessor(new CssImportPreProcessor()).addPreProcessor(
        new LessCssProcessor()));
    final Injector injector = InjectorBuilder.create(managerFactory).build();
    final PreProcessorExecutor preProcessorExecutor = new PreProcessorExecutor();
    injector.inject(preProcessorExecutor);

    final List<Resource> resources = new ArrayList<Resource>();
    final String baseFolder = "ro/isdc/wro/extensions/processor/lesscss";
    resources.add(Resource.create(String.format("classpath:%s/test/import.css", baseFolder)));
    final String noImports = preProcessorExecutor.processAndMerge(resources,
        ProcessingCriteria.create(ProcessingType.IMPORT_ONLY, true));
    final StringWriter actual = new StringWriter();

    victim = new LessCssProcessor();
    WroTestUtils.createInjector().inject(victim);
    victim.process(null, new StringReader(noImports), actual);

    final String expected = IOUtils.toString(managerFactory.create().getUriLocatorFactory().locate(
        String.format("classpath:%s/expected/import.cssx", baseFolder)));
    assertEquals(expected, actual.toString());
  }
View Full Code Here

  @Before
  public void setUp() {
    initMocks(this);
    Context.set(Context.standaloneContext());
    victim = new DefaultCacheKeyFactory();
    final WroManagerFactory managerFactory = new BaseWroManagerFactory().setGroupExtractor(mockGroupExtractor);
    InjectorBuilder.create(managerFactory).build().inject(victim);
  }
View Full Code Here

      String generateRandomKey() {
        return authKey;
      }
    };
    final CacheKey expected = new CacheKey("group", ResourceType.CSS);
    new InjectorBuilder(new BaseWroManagerFactory()).setResourceWatcher(resourceWatcher).build().inject(victim);
    when(request.getParameter(Mockito.eq(ResourceWatcherRequestHandler.PATH_API))).thenReturn(
        ResourceWatcherRequestHandler.PATH_HANDLER);
    when(request.getParameter(Mockito.eq(ResourceWatcherRequestHandler.PARAM_GROUP_NAME))).thenReturn(
        expected.getGroupName());
    when(request.getParameter(Mockito.eq(ResourceWatcherRequestHandler.PARAM_RESOURCE_TYPE))).thenReturn(
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.