Package org.ngrinder.infra.config

Examples of org.ngrinder.infra.config.Config


  public void before() {
  }

  @Test
  public void testGetRegionsInCluster() throws IOException {
    Config spiedConfig = spy(config);
    when(spiedConfig.isClustered()).thenReturn(true);
    when(spiedConfig.getRegion()).thenReturn("TEST_REGION");

    RegionService spiedRegionService = spy(regionService);
    spiedRegionService.setConfig(spiedConfig);

    curAddress = removeScopedMarkerFromIP(NetworkUtils.DEFAULT_LOCAL_ADDRESSES.get(0).getHostAddress());
    when(spiedConfig.getClusterURIs()).thenReturn(new String[]{curAddress, "210.10.10.1"});

    DynamicCacheConfig cacheConfig = new DynamicCacheConfig();
    ReflectionTestUtils.setField(cacheConfig, "config", spiedConfig);
    cacheManager = cacheConfig.dynamicCacheManager();
    cacheManager.afterPropertiesSet();
View Full Code Here


public class PeriodicCollectDataToGAServiceTest {

  @Test
  public void testReport() {
    Config configMock = mock(Config.class);
    when(configMock.isUsageReportEnabled()).thenReturn(true);
    when(configMock.getVersion()).thenReturn("test-0.0.1");
    PeriodicCollectDataToGAService gaService = new PeriodicCollectDataToGAService() {
      @Override
      protected int getUsage(Date start, Date end) {
        return 10;
      }
View Full Code Here

    // Given
    File testHomeDir = new ClassPathResource("world.py").getFile().getParentFile();
    Home mockHome = new Home(testHomeDir);
    LOG.debug("mock home dir is:{}", mockHome.getDirectory());
    Config mockConfig = spy(config);
    when(mockConfig.getHome()).thenReturn(mockHome);
    PerfTestService mockService = spy(testService);
    mockService.setConfig(mockConfig);

    // When
    // TPS,Errors,Mean_Test_Time_(ms)
View Full Code Here

    // Given
    long testId = 123456L; // there is sample monitor data in test resources.
    File testHomeDir = new ClassPathResource("world.py").getFile().getParentFile();
    Home mockHome = new Home(testHomeDir);
    LOG.debug("mock home dir is:{}", mockHome.getDirectory());
    Config mockConfig = spy(config);
    when(mockConfig.getHome()).thenReturn(mockHome);
    PerfTestService mockService = spy(testService);
    mockService.setConfig(mockConfig);

    // When
    int interval = mockService.getMonitorGraphInterval(testId, "127.0.0.1", 700);
View Full Code Here

    perfTestConfig.setApplicationContext(applicationContext);
  }

  @Test
  public void testGetPerfTestCandidate() {
    Config spiedConfig = spy(config);
    when(spiedConfig.isClustered()).thenReturn(true);
    ReflectionTestUtils.setField(perfTestConfig, "config", spiedConfig);

    PerfTestService clusteredPerfTest = perfTestConfig.perfTestService();

    PerfTest test = clusteredPerfTest.getNextRunnablePerfTestPerfTestCandidate();
View Full Code Here

TOP

Related Classes of org.ngrinder.infra.config.Config

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.