Search in sources :

Example 1 with EMPTY_SET

use of java.util.Collections.EMPTY_SET in project hedera-services by hashgraph.

the class HapiFileUpdate method opBodyDef.

@Override
protected Consumer<TransactionBody.Builder> opBodyDef(HapiApiSpec spec) throws Throwable {
    Optional<Key> wacl = useBadlyEncodedWacl ? Optional.of(badlyEncodedWacl()) : (useEmptyWacl ? Optional.of(emptyWacl()) : newWaclKey.map(spec.registry()::getKey));
    if (newContentsPath.isPresent()) {
        newContents = Optional.of(ByteString.copyFrom(Files.toByteArray(new File(newContentsPath.get()))));
    } else if (contentFn.isPresent()) {
        newContents = Optional.of(contentFn.get().apply(spec));
    } else if (propOverrides.isPresent() || propDeletions.isPresent()) {
        if (propOverrides.isEmpty()) {
            propOverrides = Optional.of(Collections.emptyMap());
        }
        ServicesConfigurationList defaults = readBaseProps(spec);
        ServicesConfigurationList.Builder list = ServicesConfigurationList.newBuilder();
        Map<String, String> overrides = propOverrides.get();
        Map<String, String> defaultPairs = defaults.getNameValueList().stream().collect(Collectors.toMap(Setting::getName, Setting::getValue));
        Set<String> keys = new HashSet<>();
        defaults.getNameValueList().stream().map(Setting::getName).filter(key -> !propDeletions.orElse(EMPTY_SET).contains(key)).forEach(keys::add);
        overrides.keySet().stream().forEach(keys::add);
        keys.forEach(key -> {
            if (overrides.containsKey(key)) {
                list.addNameValue(asSetting(key, overrides.get(key)));
            } else {
                list.addNameValue(asSetting(key, defaultPairs.get(key)));
            }
        });
        newContents = Optional.of(list.build().toByteString());
    }
    long nl = -1;
    if (expiryExtension.isPresent()) {
        try {
            var oldExpiry = spec.registry().getTimestamp(file).getSeconds();
            nl = oldExpiry - Instant.now().getEpochSecond() + expiryExtension.getAsLong();
        } catch (Exception ignore) {
        }
    } else if (lifetimeSecs.isPresent()) {
        nl = lifetimeSecs.get();
    }
    final OptionalLong newLifetime = (nl == -1) ? OptionalLong.empty() : OptionalLong.of(nl);
    var fid = TxnUtils.asFileId(file, spec);
    FileUpdateTransactionBody opBody = spec.txns().<FileUpdateTransactionBody, FileUpdateTransactionBody.Builder>body(FileUpdateTransactionBody.class, builder -> {
        builder.setFileID(fid);
        newMemo.ifPresent(s -> builder.setMemo(StringValue.newBuilder().setValue(s).build()));
        wacl.ifPresent(k -> builder.setKeys(k.getKeyList()));
        newContents.ifPresent(b -> builder.setContents(b));
        newLifetime.ifPresent(s -> builder.setExpirationTime(TxnFactory.expiryGiven(s)));
    });
    preUpdateCb.ifPresent(cb -> cb.accept(fid));
    return builder -> builder.setFileUpdate(opBody);
}
Also used : StringValue(com.google.protobuf.StringValue) ServicesConfigurationList(com.hederahashgraph.api.proto.java.ServicesConfigurationList) EMPTY_MAP(java.util.Collections.EMPTY_MAP) EMPTY_SET(java.util.Collections.EMPTY_SET) Map(java.util.Map) KeyList(com.hederahashgraph.api.proto.java.KeyList) TransactionResponse(com.hederahashgraph.api.proto.java.TransactionResponse) Set(java.util.Set) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) ONE_HBAR(com.hedera.services.bdd.suites.HapiApiSuite.ONE_HBAR) ByteString(com.google.protobuf.ByteString) FileGetInfoResponse(com.hederahashgraph.api.proto.java.FileGetInfoResponse) List(java.util.List) Logger(org.apache.logging.log4j.Logger) HederaFunctionality(com.hederahashgraph.api.proto.java.HederaFunctionality) ExchangeRateSet(com.hederahashgraph.api.proto.java.ExchangeRateSet) Optional(java.util.Optional) TxnUtils.suFrom(com.hedera.services.bdd.spec.transactions.TxnUtils.suFrom) FeeCalculator(com.hedera.services.bdd.spec.fees.FeeCalculator) HapiGetFileInfo(com.hedera.services.bdd.spec.queries.file.HapiGetFileInfo) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) Transaction(com.hederahashgraph.api.proto.java.Transaction) HapiTxnOp(com.hedera.services.bdd.spec.transactions.HapiTxnOp) Function(java.util.function.Function) Setting(com.hederahashgraph.api.proto.java.Setting) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) OptionalLong(java.util.OptionalLong) TxnFactory(com.hedera.services.bdd.spec.transactions.TxnFactory) TxnUtils(com.hedera.services.bdd.spec.transactions.TxnUtils) TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) Files(com.google.common.io.Files) HapiApiSuite(com.hedera.services.bdd.suites.HapiApiSuite) ExtantFileContext(com.hedera.services.usage.file.ExtantFileContext) Timestamp(com.hederahashgraph.api.proto.java.Timestamp) QueryVerbs.getFileContents(com.hedera.services.bdd.spec.queries.QueryVerbs.getFileContents) FileUpdateTransactionBody(com.hederahashgraph.api.proto.java.FileUpdateTransactionBody) FileID(com.hederahashgraph.api.proto.java.FileID) ResponseCodeEnum(com.hederahashgraph.api.proto.java.ResponseCodeEnum) MoreObjects(com.google.common.base.MoreObjects) QueryVerbs.getFileInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getFileInfo) CustomSpecAssert.allRunFor(com.hedera.services.bdd.spec.utilops.CustomSpecAssert.allRunFor) File(java.io.File) HapiGetFileContents(com.hedera.services.bdd.spec.queries.file.HapiGetFileContents) Consumer(java.util.function.Consumer) Key(com.hederahashgraph.api.proto.java.Key) Assertions(org.junit.jupiter.api.Assertions) LogManager(org.apache.logging.log4j.LogManager) Collections(java.util.Collections) Setting(com.hederahashgraph.api.proto.java.Setting) ByteString(com.google.protobuf.ByteString) FileUpdateTransactionBody(com.hederahashgraph.api.proto.java.FileUpdateTransactionBody) ServicesConfigurationList(com.hederahashgraph.api.proto.java.ServicesConfigurationList) OptionalLong(java.util.OptionalLong) File(java.io.File) Key(com.hederahashgraph.api.proto.java.Key) HashSet(java.util.HashSet)

Example 2 with EMPTY_SET

use of java.util.Collections.EMPTY_SET in project camunda-bpm-platform by camunda.

the class DefaultDeploymentConfiguration method getDeploymentResources.

@Override
public Set<Resource> getDeploymentResources() {
    final ResourceArrayPropertyEditor resolver = new ResourceArrayPropertyEditor();
    try {
        final String[] resourcePattern = camundaBpmProperties.getDeploymentResourcePattern();
        logger.debug("resolving deployment resources for pattern {}", (Object[]) resourcePattern);
        resolver.setValue(resourcePattern);
        return Arrays.stream((Resource[]) resolver.getValue()).peek(resource -> logger.debug("processing deployment resource {}", resource)).filter(this::isFile).peek(resource -> logger.debug("added deployment resource {}", resource)).collect(Collectors.toSet());
    } catch (final RuntimeException e) {
        logger.error("unable to resolve resources", e);
    }
    return EMPTY_SET;
}
Also used : ResourceArrayPropertyEditor(org.springframework.core.io.support.ResourceArrayPropertyEditor) Arrays(java.util.Arrays) Logger(org.slf4j.Logger) UrlResource(org.springframework.core.io.UrlResource) URL(java.net.URL) LoggerFactory(org.slf4j.LoggerFactory) ClassPathResource(org.springframework.core.io.ClassPathResource) SpringProcessEngineConfiguration(org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration) Set(java.util.Set) IOException(java.io.IOException) Collectors(java.util.stream.Collectors) EMPTY_SET(java.util.Collections.EMPTY_SET) CamundaDeploymentConfiguration(org.camunda.bpm.spring.boot.starter.configuration.CamundaDeploymentConfiguration) Resource(org.springframework.core.io.Resource) UrlResource(org.springframework.core.io.UrlResource) ClassPathResource(org.springframework.core.io.ClassPathResource) Resource(org.springframework.core.io.Resource) ResourceArrayPropertyEditor(org.springframework.core.io.support.ResourceArrayPropertyEditor)

Example 3 with EMPTY_SET

use of java.util.Collections.EMPTY_SET in project reactive-wizard by FortnoxAB.

the class HttpClientTest method shouldReportUnhealthyWhenConnectionCannotBeAcquiredBeforeTimeoutAndAfter10Attempts.

@Test
public void shouldReportUnhealthyWhenConnectionCannotBeAcquiredBeforeTimeoutAndAfter10Attempts() throws URISyntaxException {
    HttpClientConfig httpClientConfig = new HttpClientConfig();
    int port = 13337;
    httpClientConfig.setUrl("http://localhost:" + port);
    httpClientConfig.setMaxConnections(1);
    httpClientConfig.setConnectionMaxIdleTimeInMs(10);
    ReactorRxClientProvider reactorRxClientProvider = new ReactorRxClientProvider(httpClientConfig, healthRecorder);
    HttpClient reactorHttpClient = new HttpClient(httpClientConfig, reactorRxClientProvider, new ObjectMapper(), new RequestParameterSerializers(), EMPTY_SET, requestLogger);
    TestResource testResource = reactorHttpClient.create(TestResource.class);
    // First ten should not cause the client to be unhealthy
    range(1, 11).forEach(value -> testResource.postHello().test().awaitTerminalEvent());
    assertThat(healthRecorder.isHealthy()).isTrue();
    // but the eleventh should
    testResource.postHello().test().awaitTerminalEvent();
    assertThat(healthRecorder.isHealthy()).isFalse();
    // And a successful connection should reset the healthRecorder to healthy again
    DisposableServer server = HttpServer.create().port(port).handle((request, response) -> defer(() -> {
        response.status(OK);
        return Flux.empty();
    })).bindNow();
    try {
        testResource.postHello().test().awaitTerminalEvent();
        assertThat(healthRecorder.isHealthy()).isTrue();
    } finally {
        server.disposeNow();
    }
    // Sleep over the max idle time
    try {
        Thread.sleep(httpClientConfig.getConnectionMaxIdleTimeInMs() + 10);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    // And should accept another 10 errors
    range(1, 11).forEach(value -> testResource.postHello().test().awaitTerminalEvent());
    assertThat(healthRecorder.isHealthy()).isTrue();
}
Also used : Arrays(java.util.Arrays) Flux.just(reactor.core.publisher.Flux.just) Level(org.apache.logging.log4j.Level) Single(rx.Single) MediaType(javax.ws.rs.core.MediaType) ServerConfig(se.fortnox.reactivewizard.server.ServerConfig) EMPTY_SET(java.util.Collections.EMPTY_SET) Duration(java.time.Duration) Map(java.util.Map) HeaderParam(javax.ws.rs.HeaderParam) LoggingVerifier(se.fortnox.reactivewizard.test.LoggingVerifier) SSLHandshakeException(javax.net.ssl.SSLHandshakeException) Set(java.util.Set) BeanParam(javax.ws.rs.BeanParam) HttpServerRequest(reactor.netty.http.server.HttpServerRequest) HttpServer(reactor.netty.http.server.HttpServer) Assertions.fail(org.assertj.core.api.Assertions.fail) WARN(org.apache.logging.log4j.Level.WARN) OK(io.netty.handler.codec.http.HttpResponseStatus.OK) Mockito.mock(org.mockito.Mockito.mock) ByteArrayOutputStream(java.io.ByteArrayOutputStream) JaxRsMeta(se.fortnox.reactivewizard.jaxrs.JaxRsMeta) GET(javax.ws.rs.GET) ArrayList(java.util.ArrayList) Assertions.assertThatExceptionOfType(org.assertj.core.api.Assertions.assertThatExceptionOfType) CookieParam(javax.ws.rs.CookieParam) ConnectException(java.net.ConnectException) Publisher(org.reactivestreams.Publisher) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) Mockito.times(org.mockito.Mockito.times) Flux.defer(reactor.core.publisher.Flux.defer) LoggingMockUtil(se.fortnox.reactivewizard.test.LoggingMockUtil) Flux(reactor.core.publisher.Flux) AtomicLong(java.util.concurrent.atomic.AtomicLong) ChronoUnit(java.time.temporal.ChronoUnit) SslContextBuilder(io.netty.handler.ssl.SslContextBuilder) CollectionOptions(se.fortnox.reactivewizard.CollectionOptions) Assert(org.junit.Assert) IntStream.range(java.util.stream.IntStream.range) Date(java.util.Date) NOT_FOUND(io.netty.handler.codec.http.HttpResponseStatus.NOT_FOUND) URISyntaxException(java.net.URISyntaxException) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Path(javax.ws.rs.Path) TimeoutException(java.util.concurrent.TimeoutException) DeserializationFeature(com.fasterxml.jackson.databind.DeserializationFeature) QueryParam(javax.ws.rs.QueryParam) Consumes(javax.ws.rs.Consumes) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Method(java.lang.reflect.Method) CONTENT_LENGTH(javax.ws.rs.core.HttpHeaders.CONTENT_LENGTH) TestInjector(se.fortnox.reactivewizard.config.TestInjector) DELETE(javax.ws.rs.DELETE) Flux.empty(reactor.core.publisher.Flux.empty) TestUtil(se.fortnox.reactivewizard.test.TestUtil) ImmutableMap(com.google.common.collect.ImmutableMap) HttpResponseStatus(io.netty.handler.codec.http.HttpResponseStatus) UUID(java.util.UUID) InetSocketAddress(java.net.InetSocketAddress) Sets(com.google.common.collect.Sets) String.format(java.lang.String.format) List(java.util.List) DefaultCookie(io.netty.handler.codec.http.cookie.DefaultCookie) JsonMappingException(com.fasterxml.jackson.databind.JsonMappingException) FieldError(se.fortnox.reactivewizard.jaxrs.FieldError) DisposableServer(reactor.netty.DisposableServer) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) HttpServerResponse(reactor.netty.http.server.HttpServerResponse) RequestLogger(se.fortnox.reactivewizard.jaxrs.RequestLogger) PathParam(javax.ws.rs.PathParam) INTERNAL_SERVER_ERROR(io.netty.handler.codec.http.HttpResponseStatus.INTERNAL_SERVER_ERROR) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) Observable(rx.Observable) AssertableSubscriber(rx.observers.AssertableSubscriber) HashSet(java.util.HashSet) BAD_REQUEST(io.netty.handler.codec.http.HttpResponseStatus.BAD_REQUEST) Charset(java.nio.charset.Charset) ObservableAssertions(se.fortnox.reactivewizard.test.observable.ObservableAssertions) PATCH(se.fortnox.reactivewizard.jaxrs.PATCH) WebException(se.fortnox.reactivewizard.jaxrs.WebException) GATEWAY_TIMEOUT(io.netty.handler.codec.http.HttpResponseStatus.GATEWAY_TIMEOUT) CREATED(io.netty.handler.codec.http.HttpResponseStatus.CREATED) RetryWithDelay(se.fortnox.reactivewizard.util.rx.RetryWithDelay) OutputStream(java.io.OutputStream) PrintStream(java.io.PrintStream) FormParam(javax.ws.rs.FormParam) POST(javax.ws.rs.POST) SelfSignedCertificate(io.netty.handler.ssl.util.SelfSignedCertificate) Optional.ofNullable(java.util.Optional.ofNullable) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) HttpMethod(io.netty.handler.codec.http.HttpMethod) CertificateException(java.security.cert.CertificateException) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) Injector(com.google.inject.Injector) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Mockito(org.mockito.Mockito) Rule(org.junit.Rule) PUT(javax.ws.rs.PUT) TestUtil.matches(se.fortnox.reactivewizard.test.TestUtil.matches) HealthRecorder(se.fortnox.reactivewizard.metrics.HealthRecorder) Collections(java.util.Collections) DisposableServer(reactor.netty.DisposableServer) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Example 4 with EMPTY_SET

use of java.util.Collections.EMPTY_SET in project cache2k by cache2k.

the class CacheLoaderTest method testReloadAll.

@Test
public void testReloadAll() throws ExecutionException, InterruptedException {
    AtomicInteger countLoad = new AtomicInteger();
    Cache<Integer, Integer> c = target.cache(b -> b.loader(key -> countLoad.incrementAndGet()));
    c.get(5);
    assertThat(countLoad.get()).isEqualTo(1);
    c.reloadAll(asList(5, 6)).get();
    assertThat(countLoad.get()).isEqualTo(3);
    c.reloadAll(asList(5, 6));
    c.reloadAll(EMPTY_SET);
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) DEFAULT(org.cache2k.core.concurrency.ThreadFactoryProvider.DEFAULT) TaskSuccessGuardian(org.cache2k.pinpoint.TaskSuccessGuardian) Thread.currentThread(java.lang.Thread.currentThread) AbortPolicy(java.util.concurrent.ThreadPoolExecutor.AbortPolicy) IntCacheRule(org.cache2k.test.util.IntCacheRule) EMPTY_SET(java.util.Collections.EMPTY_SET) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ExpiryTimeValues(org.cache2k.expiry.ExpiryTimeValues) Arrays.asList(java.util.Arrays.asList) ForkJoinPool.commonPool(java.util.concurrent.ForkJoinPool.commonPool) Map(java.util.Map) EnableExceptionCaching(org.cache2k.test.core.expiry.ExpiryTest.EnableExceptionCaching) Assertions(org.assertj.core.api.Assertions) SupervisedExecutor(org.cache2k.pinpoint.SupervisedExecutor) EntryProcessingResult(org.cache2k.processor.EntryProcessingResult) EMPTY_LIST(java.util.Collections.EMPTY_LIST) SynchronousQueue(java.util.concurrent.SynchronousQueue) FastTests(org.cache2k.testing.category.FastTests) Set(java.util.Set) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) NOW(org.cache2k.expiry.ExpiryTimeValues.NOW) Category(org.junit.experimental.categories.Category) AdvancedCacheLoader(org.cache2k.io.AdvancedCacheLoader) ExpiryTest(org.cache2k.test.core.expiry.ExpiryTest) CountDownLatch(java.util.concurrent.CountDownLatch) Cache(org.cache2k.Cache) EntryProcessingException(org.cache2k.processor.EntryProcessingException) PinpointParameters(org.cache2k.pinpoint.PinpointParameters) REFRESH(org.cache2k.expiry.ExpiryTimeValues.REFRESH) Cache2kBuilder(org.cache2k.Cache2kBuilder) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) AsyncCacheLoader(org.cache2k.io.AsyncCacheLoader) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TestingBase(org.cache2k.test.util.TestingBase) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) MutableCacheEntry(org.cache2k.processor.MutableCacheEntry) Timeout(org.junit.rules.Timeout) AsyncBulkCacheLoader(org.cache2k.io.AsyncBulkCacheLoader) CaughtInterruptedExceptionError(org.cache2k.pinpoint.CaughtInterruptedExceptionError) ExpectedException(org.cache2k.test.util.ExpectedException) Test(org.junit.Test) CacheLoader(org.cache2k.io.CacheLoader) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Rule(org.junit.Rule) Executors.newCachedThreadPool(java.util.concurrent.Executors.newCachedThreadPool) CacheLoaderException(org.cache2k.io.CacheLoaderException) ExceptionCollector(org.cache2k.pinpoint.ExceptionCollector) CacheEntry(org.cache2k.CacheEntry) MAX_FINISH_WAIT_MILLIS(org.cache2k.test.core.TestingParameters.MAX_FINISH_WAIT_MILLIS) CacheRule(org.cache2k.test.util.CacheRule) Collections(java.util.Collections) SECONDS(java.util.concurrent.TimeUnit.SECONDS) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ExpiryTest(org.cache2k.test.core.expiry.ExpiryTest) Test(org.junit.Test)

Example 5 with EMPTY_SET

use of java.util.Collections.EMPTY_SET in project cache2k by cache2k.

the class CacheLoaderTest method testLoadAll.

@Test
public void testLoadAll() throws ExecutionException, InterruptedException {
    AtomicInteger countLoad = new AtomicInteger();
    Cache<Integer, Integer> c = target.cache(b -> b.loader(key -> countLoad.incrementAndGet()));
    c.get(5);
    c.loadAll(asList(5, 6)).get();
    assertThat(countLoad.get()).isEqualTo(2);
    assertThat(c.get(6)).isEqualTo((Integer) 2);
    c.loadAll(asList(5, 6)).get();
    c.loadAll(EMPTY_SET);
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) DEFAULT(org.cache2k.core.concurrency.ThreadFactoryProvider.DEFAULT) TaskSuccessGuardian(org.cache2k.pinpoint.TaskSuccessGuardian) Thread.currentThread(java.lang.Thread.currentThread) AbortPolicy(java.util.concurrent.ThreadPoolExecutor.AbortPolicy) IntCacheRule(org.cache2k.test.util.IntCacheRule) EMPTY_SET(java.util.Collections.EMPTY_SET) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ExpiryTimeValues(org.cache2k.expiry.ExpiryTimeValues) Arrays.asList(java.util.Arrays.asList) ForkJoinPool.commonPool(java.util.concurrent.ForkJoinPool.commonPool) Map(java.util.Map) EnableExceptionCaching(org.cache2k.test.core.expiry.ExpiryTest.EnableExceptionCaching) Assertions(org.assertj.core.api.Assertions) SupervisedExecutor(org.cache2k.pinpoint.SupervisedExecutor) EntryProcessingResult(org.cache2k.processor.EntryProcessingResult) EMPTY_LIST(java.util.Collections.EMPTY_LIST) SynchronousQueue(java.util.concurrent.SynchronousQueue) FastTests(org.cache2k.testing.category.FastTests) Set(java.util.Set) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) NOW(org.cache2k.expiry.ExpiryTimeValues.NOW) Category(org.junit.experimental.categories.Category) AdvancedCacheLoader(org.cache2k.io.AdvancedCacheLoader) ExpiryTest(org.cache2k.test.core.expiry.ExpiryTest) CountDownLatch(java.util.concurrent.CountDownLatch) Cache(org.cache2k.Cache) EntryProcessingException(org.cache2k.processor.EntryProcessingException) PinpointParameters(org.cache2k.pinpoint.PinpointParameters) REFRESH(org.cache2k.expiry.ExpiryTimeValues.REFRESH) Cache2kBuilder(org.cache2k.Cache2kBuilder) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) AsyncCacheLoader(org.cache2k.io.AsyncCacheLoader) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TestingBase(org.cache2k.test.util.TestingBase) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) MutableCacheEntry(org.cache2k.processor.MutableCacheEntry) Timeout(org.junit.rules.Timeout) AsyncBulkCacheLoader(org.cache2k.io.AsyncBulkCacheLoader) CaughtInterruptedExceptionError(org.cache2k.pinpoint.CaughtInterruptedExceptionError) ExpectedException(org.cache2k.test.util.ExpectedException) Test(org.junit.Test) CacheLoader(org.cache2k.io.CacheLoader) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Rule(org.junit.Rule) Executors.newCachedThreadPool(java.util.concurrent.Executors.newCachedThreadPool) CacheLoaderException(org.cache2k.io.CacheLoaderException) ExceptionCollector(org.cache2k.pinpoint.ExceptionCollector) CacheEntry(org.cache2k.CacheEntry) MAX_FINISH_WAIT_MILLIS(org.cache2k.test.core.TestingParameters.MAX_FINISH_WAIT_MILLIS) CacheRule(org.cache2k.test.util.CacheRule) Collections(java.util.Collections) SECONDS(java.util.concurrent.TimeUnit.SECONDS) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ExpiryTest(org.cache2k.test.core.expiry.ExpiryTest) Test(org.junit.Test)

Aggregations

EMPTY_SET (java.util.Collections.EMPTY_SET)6 Set (java.util.Set)6 Collections (java.util.Collections)4 HashMap (java.util.HashMap)4 Map (java.util.Map)4 TimeUnit (java.util.concurrent.TimeUnit)3 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)3 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)3 AtomicReference (java.util.concurrent.atomic.AtomicReference)3 Rule (org.junit.Rule)3 Test (org.junit.Test)3 Thread.currentThread (java.lang.Thread.currentThread)2 Arrays (java.util.Arrays)2 Arrays.asList (java.util.Arrays.asList)2 EMPTY_LIST (java.util.Collections.EMPTY_LIST)2 Date (java.util.Date)2 List (java.util.List)2 Optional.ofNullable (java.util.Optional.ofNullable)2 CompletableFuture (java.util.concurrent.CompletableFuture)2 CountDownLatch (java.util.concurrent.CountDownLatch)2