Search in sources :

Example 16 with TestObjectStreamMarshaller

use of org.infinispan.marshall.TestObjectStreamMarshaller in project infinispan by infinispan.

the class ConfigurationUnitTest method testConfigureMarshaller.

public void testConfigureMarshaller() {
    GlobalConfigurationBuilder gc = new GlobalConfigurationBuilder();
    TestObjectStreamMarshaller marshaller = new TestObjectStreamMarshaller();
    gc.serialization().marshaller(marshaller);
    withCacheManager(new CacheManagerCallable(createCacheManager(gc, new ConfigurationBuilder())) {

        @Override
        public void call() {
            cm.getCache();
        }
    });
    marshaller.stop();
}
Also used : GlobalConfigurationBuilder(org.infinispan.configuration.global.GlobalConfigurationBuilder) ConfigurationBuilder(org.infinispan.configuration.cache.ConfigurationBuilder) GlobalConfigurationBuilder(org.infinispan.configuration.global.GlobalConfigurationBuilder) DummyInMemoryStoreConfigurationBuilder(org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder) CacheManagerCallable(org.infinispan.test.CacheManagerCallable) TestObjectStreamMarshaller(org.infinispan.marshall.TestObjectStreamMarshaller)

Example 17 with TestObjectStreamMarshaller

use of org.infinispan.marshall.TestObjectStreamMarshaller in project infinispan by infinispan.

the class JCacheLoaderAdapterTest method setUpClass.

@BeforeClass
public static void setUpClass() {
    TimeService timeService = new EmbeddedTimeService();
    marshaller = new TestObjectStreamMarshaller();
    MarshallableEntryFactory marshalledEntryFactory = new MarshalledEntryFactoryImpl(marshaller);
    ctx = new DummyInitializationContext() {

        @Override
        public TimeService getTimeService() {
            return timeService;
        }

        @Override
        public MarshallableEntryFactory getMarshallableEntryFactory() {
            return marshalledEntryFactory;
        }
    };
}
Also used : DummyInitializationContext(org.infinispan.persistence.DummyInitializationContext) EmbeddedTimeService(org.infinispan.util.EmbeddedTimeService) EmbeddedTimeService(org.infinispan.util.EmbeddedTimeService) TimeService(org.infinispan.commons.time.TimeService) MarshallableEntryFactory(org.infinispan.persistence.spi.MarshallableEntryFactory) TestObjectStreamMarshaller(org.infinispan.marshall.TestObjectStreamMarshaller) MarshalledEntryFactoryImpl(org.infinispan.marshall.persistence.impl.MarshalledEntryFactoryImpl) BeforeClass(org.testng.annotations.BeforeClass)

Example 18 with TestObjectStreamMarshaller

use of org.infinispan.marshall.TestObjectStreamMarshaller in project infinispan by infinispan.

the class JdbcStringBasedStoreAltMapperTest method createCacheStore.

@BeforeClass
public void createCacheStore() throws PersistenceException {
    ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(false);
    JdbcStringBasedStoreConfigurationBuilder storeBuilder = createJdbcConfig(builder);
    UnitTestDatabaseManager.buildTableManipulation(storeBuilder.table());
    UnitTestDatabaseManager.configureUniqueConnectionFactory(storeBuilder);
    JdbcStringBasedStore jdbcStringBasedStore = new JdbcStringBasedStore();
    cacheStore = new WaitDelegatingNonBlockingStore(jdbcStringBasedStore, SingleSegmentKeyPartitioner.getInstance());
    marshaller = new TestObjectStreamMarshaller(TestDataSCI.INSTANCE);
    cacheStore.startAndWait(PersistenceMockUtil.createContext(getClass(), builder.build(), marshaller));
    tableManager = jdbcStringBasedStore.getTableManager();
}
Also used : ConfigurationBuilder(org.infinispan.configuration.cache.ConfigurationBuilder) JdbcStringBasedStoreConfigurationBuilder(org.infinispan.persistence.jdbc.configuration.JdbcStringBasedStoreConfigurationBuilder) JdbcStringBasedStoreConfigurationBuilder(org.infinispan.persistence.jdbc.configuration.JdbcStringBasedStoreConfigurationBuilder) TestObjectStreamMarshaller(org.infinispan.marshall.TestObjectStreamMarshaller) WaitDelegatingNonBlockingStore(org.infinispan.persistence.support.WaitDelegatingNonBlockingStore) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

TestObjectStreamMarshaller (org.infinispan.marshall.TestObjectStreamMarshaller)18 HashMap (java.util.HashMap)7 DummyInMemoryStore (org.infinispan.persistence.dummy.DummyInMemoryStore)7 Map (java.util.Map)6 CacheEntry (org.infinispan.container.entries.CacheEntry)6 ImmortalCacheEntry (org.infinispan.container.entries.ImmortalCacheEntry)6 PersistenceManager (org.infinispan.persistence.manager.PersistenceManager)6 CheckPoint (org.infinispan.test.fwk.CheckPoint)6 Test (org.testng.annotations.Test)6 ConfigurationBuilder (org.infinispan.configuration.cache.ConfigurationBuilder)4 MagicKey (org.infinispan.distribution.MagicKey)4 BeforeClass (org.testng.annotations.BeforeClass)4 IOException (java.io.IOException)2 GlobalConfiguration (org.infinispan.configuration.global.GlobalConfiguration)2 InternalEntryFactoryImpl (org.infinispan.container.impl.InternalEntryFactoryImpl)2 MarshalledEntryFactoryImpl (org.infinispan.marshall.persistence.impl.MarshalledEntryFactoryImpl)2 DummyInitializationContext (org.infinispan.persistence.DummyInitializationContext)2 JdbcStringBasedStoreConfigurationBuilder (org.infinispan.persistence.jdbc.configuration.JdbcStringBasedStoreConfigurationBuilder)2 PersistenceException (org.infinispan.persistence.spi.PersistenceException)2 BeforeMethod (org.testng.annotations.BeforeMethod)2