Package com.gemstone.gemfire.cache

Examples of com.gemstone.gemfire.cache.EvictionAttributes


    factoryBean.setObjectSizer(mockObjectSizer);
    factoryBean.setThreshold(null);
    factoryBean.setType(EvictionType.HEAP_PERCENTAGE);
    factoryBean.afterPropertiesSet();

    EvictionAttributes evictionAttributes = factoryBean.getObject();

    assertNotNull(evictionAttributes);
    assertEquals(EvictionAction.NONE, evictionAttributes.getAction());
    assertSame(mockObjectSizer, evictionAttributes.getObjectSizer());
    assertEquals(EvictionAlgorithm.LRU_HEAP, evictionAttributes.getAlgorithm());
  }
View Full Code Here


    factoryBean.setObjectSizer(null);
    factoryBean.setThreshold(null);
    factoryBean.setType(EvictionType.HEAP_PERCENTAGE);
    factoryBean.afterPropertiesSet();

    EvictionAttributes evictionAttributes = factoryBean.getObject();

    assertNotNull(evictionAttributes);
    assertEquals(EvictionAction.LOCAL_DESTROY, evictionAttributes.getAction());
    assertNull(evictionAttributes.getObjectSizer());
    assertEquals(EvictionAlgorithm.LRU_HEAP, evictionAttributes.getAlgorithm());
  }
View Full Code Here

    factoryBean.setObjectSizer(mockObjectSizer);
    factoryBean.setThreshold(null);
    factoryBean.setType(EvictionType.HEAP_PERCENTAGE);
    factoryBean.afterPropertiesSet();

    EvictionAttributes evictionAttributes = factoryBean.getObject();

    assertNotNull(evictionAttributes);
    assertEquals(EvictionAction.OVERFLOW_TO_DISK, evictionAttributes.getAction());
    assertSame(mockObjectSizer, evictionAttributes.getObjectSizer());
    assertEquals(EvictionAlgorithm.LRU_HEAP, evictionAttributes.getAlgorithm());
  }
View Full Code Here

    factoryBean.setObjectSizer(mockObjectSizer);
    factoryBean.setThreshold(null);
    factoryBean.setType(EvictionType.MEMORY_SIZE);
    factoryBean.afterPropertiesSet();

    EvictionAttributes evictionAttributes = factoryBean.getObject();

    assertNotNull(evictionAttributes);
    assertEquals(EvictionAction.DEFAULT_EVICTION_ACTION, evictionAttributes.getAction());
    assertSame(mockObjectSizer, evictionAttributes.getObjectSizer());
    assertEquals(EvictionAttributesFactoryBean.DEFAULT_MEMORY_MAXIMUM_SIZE, evictionAttributes.getMaximum());
    assertEquals(EvictionAlgorithm.LRU_MEMORY, evictionAttributes.getAlgorithm());
  }
View Full Code Here

    factoryBean.setObjectSizer(null);
    factoryBean.setThreshold(256);
    factoryBean.setType(EvictionType.MEMORY_SIZE);
    factoryBean.afterPropertiesSet();

    EvictionAttributes evictionAttributes = factoryBean.getObject();

    assertNotNull(evictionAttributes);
    assertEquals(EvictionAction.NONE, evictionAttributes.getAction());
    assertNull(evictionAttributes.getObjectSizer());
    assertEquals(256, evictionAttributes.getMaximum());
    assertEquals(EvictionAlgorithm.LRU_MEMORY, evictionAttributes.getAlgorithm());
  }
View Full Code Here

    factoryBean.setObjectSizer(mockObjectSizer);
    factoryBean.setThreshold(1024);
    factoryBean.setType(EvictionType.MEMORY_SIZE);
    factoryBean.afterPropertiesSet();

    EvictionAttributes evictionAttributes = factoryBean.getObject();

    assertNotNull(evictionAttributes);
    assertEquals(EvictionAction.LOCAL_DESTROY, evictionAttributes.getAction());
    assertSame(mockObjectSizer, evictionAttributes.getObjectSizer());
    assertEquals(1024, evictionAttributes.getMaximum());
    assertEquals(EvictionAlgorithm.LRU_MEMORY, evictionAttributes.getAlgorithm());
  }
View Full Code Here

    factoryBean.setObjectSizer(null);
    factoryBean.setThreshold(null);
    factoryBean.setType(EvictionType.MEMORY_SIZE);
    factoryBean.afterPropertiesSet();

    EvictionAttributes evictionAttributes = factoryBean.getObject();

    assertNotNull(evictionAttributes);
    assertEquals(EvictionAction.OVERFLOW_TO_DISK, evictionAttributes.getAction());
    assertNull(evictionAttributes.getObjectSizer());
    assertEquals(EvictionAttributesFactoryBean.DEFAULT_MEMORY_MAXIMUM_SIZE, evictionAttributes.getMaximum());
    assertEquals(EvictionAlgorithm.LRU_MEMORY, evictionAttributes.getAlgorithm());
  }
View Full Code Here

      }
    });

    when(regionFactory.setEvictionAttributes(any(EvictionAttributes.class))).thenAnswer(new Answer<RegionFactory>(){
      @Override public RegionFactory answer(InvocationOnMock invocation) throws Throwable {
        EvictionAttributes evictionAttributes = (EvictionAttributes) invocation.getArguments()[0];
        attributesFactory.setEvictionAttributes(evictionAttributes);
        return regionFactory;
      }
    });
View Full Code Here

TOP

Related Classes of com.gemstone.gemfire.cache.EvictionAttributes

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.