Package org.infinispan.test

Examples of org.infinispan.test.CacheManagerCallable


public class XMLConfigurationOverridingTest extends AbstractInfinispanTest {

   private static final String simpleCacheName = "simpleLocalCache";

   public void testOverrideIndexing() throws Exception {
      withCacheManager(new CacheManagerCallable(TestCacheManagerFactory.fromXml("configs/named-cache-override-test.xml")) {
         @Override
         public void call() {
            Configuration cnf = cm.getCacheConfiguration(simpleCacheName);
            Assert.assertFalse(cnf.indexing().enabled());
View Full Code Here


         TestingUtil.killCacheManagers(cm);
      }
   }

   public void testUnstartedCachemanager() {
      withCacheManager(new CacheManagerCallable(createCacheManager(false)){
         @Override
         public void call() {
            assert cm.getStatus().equals(ComponentStatus.INSTANTIATED);
            assert !cm.getStatus().allowInvocations();
            Cache<Object, Object> cache = cm.getCache();
View Full Code Here

         cm.stop();
      }
   }

   public void testGetCacheConfigurationAfterDefiningSameOldConfigurationTwice() {
      withCacheManager(new CacheManagerCallable(createLocalCacheManager(false)) {
         @Override
         public void call() {
            org.infinispan.config.Configuration c = new org.infinispan.config.Configuration();
            c.setInvocationBatchingEnabled(false);
            org.infinispan.config.Configuration newConfig = cm.defineConfiguration("new-cache", c);
View Full Code Here

         }
      });
   }

   public void testGetCacheConfigurationAfterDefiningSameNewConfigurationTwice() {
      withCacheManager(new CacheManagerCallable(createLocalCacheManager(false)) {
         @Override
         public void call() {
            ConfigurationBuilder builder = new ConfigurationBuilder();
            builder.invocationBatching().disable();
            Configuration newConfig = cm.defineConfiguration("new-cache", builder.build());
View Full Code Here

            GlobalConfiguration globalCfg = cm1.getCacheManagerConfiguration();
            Configuration cfg = c1.getCacheConfiguration();
            cm1.stop();

            withCacheManager(new CacheManagerCallable(
                  new DefaultCacheManager(globalCfg, cfg)) {
               @Override
               public void call() {
                  Cache<Object, Object> c = cm.getCache();
                  c.put(1, "v1");
View Full Code Here

      }
   }

   public void testCreateWithMultipleXmlFiles() throws Exception {
      String xmlFile = "configs/local-singlenamedcache-test.xml";
      withCacheManager(new CacheManagerCallable(TestCacheManagerFactory.fromXml(xmlFile, xmlFile, xmlFile)) {
         @Override
         public void call() {
            Cache<Object, Object> c = cm.getCache();
            assert c.getCacheConfiguration().locking().lockAcquisitionTimeout() == 1111;
            Cache<Object, Object> c2 = cm.getCache("localCache");
View Full Code Here

@Test(groups = "unit", testName = "configuration.as.ASXmlFileParsingTest")
public class ASXmlFileParsingTest extends AbstractInfinispanTest {

   public void testNamedCacheFile() throws IOException {

      withCacheManager(new CacheManagerCallable(TestCacheManagerFactory.fromXml("configs/as7/standalone.xml")) {

         @Override
         public void call() {
            Configuration c = cm.getCacheConfiguration("default");
            assert c.clustering().cacheMode().equals(CacheMode.LOCAL);
View Full Code Here

      file.deleteOnExit();

      assert created;

      final EmbeddedCacheManager cacheManager = initializeInfinispan(file);
      TestingUtil.withCacheManager(new CacheManagerCallable(cacheManager) {
         @Override
         public void call() {
            Directory directory = null;
            try {
               Cache cache = cacheManager.getCache();
View Full Code Here

   public void testLuceneCacheLoaderWithNonReadableDir() throws IOException {
      boolean isReadOff = rootDir.setReadable(false);
      if(isReadOff) {
         final EmbeddedCacheManager cacheManager = initializeInfinispan(rootDir);
         TestingUtil.withCacheManager(new CacheManagerCallable(cacheManager) {
            @Override
            public void call() {
               try {
                  Cache cache = cacheManager.getCache();
                  DirectoryBuilder.newDirectoryInstance(cache, cache, cache, indexName).create();
View Full Code Here

   public void testContainsKeyWithNoExistentRootDir() {
      final File rootDir = new File(new File(parentDir).getAbsoluteFile(), getIndexPathName() + "___");
      final EmbeddedCacheManager cacheManager = initializeInfinispan(rootDir);
      try {
         TestingUtil.withCacheManager(new CacheManagerCallable(cacheManager) {
            @Override
            public void call() {
               Cache cache = cacheManager.getCache();
               Directory directory = DirectoryBuilder.newDirectoryInstance(cache, cache, cache, indexName).create();
View Full Code Here

TOP

Related Classes of org.infinispan.test.CacheManagerCallable

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.