Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-12712

Cache created in runtime via CDI configuration is not visible for Cache Manager

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 13.0.0.Final
    • 12.0.0.Final
    • CDI
    • None

      The reproducer for this error is on the PR https://github.com/infinispan/infinispan/pull/9041
      I am pasting here a reference

         @Produces
         public Configuration defaultCacheConfiguration() {
            return new ConfigurationBuilder()
                  .expiration().lifespan(60000l)
                  .build();
         }
      
         @Produces
         @ApplicationScoped
         public org.infinispan.manager.EmbeddedCacheManager defaultEmbeddedCacheManager() {
            return new DefaultCacheManager();
         }
      
         @Inject
         private AdvancedCache<Object, Object> greetingCache;
      
         /**
          * Creates new {@link DefaultCacheManager}.
          * This test will fail if CDI Extension registers and won't set Cache Manager's name.
          */
         @Test
         public void testIfCreatingDefaultCacheManagerSucceeds() {
            greetingCache.put("test-key", "test-value");
            DefaultCacheManager cacheManager = new DefaultCacheManager();
            assertEquals("test-value", cacheManager.getCache("default").get("test-key"));
            cacheManager.stop();
         }
      

              dberinde@redhat.com Dan Berindei (Inactive)
              dlovison@redhat.com Diego Lovison
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: