Examples of GlobalSettings


Examples of com.github.tomakehurst.wiremock.global.GlobalSettings

public class GlobalSettingsUpdateTask implements AdminTask {

    @Override
    public ResponseDefinition execute(Admin admin, Request request) {
        GlobalSettings newSettings = Json.read(request.getBodyAsString(), GlobalSettings.class);
        admin.updateGlobalSettings(newSettings);
        return ResponseDefinition.ok();
    }
View Full Code Here

Examples of com.github.tomakehurst.wiremock.global.GlobalSettings

  public static void setGlobalFixedDelay(int milliseconds) {
    defaultInstance.setGlobalFixedDelayVariable(milliseconds);
  }
 
  public void setGlobalFixedDelayVariable(int milliseconds) {
    GlobalSettings settings = new GlobalSettings();
    settings.setFixedDelay(milliseconds);
    admin.updateGlobalSettings(settings);
  }
View Full Code Here

Examples of com.github.tomakehurst.wiremock.global.GlobalSettings

    "}                        ";
 
  @Test
  public void shouldUpdateGlobalSettings() {
        context.checking(new Expectations() {{
            GlobalSettings expectedSettings = new GlobalSettings();
            expectedSettings.setFixedDelay(2000);
            allowing(admin).updateGlobalSettings(expectedSettings);
        }});

    handler.handle(aRequest(context)
        .withUrl("/settings")
View Full Code Here

Examples of hu.lacimol.tutorial.todo.util.GlobalSettings

  public TodoMonitorImpl(PluginScheduler pluginScheduler, TodoService todoService,
      PluginSettingsFactory pluginSettingsFactory) {
   
    this.pluginScheduler = pluginScheduler;
    this.todoService = todoService;
    this.settings = new GlobalSettings(pluginSettingsFactory.createGlobalSettings());
   
    Long loadInterval = this.settings.loadInterval();
    if (loadInterval != null) {
      this.interval = loadInterval;
    }
View Full Code Here

Examples of org.dozer.config.GlobalSettings

      }

      log.info("Initializing Dozer. Version: {}, Thread Name: {}",
              DozerConstants.CURRENT_VERSION, Thread.currentThread().getName());

      GlobalSettings globalSettings = GlobalSettings.getInstance();
      initialize(globalSettings);

      isInitialized = true;
    }
  }
View Full Code Here

Examples of org.dozer.config.GlobalSettings

    log.info("Initializing a new instance of dozer bean mapper.");

    // initialize any bean mapper caches. These caches are only visible to the bean mapper instance and
    // are not shared across the VM.
    GlobalSettings globalSettings = GlobalSettings.getInstance();
    cacheManager.addCache(DozerCacheType.CONVERTER_BY_DEST_TYPE.name(), globalSettings.getConverterByDestTypeCacheMaxSize());
    cacheManager.addCache(DozerCacheType.SUPER_TYPE_CHECK.name(), globalSettings.getSuperTypesCacheMaxSize());

    // stats
    statsMgr.increment(StatisticType.MAPPER_INSTANCES_COUNT);
  }
View Full Code Here

Examples of org.dozer.config.GlobalSettings

    assertFalse(instance.isInitialized());
  }

  @Test(expected=MappingException.class)
  public void testBeanisMissing() {
    GlobalSettings settings = mock(GlobalSettings.class);
    when(settings.getClassLoaderName()).thenReturn(DozerConstants.DEFAULT_CLASS_LOADER_BEAN);
    when(settings.getProxyResolverName()).thenReturn("no.such.class.Found");

    instance.initialize(settings);
    fail();
  }
View Full Code Here

Examples of org.dozer.config.GlobalSettings

    fail();
  }

  @Test(expected=MappingException.class)
  public void testBeanIsNotAssignable() {
    GlobalSettings settings = mock(GlobalSettings.class);
    when(settings.getClassLoaderName()).thenReturn("java.lang.String");
    when(settings.getProxyResolverName()).thenReturn(DozerConstants.DEFAULT_PROXY_RESOLVER_BEAN);

    instance.initialize(settings);
    fail();
  }
View Full Code Here

Examples of org.dozer.config.GlobalSettings

*/
public class GlobalSettingsTest extends AbstractDozerTest {

  @Test
  public void testLoadDefaultPropFile_Default() {
    GlobalSettings globalSettings = GlobalSettings.createNew();
    assertNotNull("loaded by name should not be null", globalSettings.getLoadedByFileName());
    assertEquals("invalid loaded by file name", DozerConstants.DEFAULT_CONFIG_FILE, globalSettings.getLoadedByFileName());
  }
View Full Code Here

Examples of org.dozer.config.GlobalSettings

  @Test
  public void testLoadDefaultPropFile_NotFound() {
    String propFileName = String.valueOf(System.currentTimeMillis());
    System.setProperty(DozerConstants.CONFIG_FILE_SYS_PROP, propFileName);
    GlobalSettings globalSettings = GlobalSettings.createNew();

    // assert all global settings equal the default values
    assertNull("loaded by file name should be null", globalSettings.getLoadedByFileName());
    assertEquals("invalid stats enabled value", DozerConstants.DEFAULT_STATISTICS_ENABLED, globalSettings.isStatisticsEnabled());
    assertEquals("invalid converter cache max size value", DozerConstants.DEFAULT_CONVERTER_BY_DEST_TYPE_CACHE_MAX_SIZE,
        globalSettings.getConverterByDestTypeCacheMaxSize());
    assertEquals("invalid super type cache max size value", DozerConstants.DEFAULT_SUPER_TYPE_CHECK_CACHE_MAX_SIZE, globalSettings
        .getSuperTypesCacheMaxSize());
    assertEquals("invalid autoregister jmx beans", DozerConstants.DEFAULT_AUTOREGISTER_JMX_BEANS, globalSettings
        .isAutoregisterJMXBeans());
    assertEquals(DozerConstants.DEFAULT_PROXY_RESOLVER_BEAN, globalSettings.getProxyResolverName());
    assertEquals(DozerConstants.DEFAULT_CLASS_LOADER_BEAN, globalSettings.getClassLoaderName());
    assertEquals(DozerConstants.DEFAULT_EL_ENABLED, globalSettings.isElEnabled());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.