use of org.infinispan.marshall.persistence.impl.MarshalledEntryFactoryImpl in project infinispan by infinispan.
the class BaseNonBlockingStoreTest method setUp.
// alwaysRun = true otherwise, when we run unstable tests, this method is not invoked (because it belongs to the unit group)
@BeforeMethod(alwaysRun = true)
public void setUp() throws Exception {
marshaller = new TestObjectStreamMarshaller(getSerializationContextInitializer());
timeService = getTimeService();
internalEntryFactory = new InternalEntryFactoryImpl();
TestingUtil.inject(internalEntryFactory, timeService);
marshallableEntryFactory = new MarshalledEntryFactoryImpl();
TestingUtil.inject(marshallableEntryFactory, marshaller);
try {
NonBlockingStore<Object, Object> nonBlockingStore = createStore();
// Make sure all store methods don't block when we invoke them
store = new EnsureNonBlockingStore<>(nonBlockingStore, keyPartitioner);
startStore(store);
} catch (Exception e) {
log.error("Error creating store", e);
throw e;
}
}
use of org.infinispan.marshall.persistence.impl.MarshalledEntryFactoryImpl in project infinispan by infinispan.
the class AsyncStoreStressTest method createAsyncStore.
private AsyncNonBlockingStore<Object, Object> createAsyncStore(NonBlockingStore backendStore, StoreConfiguration storeConfiguration) throws PersistenceException {
AsyncNonBlockingStore<Object, Object> store = new AsyncNonBlockingStore<>(backendStore);
BlockingManager blockingManager = new BlockingManagerImpl();
TestingUtil.inject(blockingManager, new TestComponentAccessors.NamedComponent(KnownComponentNames.NON_BLOCKING_EXECUTOR, nonBlockingExecutor), new TestComponentAccessors.NamedComponent(KnownComponentNames.BLOCKING_EXECUTOR, blockingExecutor));
TestingUtil.startComponent(blockingManager);
Cache cacheMock = Mockito.mock(Cache.class, Mockito.RETURNS_DEEP_STUBS);
Mockito.when(cacheMock.getAdvancedCache().getComponentRegistry().getComponent(KeyPartitioner.class)).thenReturn(SingleSegmentKeyPartitioner.getInstance());
CompletionStages.join(store.start(new DummyInitializationContext(storeConfiguration, cacheMock, marshaller, new ByteBufferFactoryImpl(), new MarshalledEntryFactoryImpl(marshaller), nonBlockingExecutor, new GlobalConfigurationBuilder().globalState().persistentLocation(location).build(), blockingManager, null, new DefaultTimeService())));
return store;
}
use of org.infinispan.marshall.persistence.impl.MarshalledEntryFactoryImpl 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;
}
};
}
use of org.infinispan.marshall.persistence.impl.MarshalledEntryFactoryImpl in project infinispan by infinispan.
the class AbstractJpaStoreTest method setUp.
@BeforeMethod(alwaysRun = true)
public void setUp() throws Exception {
try {
cm = createCacheManager();
marshaller = TestingUtil.extractPersistenceMarshaller(cm);
entryFactory = new MarshalledEntryFactoryImpl(marshaller);
blockingManager = TestingUtil.extractGlobalComponent(cm, BlockingManager.class);
cs = createCacheStore(cm.getCacheManagerConfiguration());
cs.clear();
} catch (Exception e) {
log.warn("Error during test setup", e);
throw e;
}
}
Aggregations