Package ro.isdc.wro.config.jmx

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


        props.put(ConfigConstants.debug.name(), Boolean.TRUE.toString());
        return props;
      }
    };
    Mockito.when(filterConfig.getInitParameter(ConfigConstants.debug.name())).thenReturn(Boolean.FALSE.toString());
    final WroConfiguration config = factory.create();
    Assert.assertEquals(false, config.isDebug());
  }
View Full Code Here


        final Properties props = new Properties();
        props.put(ConfigConstants.debug.name(), Boolean.TRUE.toString());
        return props;
      }
    };
    final WroConfiguration config = factory.create();
    Assert.assertEquals(true, config.isDebug());
  }
View Full Code Here

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

        return props;
      }
    };
    Mockito.when(filterConfig.getInitParameter(FilterConfigWroConfigurationFactory.PARAM_CONFIGURATION)).thenReturn(
        FilterConfigWroConfigurationFactory.PARAM_VALUE_DEPLOYMENT);
    final WroConfiguration config = factory.create();
    Assert.assertEquals(false, config.isDebug());
  }
View Full Code Here

  /**
   * Set a context with default configuration to current thread.
   */
  public static void set(final Context context) {
    set(context, new WroConfiguration());
  }
View Full Code Here

   *           when any IO related problem occurs or if the request cannot be processed.
   */
  public final void process()
      throws IOException {
    // reschedule cache & model updates
    final WroConfiguration config = Context.get().getConfig();
    cacheSchedulerHelper.scheduleWithPeriod(config.getCacheUpdatePeriod());
    modelSchedulerHelper.scheduleWithPeriod(config.getModelUpdatePeriod());
    resourceBundleProcessor.serveProcessedBundle();
  }
View Full Code Here

  /**
   * Initialize {@link WroConfiguration} object with cacheUpdatePeriod & modelUpdatePeriod equal with provided argument.
   */
  private WroConfiguration newConfigWithUpdatePeriodValue(final long periodValue) {
    final WroConfiguration config = new WroConfiguration();
    config.setCacheUpdatePeriod(periodValue);
    config.setModelUpdatePeriod(periodValue);
    return config;
  }
View Full Code Here

  private void genericIgnoreMissingResourceTest(final boolean ignoreFlag)
      throws Exception {
    new GenericTestBuilder() {
      @Override
      protected void onBeforeProcess() {
        final WroConfiguration config = Context.get().getConfig();
        config.setIgnoreFailingProcessor(ignoreFlag);
        config.setIgnoreMissingResources(ignoreFlag);
      };
    }.processAndCompare("/invalidImport.css", "classpath:ro/isdc/wro/manager/invalidImport-out.css");
  }
View Full Code Here

      throws Exception {
    final HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
    Mockito.when(request.getRequestURI()).thenReturn("/app/g1.css");
    final Context context = Context.webContext(request,
        Mockito.mock(HttpServletResponse.class, Mockito.RETURNS_DEEP_STUBS), Mockito.mock(FilterConfig.class));
    final WroConfiguration config = new WroConfiguration();
    // make it run each 1 second
    config.setModelUpdatePeriod(1);
    config.setCacheUpdatePeriod(1);
    Context.unset();
    Context.set(context, config);

    managerFactory.create().process();
    // let scheduler run a while
View Full Code Here

      throws Exception {
    final HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
    final HttpServletResponse response = Context.get().getResponse();
    Mockito.when(request.getRequestURI()).thenReturn("/noResources.css");

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

    final WroModel model = new WroModel();
    model.addGroup(new Group("noResources"));
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.