Package org.springmodules.cache

Examples of org.springmodules.cache.FlushingModel


    boolean flushBeforeMethodExecution = true;

    Element element = new DomElementStub("flushing");
    element.setAttribute("cacheNames", cacheNames);

    FlushingModel actual = parser.doParseFlushingModel(element,
        flushBeforeMethodExecution);
    GigaSpacesFlushingModel expected = new GigaSpacesFlushingModel(cacheNames);
    expected.setFlushBeforeMethodExecution(flushBeforeMethodExecution);

    assertEquals(expected, actual);
View Full Code Here


    boolean flushBeforeMethodExecution = true;

    Element element = new DomElementStub("flushing");
    element.setAttribute("groups", groups);

    FlushingModel actual = parser.doParseFlushingModel(element,
        flushBeforeMethodExecution);
    OsCacheFlushingModel expected = new OsCacheFlushingModel(groups);
    expected.setFlushBeforeMethodExecution(flushBeforeMethodExecution);

    assertEquals(expected, actual);
View Full Code Here

  /**
   * @see AbstractFlushingInterceptor#getModel(MethodInvocation)
   */
  protected final FlushingModel getModel(MethodInvocation methodInvocation) {
    Map flushingModels = getFlushingModels();
    FlushingModel model = null;

    if (flushingModels != null && !flushingModels.isEmpty()) {
      FlushCache attribute = getFlushingAttribute(methodInvocation);
      if (attribute != null) {
        String id = attribute.getModelId();
View Full Code Here

  public NameMatchFlushingModelSourceTests(String name) {
    super(name);
  }

  public void testGetCachingModel() {
    FlushingModel expected = new MockFlushingModel();
    models.put(method.getName(), expected);

    assertSame(expected, source.getFlushingModel(method, null));
  }
View Full Code Here

    invocationControl.expectAndReturn(invocation.getThis(), thisObject);

    Method method = defaultMethod();
    invocationControl.expectAndReturn(invocation.getMethod(), method);

    FlushingModel expected = new MockFlushingModel();
    sourceControl.expectAndReturn(source.getFlushingModel(method, thisObject
        .getClass()), expected);

    replay();
View Full Code Here

    invocationControl.expectAndReturn(invocation.getThis(), null);

    Method method = defaultMethod();
    invocationControl.expectAndReturn(invocation.getMethod(), method);

    FlushingModel expected = new MockFlushingModel();
    sourceControl.expectAndReturn(source.getFlushingModel(method, null),
        expected);

    replay();
View Full Code Here

    String modelId = "Han";
    FlushCache flushingAttribute = new FlushCache(modelId);
    mockInterceptor.flushingAttribute = flushingAttribute;

    FlushingModel expected = new MockFlushingModel();
    Map models = new HashMap();
    models.put(modelId, expected);
    mockInterceptor.setFlushingModels(models);

    assertSame(expected, mockInterceptor.getModel(invocation));
View Full Code Here

  private void expectAfterPropertiesSetOnFlushingInterceptor() {
    cacheProviderFacadeControl.expectAndReturn(cacheProviderFacade
        .modelValidator(), validator);
    for (Iterator i = flushingModels.entrySet().iterator(); i.hasNext();) {
      Map.Entry entry = (Map.Entry) i.next();
      FlushingModel model = (FlushingModel) entry.getValue();
      validator.validateFlushingModel(model);
    }
  }
View Full Code Here

  public void testOnAfterPropertiesSetWithFlushingModelSourceEqualToNull()
      throws Exception {
    interceptor.setFlushingModelSource(null);

    FlushingModel model1 = new MockFlushingModel();
    FlushingModel model2 = new MockFlushingModel();

    Map flushingModels = new HashMap();
    flushingModels.put("java.lang.String.indexO*", model1);
    flushingModels.put("java.lang.String.toUpperC*", model2);
    interceptor.setFlushingModels(flushingModels);
View Full Code Here

  protected void setUp() {
    interceptor = new NameMatchFlushingInterceptor();
  }

  private Map createNotEmptyModelMap() {
    FlushingModel model = new MockFlushingModel();
    Map models = new HashMap();
    models.put("get*", model);
    return models;
  }
View Full Code Here

TOP

Related Classes of org.springmodules.cache.FlushingModel

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.