Search in sources :

Example 1 with AbstractStoreConfiguration

use of org.infinispan.configuration.cache.AbstractStoreConfiguration in project infinispan by infinispan.

the class AbstractConfigurationSerializerTest method compareStoreConfiguration.

protected void compareStoreConfiguration(String name, StoreConfiguration beforeStore, StoreConfiguration afterStore) {
    if (beforeStore instanceof AbstractStoreConfiguration) {
        AbstractStoreConfiguration beforeASC = (AbstractStoreConfiguration) beforeStore;
        AbstractStoreConfiguration afterASC = (AbstractStoreConfiguration) afterStore;
        compareAttributeSets(name, beforeASC.attributes(), afterASC.attributes());
        compareAttributeSets(name, beforeASC.async().attributes(), afterASC.async().attributes());
    } else {
        throw new IllegalArgumentException("Cannot compare stores of type: " + beforeStore.getClass().getName());
    }
}
Also used : AbstractStoreConfiguration(org.infinispan.configuration.cache.AbstractStoreConfiguration)

Example 2 with AbstractStoreConfiguration

use of org.infinispan.configuration.cache.AbstractStoreConfiguration in project infinispan by infinispan.

the class XmlFileParsingTest method testStoreWithNoConfigureBy.

public void testStoreWithNoConfigureBy() {
    String config = TestingUtil.wrapXMLWithoutSchema("<cache-container default-cache=\"default\">" + "   <local-cache name=\"default\">\n" + "      <persistence >\n" + "         <store class=\"org.infinispan.configuration.XmlFileParsingTest$GenericLoader\" preload=\"true\" fetch-state=\"true\" />\n" + "      </persistence >\n" + "   </local-cache>\n" + "</cache-container>");
    ConfigurationBuilderHolder holder = parseStringConfiguration(config);
    PersistenceConfiguration cfg = holder.getDefaultConfigurationBuilder().build().persistence();
    StoreConfiguration storeConfiguration = cfg.stores().get(0);
    assertTrue(storeConfiguration instanceof AbstractStoreConfiguration);
    AbstractStoreConfiguration abstractStoreConfiguration = (AbstractStoreConfiguration) storeConfiguration;
    assertTrue(abstractStoreConfiguration.fetchPersistentState());
    assertTrue(abstractStoreConfiguration.preload());
}
Also used : PersistenceConfiguration(org.infinispan.configuration.cache.PersistenceConfiguration) ConfigurationBuilderHolder(org.infinispan.configuration.parsing.ConfigurationBuilderHolder) AbstractStoreConfiguration(org.infinispan.configuration.cache.AbstractStoreConfiguration) SoftIndexFileStoreConfiguration(org.infinispan.persistence.sifs.configuration.SoftIndexFileStoreConfiguration) AbstractStoreConfiguration(org.infinispan.configuration.cache.AbstractStoreConfiguration) StoreConfiguration(org.infinispan.configuration.cache.StoreConfiguration) DummyInMemoryStoreConfiguration(org.infinispan.persistence.dummy.DummyInMemoryStoreConfiguration)

Aggregations

AbstractStoreConfiguration (org.infinispan.configuration.cache.AbstractStoreConfiguration)2 PersistenceConfiguration (org.infinispan.configuration.cache.PersistenceConfiguration)1 StoreConfiguration (org.infinispan.configuration.cache.StoreConfiguration)1 ConfigurationBuilderHolder (org.infinispan.configuration.parsing.ConfigurationBuilderHolder)1 DummyInMemoryStoreConfiguration (org.infinispan.persistence.dummy.DummyInMemoryStoreConfiguration)1 SoftIndexFileStoreConfiguration (org.infinispan.persistence.sifs.configuration.SoftIndexFileStoreConfiguration)1