Package org.springmodules.cache.mock

Examples of org.springmodules.cache.mock.MockFlushingModel


    assertSame(modelSource, interceptor.getFlushingModelSource());
  }

  protected void setUp() {
    Map models = new HashMap();
    models.put("java.lang.String.toString", new MockFlushingModel());

    interceptor = new MethodMapFlushingInterceptor();
    interceptor.setFlushingModels(models);
  }
View Full Code Here


    advisor = new FlushingModelSourceAdvisor(interceptor);

    Method method = defaultMethod();
    Class targetClass = method.getDeclaringClass();
    modelSourceControl.expectAndReturn(modelSource.getFlushingModel(method,
        targetClass), new MockFlushingModel());

    modelSourceControl.replay();

    assertTrue(advisor.matches(method, targetClass));
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

  public void testParseFlushingModel() {
    Element element = new DomElementStub("flushing");
    element.setAttribute("when", "after");

    FlushingModel expected = new MockFlushingModel();

    parser.doParseFlushingModel(element, false);
    parserControl.setReturnValue(expected);

    parserControl.replay();
View Full Code Here

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

  public void testAfterPropertiesSetWhenCacheModelValidatorThrowsException() {
    FlushingModel model = new MockFlushingModel();
    Map models = new HashMap();
    models.put("key", model);

    setUpValidator();
    cacheProviderFacadeControl.expectAndReturn(cacheProviderFacade
View Full Code Here

    Map expected = new HashMap();
    for (Iterator i = models.keySet().iterator(); i.hasNext();) {
      String key = (String) i.next();
      String value = models.getProperty(key);

      MockFlushingModel model = new MockFlushingModel();

      editor.setAsText(value);
      editor.getValue();
      editorControl.setReturnValue(model);
View Full Code Here

  public void testAfterPropertiesSetWithNotEmptyCachingModelMapAndKeyGeneratorEqualToNull() {
    setUpValidator();

    Map models = new HashMap();
    for (int i = 0; i < 2; i++) {
      models.put(Integer.toString(i), new MockFlushingModel());
    }

    cacheProviderFacadeControl.expectAndReturn(cacheProviderFacade
        .modelValidator(), validator);
View Full Code Here

    verify();
    assertTrue(interceptor.onAfterPropertiesSetCalled);
  }

  public void testInvokeWhenFlushingAfterMethodExecution() throws Throwable {
    MockFlushingModel model = new MockFlushingModel();
    model.setFlushBeforeMethodExecution(true);
    interceptor.model = model;

    Object expected = expectMethodInvocationCallsProceed();
    cacheProviderFacade.flushCache(model);
View Full Code Here

    assertSame(expected, interceptor.invoke(invocation));
    verify();
  }

  public void testInvokeWhenFlushingBeforeMethodExecution() throws Throwable {
    MockFlushingModel model = new MockFlushingModel();
    model.setFlushBeforeMethodExecution(true);
    interceptor.model = model;

    cacheProviderFacade.flushCache(model);
    Object expected = expectMethodInvocationCallsProceed();
View Full Code Here

TOP

Related Classes of org.springmodules.cache.mock.MockFlushingModel

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.