Package org.springmodules.cache.mock

Examples of org.springmodules.cache.mock.MockFlushingModel


        expectGetCacheModelKey();

        for ( int i = 0; i < flushingModelCount; i++ )
        {
            FlushingModelElementBuilder builder = elementBuilder.flushingModelElementBuilders[i];
            MockFlushingModel model = new MockFlushingModel();

            modelParser.parseFlushingModel( builder.toXml() );
            modelParserControl.setReturnValue( model );

            flushingModelMap.put( builder.target, model );
View Full Code Here


      // expecting exception.
    }
  }

  public void testValidateFlushingModel() {
    MockFlushingModel model = new MockFlushingModel();
    validator.flushingModelTargetClass = model.getClass();
    validator.validateFlushingModel(model);
    assertTrue(validator.flushingModelPropertiesValidated);
  }
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

  protected void setUp() throws Exception {
    setUpCacheProviderFacadeAsMockObject();

    key = "Key";
    cachingModel = new MockCachingModel();
    flushingModel = new MockFlushingModel();
  }
View Full Code Here

    assertEquals(expectedProxyInterfaces[0], actualProxyInterfaces[0]);
  }

  protected void setUp() {
    flushingModels = new HashMap();
    flushingModels.put("update*", new MockFlushingModel());

    factoryBean = new CacheProxyFactoryBean();
    factoryBean.setFlushingModels(flushingModels);
    setUpCachingModels();

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

  public void testOnAfterPropertiesSetWithFlushingModelSourceEqualToNullAndNewModelSourceThrowingException() {
    interceptor.setFlushingModelSource(null);

    Map flushingModels = new HashMap();
    flushingModels.put("indexO*", new MockFlushingModel());
    interceptor.setFlushingModels(flushingModels);

    try {
      interceptor.onAfterPropertiesSet();
      fail();
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.