Package ro.isdc.wro.config.jmx

Examples of ro.isdc.wro.config.jmx.WroConfiguration


    assertEquals(ConfigurableWroManagerFactory.class, victim.getFactory().getClass());
  }

  @Test
  public void shouldCreateManagerFactory() {
    final WroConfiguration config = new WroConfiguration();
    config.setWroManagerClassName(NoProcessorsWroManagerFactory.class.getName());
    victim = DefaultWroManagerFactory.create(config);
    assertEquals(NoProcessorsWroManagerFactory.class, victim.getFactory().getClass());
  }
View Full Code Here


      final ByteArrayOutputStream out = new ByteArrayOutputStream();
      Mockito.when(response.getOutputStream()).thenReturn(new DelegatingServletOutputStream(out));
      Mockito.when(request.getRequestURI()).thenReturn(requestUri);

      final WroConfiguration config = new WroConfiguration();
      config.setIgnoreFailingProcessor(true);
      Context.unset();
      Context.set(Context.webContext(request, response, Mockito.mock(FilterConfig.class)), config);

      onBeforeProcess();
View Full Code Here

  @Test
  public void testConfigureCacheUpdatePeriod() {
    Mockito.when(filterConfig.getInitParameter(ConfigConstants.cacheUpdatePeriod.name())).thenReturn("10");
    factory = new FilterConfigWroConfigurationFactory(filterConfig);
    final WroConfiguration config = factory.create();
    Assert.assertEquals(10, config.getCacheUpdatePeriod());
    Assert.assertEquals(true, config.isDebug());
  }
View Full Code Here

  @Test
  public void testConfigureDebug() {
    Mockito.when(filterConfig.getInitParameter(ConfigConstants.debug.name())).thenReturn("false");
    factory = new FilterConfigWroConfigurationFactory(filterConfig);
    final WroConfiguration config = factory.create();
    Assert.assertEquals(false, config.isDebug());
  }
View Full Code Here

  public void testConfigurationTypeBackwardCompatibility() {
    Mockito.when(filterConfig.getInitParameter(ConfigConstants.debug.name())).thenReturn("true");
    Mockito.when(filterConfig.getInitParameter(FilterConfigWroConfigurationFactory.PARAM_CONFIGURATION)).thenReturn(
        FilterConfigWroConfigurationFactory.PARAM_VALUE_DEPLOYMENT);
    factory = new FilterConfigWroConfigurationFactory(filterConfig);
    final WroConfiguration config = factory.create();
    Assert.assertEquals(false, config.isDebug());
  }
View Full Code Here

   * @return {@link WroConfiguration} object.
   */
  private WroConfiguration createConfiguration() {
    // Extract config from servletContext (if already configured)
    // TODO use a named helper
    final WroConfiguration configAttribute = ServletContextAttributeHelper.create(filterConfig).getWroConfiguration();
    if (configAttribute != null) {
      setConfiguration(configAttribute);
    }
    return getWroConfigurationFactory().create();
  }
View Full Code Here

  /**
   * @return the {@link WroConfiguration} extracted from {@link ServletContext} if exist or default one otherwise.
   */
  private WroConfiguration getWroConfiguration() {
    final WroConfiguration configAttribute = getServletContextAttributeHelper().getWroConfiguration();
    final WroConfiguration config = configAttribute != null ? configAttribute : new WroConfiguration();
    return config;
  }
View Full Code Here

  }

  @Test
  public void testConfigureCacheUpdatePeriod() {
    Mockito.when(filterConfig.getInitParameter(ConfigConstants.cacheUpdatePeriod.name())).thenReturn("10");
    final WroConfiguration config = factory.create();
    Assert.assertEquals(10, config.getCacheUpdatePeriod());
    Assert.assertEquals(true, config.isDebug());
  }
View Full Code Here

        props.put(ConfigConstants.modelUpdatePeriod.name(), "30");
        return props;
      }
    };
    Mockito.when(filterConfig.getInitParameter(ConfigConstants.cacheUpdatePeriod.name())).thenReturn("10");
    final WroConfiguration config = factory.create();
    Assert.assertEquals(10, config.getCacheUpdatePeriod());
    Assert.assertEquals(true, config.isDebug());
    // This value should be overriden
    Assert.assertEquals(10, config.getCacheUpdatePeriod());
    // This value should be the same as defined in properties
    Assert.assertEquals(30, config.getModelUpdatePeriod());
  }
View Full Code Here

  }

  @Test
  public void testConfigureDebug() {
    Mockito.when(filterConfig.getInitParameter(ConfigConstants.debug.name())).thenReturn("false");
    final WroConfiguration config = factory.create();
    Assert.assertEquals(false, config.isDebug());
  }
View Full Code Here

TOP

Related Classes of ro.isdc.wro.config.jmx.WroConfiguration

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.