Package org.springmodules.cache.mock

Examples of org.springmodules.cache.mock.MockCachingModel


        expectGetCacheModelKey();

        for ( int i = 0; i < cachingModelCount; i++ )
        {
            MockCachingModel model = new MockCachingModel();
            CachingModelElementBuilder builder = elementBuilder.cachingModelElementBuilders[i];

            modelParser.parseCachingModel( builder.toXml() );
            modelParserControl.setReturnValue( model );
View Full Code Here


    advisor = new CachingModelSourceAdvisor(interceptor);

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

    modelSourceControl.replay();

    assertTrue(advisor.matches(method, targetClass));
View Full Code Here

  }

  public void testAfterPropertiesSetWhenCacheModelValidatorThrowsException() {
    expectGetCacheModelValidator();

    CachingModel model = new MockCachingModel();
    Map models = new HashMap();
    models.put("key", model);

    InvalidCacheModelException expected = new InvalidCacheModelException("");
    validator.validateCachingModel(model);
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);

      MockCachingModel model = new MockCachingModel();

      editor.setAsText(value);
      editorControl.expectAndReturn(editor.getValue(), model);

      validator.validateCachingModel(model);
View Full Code Here

    interceptor.setCacheKeyGenerator(null);

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

    for (Iterator i = models.entrySet().iterator(); i.hasNext();) {
      Map.Entry entry = (Map.Entry) i.next();
      CachingModel model = (CachingModel) entry.getValue();
View Full Code Here

    cacheProviderFacadeControl.expectAndReturn(cacheProviderFacade
        .getCachingModelEditor(), editor);
  }

  private CachingModel expectGetFromCache(Serializable key, Object expected) {
    MockCachingModel model = new MockCachingModel();
    interceptor.model = model;

    keyGenerator.generateKey(invocation);
    keyGeneratorControl.setReturnValue(key);
View Full Code Here

    String modelId = "Han";
    Cached cachingAttribute = new Cached(modelId);
    mockInterceptor.cachingAttribute = cachingAttribute;

    CachingModel expected = new MockCachingModel();
    Map models = new HashMap();
    models.put(modelId, expected);
    mockInterceptor.setCachingModels(models);

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

  public void testIsInstanceOfWithNull() {
    assertFalse(validator.isInstanceOf(null, Object.class));
  }

  public void testValidateCachingModel() {
    MockCachingModel model = new MockCachingModel();
    validator.cachingModelTargetClass = model.getClass();
    validator.validateCachingModel(model);
    assertTrue(validator.cachingModelPropertiesValidated);
  }
View Full Code Here

    factoryBean.setCacheProviderFacade(cacheProviderFacade);
  }

  private void setUpCachingModels() {
    cachingModels = new HashMap();
    cachingModels.put("get*", new MockCachingModel());
    factoryBean.setCachingModels(cachingModels);
  }
View Full Code Here

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

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

TOP

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

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.