Search in sources :

Example 1 with LockManager

use of org.eclipse.dataspaceconnector.common.concurrency.LockManager in project DataSpaceConnector by eclipse-dataspaceconnector.

the class InMemoryPolicyStoreTest method setUp.

@BeforeEach
void setUp() {
    manager = spy(new LockManager(new ReentrantReadWriteLock(true)));
    store = new InMemoryPolicyStore(manager);
}
Also used : LockManager(org.eclipse.dataspaceconnector.common.concurrency.LockManager) ReentrantReadWriteLock(java.util.concurrent.locks.ReentrantReadWriteLock) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with LockManager

use of org.eclipse.dataspaceconnector.common.concurrency.LockManager in project DataSpaceConnector by eclipse-dataspaceconnector.

the class InMemoryFederatedCacheStoreTest method setUp.

@BeforeEach
public void setUp() {
    CriterionConverter<Predicate<ContractOffer>> converter = criterion -> offer -> true;
    store = new InMemoryFederatedCacheStore(converter, new LockManager(new ReentrantReadWriteLock()));
}
Also used : ContractOffer(org.eclipse.dataspaceconnector.spi.types.domain.contract.offer.ContractOffer) BeforeEach(org.junit.jupiter.api.BeforeEach) Policy(org.eclipse.dataspaceconnector.policy.model.Policy) Predicate(java.util.function.Predicate) Collection(java.util.Collection) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) UUID(java.util.UUID) ReentrantReadWriteLock(java.util.concurrent.locks.ReentrantReadWriteLock) Test(org.junit.jupiter.api.Test) FederatedCacheStore(org.eclipse.dataspaceconnector.catalog.spi.FederatedCacheStore) List(java.util.List) InMemoryFederatedCacheStore(org.eclipse.dataspaceconnector.catalog.store.InMemoryFederatedCacheStore) CriterionConverter(org.eclipse.dataspaceconnector.spi.query.CriterionConverter) Asset(org.eclipse.dataspaceconnector.spi.types.domain.asset.Asset) LockManager(org.eclipse.dataspaceconnector.common.concurrency.LockManager) Collections(java.util.Collections) LockManager(org.eclipse.dataspaceconnector.common.concurrency.LockManager) InMemoryFederatedCacheStore(org.eclipse.dataspaceconnector.catalog.store.InMemoryFederatedCacheStore) ReentrantReadWriteLock(java.util.concurrent.locks.ReentrantReadWriteLock) Predicate(java.util.function.Predicate) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ReentrantReadWriteLock (java.util.concurrent.locks.ReentrantReadWriteLock)2 LockManager (org.eclipse.dataspaceconnector.common.concurrency.LockManager)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 Collection (java.util.Collection)1 Collections (java.util.Collections)1 List (java.util.List)1 UUID (java.util.UUID)1 Predicate (java.util.function.Predicate)1 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)1 FederatedCacheStore (org.eclipse.dataspaceconnector.catalog.spi.FederatedCacheStore)1 InMemoryFederatedCacheStore (org.eclipse.dataspaceconnector.catalog.store.InMemoryFederatedCacheStore)1 Policy (org.eclipse.dataspaceconnector.policy.model.Policy)1 CriterionConverter (org.eclipse.dataspaceconnector.spi.query.CriterionConverter)1 Asset (org.eclipse.dataspaceconnector.spi.types.domain.asset.Asset)1 ContractOffer (org.eclipse.dataspaceconnector.spi.types.domain.contract.offer.ContractOffer)1 Test (org.junit.jupiter.api.Test)1