target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test void testFindJdbcServiceWithZeroOrMultipleMatches() { Mockito.when(env.findJdbcServiceByName(SERVICE_NAME)) .thenThrow(IllegalArgumentException.class); CfJdbcService service = environmentServicesFinder.findJdbcService(SERVICE_NAME); Assertions.assertNull(service); } | public CfJdbcService findJdbcService(String name) { if (StringUtils.isEmpty(name)) { return null; } try { return env.findJdbcServiceByName(name); } catch (IllegalArgumentException e) { return null; } } | EnvironmentServicesFinder { public CfJdbcService findJdbcService(String name) { if (StringUtils.isEmpty(name)) { return null; } try { return env.findJdbcServiceByName(name); } catch (IllegalArgumentException e) { return null; } } } | EnvironmentServicesFinder { public CfJdbcService findJdbcService(String name) { if (StringUtils.isEmpty(name)) { return null; } try { return env.findJdbcServiceByName(name); } catch (IllegalArgumentException e) { return null; } } EnvironmentServicesFinder(); EnvironmentServicesFinder(CfJdbcEnv env); } | EnvironmentServicesFinder { public CfJdbcService findJdbcService(String name) { if (StringUtils.isEmpty(name)) { return null; } try { return env.findJdbcServiceByName(name); } catch (IllegalArgumentException e) { return null; } } EnvironmentServicesFinder(); EnvironmentServicesFinder(CfJdbcEnv env); CfJdbcService find... | EnvironmentServicesFinder { public CfJdbcService findJdbcService(String name) { if (StringUtils.isEmpty(name)) { return null; } try { return env.findJdbcServiceByName(name); } catch (IllegalArgumentException e) { return null; } } EnvironmentServicesFinder(); EnvironmentServicesFinder(CfJdbcEnv env); CfJdbcService find... |
@Test void testList() throws Exception { ObjectListing objectListing = new ObjectListing(); objectListing.setBucketName(CONTAINER); objectListing.setObjectSummaries(getObjectSummaries(3)); Mockito.when(ossClient.listObjects(any(ListObjectsRequest.class))) .thenReturn(objectListing); ObjectMetadata objectMetadata = new ... | @Override public PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options) { return doOssOperation(oss -> { ListObjectsRequest request = toListObjectRequest(container, options); ObjectListing objectListing = oss.listObjects(request); List<StorageMetadata> storageMetadataList = toStorageMet... | AliOSSBlobStore extends BaseBlobStore { @Override public PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options) { return doOssOperation(oss -> { ListObjectsRequest request = toListObjectRequest(container, options); ObjectListing objectListing = oss.listObjects(request); List<StorageMeta... | AliOSSBlobStore extends BaseBlobStore { @Override public PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options) { return doOssOperation(oss -> { ListObjectsRequest request = toListObjectRequest(container, options); ObjectListing objectListing = oss.listObjects(request); List<StorageMeta... | AliOSSBlobStore extends BaseBlobStore { @Override public PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options) { return doOssOperation(oss -> { ListObjectsRequest request = toListObjectRequest(container, options); ObjectListing objectListing = oss.listObjects(request); List<StorageMeta... | AliOSSBlobStore extends BaseBlobStore { @Override public PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options) { return doOssOperation(oss -> { ListObjectsRequest request = toListObjectRequest(container, options); ObjectListing objectListing = oss.listObjects(request); List<StorageMeta... |
@Test void testExecuteWithMultiplePages() { HistoricProcessInstance process1 = mockHistoricProcessInstanceWithId(OPERATION_ID_1); HistoricProcessInstance process2 = mockHistoricProcessInstanceWithId(OPERATION_ID_2); HistoricProcessInstance process3 = mockHistoricProcessInstanceWithId(OPERATION_ID_3); List<HistoricProce... | @Override public void execute(Date expirationTime) { long deletedProcessesCount = 0; long expiredProcessesPages = getExpiredProcessesPageCount(expirationTime); for (int i = 0; i < expiredProcessesPages; i++) { deletedProcessesCount += deleteExpiredProcessesPage(expirationTime); } LOGGER.info(CleanUpJob.LOG_MARKER, form... | FlowableHistoricDataCleaner implements Cleaner { @Override public void execute(Date expirationTime) { long deletedProcessesCount = 0; long expiredProcessesPages = getExpiredProcessesPageCount(expirationTime); for (int i = 0; i < expiredProcessesPages; i++) { deletedProcessesCount += deleteExpiredProcessesPage(expiratio... | FlowableHistoricDataCleaner implements Cleaner { @Override public void execute(Date expirationTime) { long deletedProcessesCount = 0; long expiredProcessesPages = getExpiredProcessesPageCount(expirationTime); for (int i = 0; i < expiredProcessesPages; i++) { deletedProcessesCount += deleteExpiredProcessesPage(expiratio... | FlowableHistoricDataCleaner implements Cleaner { @Override public void execute(Date expirationTime) { long deletedProcessesCount = 0; long expiredProcessesPages = getExpiredProcessesPageCount(expirationTime); for (int i = 0; i < expiredProcessesPages; i++) { deletedProcessesCount += deleteExpiredProcessesPage(expiratio... | FlowableHistoricDataCleaner implements Cleaner { @Override public void execute(Date expirationTime) { long deletedProcessesCount = 0; long expiredProcessesPages = getExpiredProcessesPageCount(expirationTime); for (int i = 0; i < expiredProcessesPages; i++) { deletedProcessesCount += deleteExpiredProcessesPage(expiratio... |
@Test void testExecuteResilience() { HistoricProcessInstance process1 = mockHistoricProcessInstanceWithId(OPERATION_ID_1); HistoricProcessInstance process2 = mockHistoricProcessInstanceWithId(OPERATION_ID_2); List<HistoricProcessInstance> page1 = List.of(process1, process2); List<HistoricProcessInstance> page2 = Collec... | @Override public void execute(Date expirationTime) { long deletedProcessesCount = 0; long expiredProcessesPages = getExpiredProcessesPageCount(expirationTime); for (int i = 0; i < expiredProcessesPages; i++) { deletedProcessesCount += deleteExpiredProcessesPage(expirationTime); } LOGGER.info(CleanUpJob.LOG_MARKER, form... | FlowableHistoricDataCleaner implements Cleaner { @Override public void execute(Date expirationTime) { long deletedProcessesCount = 0; long expiredProcessesPages = getExpiredProcessesPageCount(expirationTime); for (int i = 0; i < expiredProcessesPages; i++) { deletedProcessesCount += deleteExpiredProcessesPage(expiratio... | FlowableHistoricDataCleaner implements Cleaner { @Override public void execute(Date expirationTime) { long deletedProcessesCount = 0; long expiredProcessesPages = getExpiredProcessesPageCount(expirationTime); for (int i = 0; i < expiredProcessesPages; i++) { deletedProcessesCount += deleteExpiredProcessesPage(expiratio... | FlowableHistoricDataCleaner implements Cleaner { @Override public void execute(Date expirationTime) { long deletedProcessesCount = 0; long expiredProcessesPages = getExpiredProcessesPageCount(expirationTime); for (int i = 0; i < expiredProcessesPages; i++) { deletedProcessesCount += deleteExpiredProcessesPage(expiratio... | FlowableHistoricDataCleaner implements Cleaner { @Override public void execute(Date expirationTime) { long deletedProcessesCount = 0; long expiredProcessesPages = getExpiredProcessesPageCount(expirationTime); for (int i = 0; i < expiredProcessesPages; i++) { deletedProcessesCount += deleteExpiredProcessesPage(expiratio... |
@Test void testExecute() { cleaner.execute(EXPIRATION_TIME); verify(progressMessageService.createQuery() .olderThan(EXPIRATION_TIME)).delete(); } | @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_PROGRESS_MESSAGES_STORED_BEFORE_0, expirationTime)); int removedProgressMessages = progressMessageService.createQuery() .olderThan(expirationTime) .delete(); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messag... | ProgressMessagesCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_PROGRESS_MESSAGES_STORED_BEFORE_0, expirationTime)); int removedProgressMessages = progressMessageService.createQuery() .olderThan(expirationTime) .delete(); LOG... | ProgressMessagesCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_PROGRESS_MESSAGES_STORED_BEFORE_0, expirationTime)); int removedProgressMessages = progressMessageService.createQuery() .olderThan(expirationTime) .delete(); LOG... | ProgressMessagesCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_PROGRESS_MESSAGES_STORED_BEFORE_0, expirationTime)); int removedProgressMessages = progressMessageService.createQuery() .olderThan(expirationTime) .delete(); LOG... | ProgressMessagesCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_PROGRESS_MESSAGES_STORED_BEFORE_0, expirationTime)); int removedProgressMessages = progressMessageService.createQuery() .olderThan(expirationTime) .delete(); LOG... |
@Test void testExecuteWithNoAbortedOperations() { prepareMocksWithProcesses(Collections.emptyList()); abortedOperationsCleaner.execute(new Date()); Mockito.verify(historicOperationEventService) .createQuery(); Mockito.verifyNoInteractions(flowableFacade); } | @Override public void execute(Date expirationTime) { Instant instant = Instant.now() .minus(30, ChronoUnit.MINUTES); List<HistoricOperationEvent> abortedOperations = historicOperationEventService.createQuery() .type(HistoricOperationEvent.EventType.ABORTED) .olderThan(new Date(instant.toEpochMilli())) .list(); abortedO... | AbortedOperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { Instant instant = Instant.now() .minus(30, ChronoUnit.MINUTES); List<HistoricOperationEvent> abortedOperations = historicOperationEventService.createQuery() .type(HistoricOperationEvent.EventType.ABORTED) .olderThan(new D... | AbortedOperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { Instant instant = Instant.now() .minus(30, ChronoUnit.MINUTES); List<HistoricOperationEvent> abortedOperations = historicOperationEventService.createQuery() .type(HistoricOperationEvent.EventType.ABORTED) .olderThan(new D... | AbortedOperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { Instant instant = Instant.now() .minus(30, ChronoUnit.MINUTES); List<HistoricOperationEvent> abortedOperations = historicOperationEventService.createQuery() .type(HistoricOperationEvent.EventType.ABORTED) .olderThan(new D... | AbortedOperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { Instant instant = Instant.now() .minus(30, ChronoUnit.MINUTES); List<HistoricOperationEvent> abortedOperations = historicOperationEventService.createQuery() .type(HistoricOperationEvent.EventType.ABORTED) .olderThan(new D... |
@Test void testExecute() { prepareMocksWithProcesses(List.of(new CustomProcess("foo", true), new CustomProcess("bar", true))); abortedOperationsCleaner.execute(new Date()); Mockito.verify(flowableFacade, Mockito.times(2)) .getProcessInstance(anyString()); Mockito.verify(flowableFacade) .deleteProcessInstance("foo", Ope... | @Override public void execute(Date expirationTime) { Instant instant = Instant.now() .minus(30, ChronoUnit.MINUTES); List<HistoricOperationEvent> abortedOperations = historicOperationEventService.createQuery() .type(HistoricOperationEvent.EventType.ABORTED) .olderThan(new Date(instant.toEpochMilli())) .list(); abortedO... | AbortedOperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { Instant instant = Instant.now() .minus(30, ChronoUnit.MINUTES); List<HistoricOperationEvent> abortedOperations = historicOperationEventService.createQuery() .type(HistoricOperationEvent.EventType.ABORTED) .olderThan(new D... | AbortedOperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { Instant instant = Instant.now() .minus(30, ChronoUnit.MINUTES); List<HistoricOperationEvent> abortedOperations = historicOperationEventService.createQuery() .type(HistoricOperationEvent.EventType.ABORTED) .olderThan(new D... | AbortedOperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { Instant instant = Instant.now() .minus(30, ChronoUnit.MINUTES); List<HistoricOperationEvent> abortedOperations = historicOperationEventService.createQuery() .type(HistoricOperationEvent.EventType.ABORTED) .olderThan(new D... | AbortedOperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { Instant instant = Instant.now() .minus(30, ChronoUnit.MINUTES); List<HistoricOperationEvent> abortedOperations = historicOperationEventService.createQuery() .type(HistoricOperationEvent.EventType.ABORTED) .olderThan(new D... |
@Test void testExpiredOperationsAreAborted() { Operation operation1 = ImmutableOperation.builder() .processId(OPERATION_ID_1) .startedAt(epochMillisToZonedDateTime(TIME_BEFORE_EXPIRATION_1)) .build(); Operation operation2 = ImmutableOperation.builder() .processId(OPERATION_ID_2) .startedAt(epochMillisToZonedDateTime(TI... | @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTED_OPERATIONS_0, abortedOperations)); in... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... |
@Test void testAbortResilience() { Operation operation1 = ImmutableOperation.builder() .processId(OPERATION_ID_1) .startedAt(epochMillisToZonedDateTime(TIME_BEFORE_EXPIRATION_1)) .state(null) .build(); Operation operation2 = ImmutableOperation.builder() .processId(OPERATION_ID_2) .startedAt(epochMillisToZonedDateTime(T... | @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTED_OPERATIONS_0, abortedOperations)); in... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... |
@Test void testPaging() { Operation operation1 = ImmutableOperation.builder() .processId(OPERATION_ID_1) .startedAt(epochMillisToZonedDateTime(TIME_BEFORE_EXPIRATION_1)) .state(null) .build(); Operation operation2 = ImmutableOperation.builder() .processId(OPERATION_ID_2) .startedAt(epochMillisToZonedDateTime(TIME_BEFOR... | @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTED_OPERATIONS_0, abortedOperations)); in... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... |
@Test void testPagingAllOperationsAreIterated() { Operation operation1 = ImmutableOperation.builder() .processId(OPERATION_ID_1) .startedAt(epochMillisToZonedDateTime(TIME_BEFORE_EXPIRATION_1)) .state(Operation.State.FINISHED) .build(); Operation operation2 = ImmutableOperation.builder() .processId(OPERATION_ID_2) .sta... | @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTED_OPERATIONS_0, abortedOperations)); in... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... |
@Test void testFindJdbcServiceWithNullOrEmptyServiceName() { Assertions.assertNull(environmentServicesFinder.findJdbcService(null)); Assertions.assertNull(environmentServicesFinder.findJdbcService("")); } | public CfJdbcService findJdbcService(String name) { if (StringUtils.isEmpty(name)) { return null; } try { return env.findJdbcServiceByName(name); } catch (IllegalArgumentException e) { return null; } } | EnvironmentServicesFinder { public CfJdbcService findJdbcService(String name) { if (StringUtils.isEmpty(name)) { return null; } try { return env.findJdbcServiceByName(name); } catch (IllegalArgumentException e) { return null; } } } | EnvironmentServicesFinder { public CfJdbcService findJdbcService(String name) { if (StringUtils.isEmpty(name)) { return null; } try { return env.findJdbcServiceByName(name); } catch (IllegalArgumentException e) { return null; } } EnvironmentServicesFinder(); EnvironmentServicesFinder(CfJdbcEnv env); } | EnvironmentServicesFinder { public CfJdbcService findJdbcService(String name) { if (StringUtils.isEmpty(name)) { return null; } try { return env.findJdbcServiceByName(name); } catch (IllegalArgumentException e) { return null; } } EnvironmentServicesFinder(); EnvironmentServicesFinder(CfJdbcEnv env); CfJdbcService find... | EnvironmentServicesFinder { public CfJdbcService findJdbcService(String name) { if (StringUtils.isEmpty(name)) { return null; } try { return env.findJdbcServiceByName(name); } catch (IllegalArgumentException e) { return null; } } EnvironmentServicesFinder(); EnvironmentServicesFinder(CfJdbcEnv env); CfJdbcService find... |
@Test void testExpiredOperationsAreDeleted() { when(operationService.createQuery()).thenReturn(operationQuery); OperationQuery mock = new MockBuilder<>(operationQuery).on(query -> query.startedBefore(EXPIRATION_TIME)) .build(); cleaner.execute(EXPIRATION_TIME); verify(mock).delete(); } | @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTED_OPERATIONS_0, abortedOperations)); in... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... | OperationsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_OPERATIONS_STARTED_BEFORE_0, expirationTime)); int abortedOperations = abortActiveOperations(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.ABORTE... |
@Test void testExecute() { OAuth2AccessToken expiredToken = mock(OAuth2AccessToken.class); when(expiredToken.isExpired()).thenReturn(true); OAuth2AccessToken token = mock(OAuth2AccessToken.class); when(token.isExpired()).thenReturn(false); when(tokenStore.findTokensByClientId(anyString())).thenReturn(List.of(expiredTok... | @Override public void execute(Date expirationTime) { Collection<OAuth2AccessToken> tokens = tokenStore.findTokensByClientId(SecurityUtil.CLIENT_ID); LOGGER.debug(CleanUpJob.LOG_MARKER, Messages.REMOVING_EXPIRED_TOKENS_FROM_TOKEN_STORE); int removedTokens = removeTokens(tokens); LOGGER.info(CleanUpJob.LOG_MARKER, format... | TokensCleaner implements Cleaner { @Override public void execute(Date expirationTime) { Collection<OAuth2AccessToken> tokens = tokenStore.findTokensByClientId(SecurityUtil.CLIENT_ID); LOGGER.debug(CleanUpJob.LOG_MARKER, Messages.REMOVING_EXPIRED_TOKENS_FROM_TOKEN_STORE); int removedTokens = removeTokens(tokens); LOGGER... | TokensCleaner implements Cleaner { @Override public void execute(Date expirationTime) { Collection<OAuth2AccessToken> tokens = tokenStore.findTokensByClientId(SecurityUtil.CLIENT_ID); LOGGER.debug(CleanUpJob.LOG_MARKER, Messages.REMOVING_EXPIRED_TOKENS_FROM_TOKEN_STORE); int removedTokens = removeTokens(tokens); LOGGER... | TokensCleaner implements Cleaner { @Override public void execute(Date expirationTime) { Collection<OAuth2AccessToken> tokens = tokenStore.findTokensByClientId(SecurityUtil.CLIENT_ID); LOGGER.debug(CleanUpJob.LOG_MARKER, Messages.REMOVING_EXPIRED_TOKENS_FROM_TOKEN_STORE); int removedTokens = removeTokens(tokens); LOGGER... | TokensCleaner implements Cleaner { @Override public void execute(Date expirationTime) { Collection<OAuth2AccessToken> tokens = tokenStore.findTokensByClientId(SecurityUtil.CLIENT_ID); LOGGER.debug(CleanUpJob.LOG_MARKER, Messages.REMOVING_EXPIRED_TOKENS_FROM_TOKEN_STORE); int removedTokens = removeTokens(tokens); LOGGER... |
@Test void testExecute() throws FileStorageException { cleaner.execute(EXPIRATION_TIME); verify(fileService).deleteModifiedBefore(EXPIRATION_TIME); } | @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_FILES_MODIFIED_BEFORE_0, expirationTime)); try { int removedOldFilesCount = fileService.deleteModifiedBefore(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.DELETED_FILES_0, removedOldFi... | FilesCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_FILES_MODIFIED_BEFORE_0, expirationTime)); try { int removedOldFilesCount = fileService.deleteModifiedBefore(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Mess... | FilesCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_FILES_MODIFIED_BEFORE_0, expirationTime)); try { int removedOldFilesCount = fileService.deleteModifiedBefore(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Mess... | FilesCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_FILES_MODIFIED_BEFORE_0, expirationTime)); try { int removedOldFilesCount = fileService.deleteModifiedBefore(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Mess... | FilesCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_FILES_MODIFIED_BEFORE_0, expirationTime)); try { int removedOldFilesCount = fileService.deleteModifiedBefore(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Mess... |
@Test void testExecute() throws FileStorageException { cleaner.execute(EXPIRATION_TIME); verify(processLogsPersistenceService).deleteModifiedBefore(EXPIRATION_TIME); } | @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_PROCESS_LOGS_MODIFIED_BEFORE_0, expirationTime)); try { int deletedProcessLogs = processLogsPersistenceService.deleteModifiedBefore(expirationTime); LOGGER.info(CleanUpJob.LOG_MARKER, format(Messages.DELETE... | ProcessLogsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_PROCESS_LOGS_MODIFIED_BEFORE_0, expirationTime)); try { int deletedProcessLogs = processLogsPersistenceService.deleteModifiedBefore(expirationTime); LOGGER.info(Clean... | ProcessLogsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_PROCESS_LOGS_MODIFIED_BEFORE_0, expirationTime)); try { int deletedProcessLogs = processLogsPersistenceService.deleteModifiedBefore(expirationTime); LOGGER.info(Clean... | ProcessLogsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_PROCESS_LOGS_MODIFIED_BEFORE_0, expirationTime)); try { int deletedProcessLogs = processLogsPersistenceService.deleteModifiedBefore(expirationTime); LOGGER.info(Clean... | ProcessLogsCleaner implements Cleaner { @Override public void execute(Date expirationTime) { LOGGER.debug(CleanUpJob.LOG_MARKER, format(Messages.DELETING_PROCESS_LOGS_MODIFIED_BEFORE_0, expirationTime)); try { int deletedProcessLogs = processLogsPersistenceService.deleteModifiedBefore(expirationTime); LOGGER.info(Clean... |
@Test void testExecutionResilience() { Cleaner cleaner1 = Mockito.mock(Cleaner.class); Cleaner cleaner2 = Mockito.mock(Cleaner.class); Mockito.doThrow(new SLException("Will it work?")) .when(cleaner2) .execute(Mockito.any()); Cleaner cleaner3 = Mockito.mock(Cleaner.class); List<Cleaner> cleaners = List.of(cleaner1, cle... | @Override public void execute(JobExecutionContext context) { LOGGER.info(LOG_MARKER, format(Messages.CLEAN_UP_JOB_STARTED_BY_APPLICATION_INSTANCE_0_AT_1, configuration.getApplicationInstanceIndex(), Instant.now())); Date expirationTime = computeExpirationTime(); LOGGER.info(LOG_MARKER, format(Messages.WILL_CLEAN_UP_DAT... | CleanUpJob implements Job { @Override public void execute(JobExecutionContext context) { LOGGER.info(LOG_MARKER, format(Messages.CLEAN_UP_JOB_STARTED_BY_APPLICATION_INSTANCE_0_AT_1, configuration.getApplicationInstanceIndex(), Instant.now())); Date expirationTime = computeExpirationTime(); LOGGER.info(LOG_MARKER, forma... | CleanUpJob implements Job { @Override public void execute(JobExecutionContext context) { LOGGER.info(LOG_MARKER, format(Messages.CLEAN_UP_JOB_STARTED_BY_APPLICATION_INSTANCE_0_AT_1, configuration.getApplicationInstanceIndex(), Instant.now())); Date expirationTime = computeExpirationTime(); LOGGER.info(LOG_MARKER, forma... | CleanUpJob implements Job { @Override public void execute(JobExecutionContext context) { LOGGER.info(LOG_MARKER, format(Messages.CLEAN_UP_JOB_STARTED_BY_APPLICATION_INSTANCE_0_AT_1, configuration.getApplicationInstanceIndex(), Instant.now())); Date expirationTime = computeExpirationTime(); LOGGER.info(LOG_MARKER, forma... | CleanUpJob implements Job { @Override public void execute(JobExecutionContext context) { LOGGER.info(LOG_MARKER, format(Messages.CLEAN_UP_JOB_STARTED_BY_APPLICATION_INSTANCE_0_AT_1, configuration.getApplicationInstanceIndex(), Instant.now())); Date expirationTime = computeExpirationTime(); LOGGER.info(LOG_MARKER, forma... |
@Test void testJobExecutionFailureWithWrongEventClass() { FlowableEngineEntityEvent engineEntityEvent = Mockito.mock(FlowableEngineEntityEvent.class); errorProcessListener.jobExecutionFailure(engineEntityEvent); Mockito.verifyNoInteractions(eventHandler); } | @Override protected void jobExecutionFailure(FlowableEngineEntityEvent event) { if (event instanceof FlowableExceptionEvent) { handleWithCorrelationId(event, () -> handle(event, (FlowableExceptionEvent) event)); } } | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void jobExecutionFailure(FlowableEngineEntityEvent event) { if (event instanceof FlowableExceptionEvent) { handleWithCorrelationId(event, () -> handle(event, (FlowableExceptionEvent) event)); } } } | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void jobExecutionFailure(FlowableEngineEntityEvent event) { if (event instanceof FlowableExceptionEvent) { handleWithCorrelationId(event, () -> handle(event, (FlowableExceptionEvent) event)); } } @Inject ErrorProcessListener(Operati... | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void jobExecutionFailure(FlowableEngineEntityEvent event) { if (event instanceof FlowableExceptionEvent) { handleWithCorrelationId(event, () -> handle(event, (FlowableExceptionEvent) event)); } } @Inject ErrorProcessListener(Operati... | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void jobExecutionFailure(FlowableEngineEntityEvent event) { if (event instanceof FlowableExceptionEvent) { handleWithCorrelationId(event, () -> handle(event, (FlowableExceptionEvent) event)); } } @Inject ErrorProcessListener(Operati... |
@Test void testJobExecutionFailureWithNoException() { FlowableEngineEntityEvent engineEntityEvent = Mockito.mock(FlowableEngineEntityEvent.class, Mockito.withSettings() .extraInterfaces(FlowableExceptionEvent.class)); errorProcessListener.jobExecutionFailure(engineEntityEvent); Mockito.verifyNoInteractions(eventHandler... | @Override protected void jobExecutionFailure(FlowableEngineEntityEvent event) { if (event instanceof FlowableExceptionEvent) { handleWithCorrelationId(event, () -> handle(event, (FlowableExceptionEvent) event)); } } | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void jobExecutionFailure(FlowableEngineEntityEvent event) { if (event instanceof FlowableExceptionEvent) { handleWithCorrelationId(event, () -> handle(event, (FlowableExceptionEvent) event)); } } } | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void jobExecutionFailure(FlowableEngineEntityEvent event) { if (event instanceof FlowableExceptionEvent) { handleWithCorrelationId(event, () -> handle(event, (FlowableExceptionEvent) event)); } } @Inject ErrorProcessListener(Operati... | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void jobExecutionFailure(FlowableEngineEntityEvent event) { if (event instanceof FlowableExceptionEvent) { handleWithCorrelationId(event, () -> handle(event, (FlowableExceptionEvent) event)); } } @Inject ErrorProcessListener(Operati... | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void jobExecutionFailure(FlowableEngineEntityEvent event) { if (event instanceof FlowableExceptionEvent) { handleWithCorrelationId(event, () -> handle(event, (FlowableExceptionEvent) event)); } } @Inject ErrorProcessListener(Operati... |
@Test void testJobExecutionFailure() { FlowableEngineEntityEvent engineEntityEvent = Mockito.mock(FlowableEngineEntityEvent.class, Mockito.withSettings() .extraInterfaces(FlowableExceptionEvent.class)); FlowableExceptionEvent exceptionEvent = (FlowableExceptionEvent) engineEntityEvent; Throwable t = new Throwable(); Mo... | @Override protected void jobExecutionFailure(FlowableEngineEntityEvent event) { if (event instanceof FlowableExceptionEvent) { handleWithCorrelationId(event, () -> handle(event, (FlowableExceptionEvent) event)); } } | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void jobExecutionFailure(FlowableEngineEntityEvent event) { if (event instanceof FlowableExceptionEvent) { handleWithCorrelationId(event, () -> handle(event, (FlowableExceptionEvent) event)); } } } | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void jobExecutionFailure(FlowableEngineEntityEvent event) { if (event instanceof FlowableExceptionEvent) { handleWithCorrelationId(event, () -> handle(event, (FlowableExceptionEvent) event)); } } @Inject ErrorProcessListener(Operati... | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void jobExecutionFailure(FlowableEngineEntityEvent event) { if (event instanceof FlowableExceptionEvent) { handleWithCorrelationId(event, () -> handle(event, (FlowableExceptionEvent) event)); } } @Inject ErrorProcessListener(Operati... | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void jobExecutionFailure(FlowableEngineEntityEvent event) { if (event instanceof FlowableExceptionEvent) { handleWithCorrelationId(event, () -> handle(event, (FlowableExceptionEvent) event)); } } @Inject ErrorProcessListener(Operati... |
@Test void testEntityCreatedWithWrongEntityClass() { FlowableEngineEntityEvent engineEntityEvent = Mockito.mock(FlowableEngineEntityEvent.class); JobEntity job = Mockito.mock(JobEntity.class); Mockito.when(engineEntityEvent.getEntity()) .thenReturn(job); errorProcessListener.entityCreated(engineEntityEvent); Mockito.ve... | @Override protected void entityCreated(FlowableEngineEntityEvent event) { Object entity = event.getEntity(); if (entity instanceof DeadLetterJobEntity) { handleWithCorrelationId(event, () -> handle(event, (DeadLetterJobEntity) entity)); } } | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void entityCreated(FlowableEngineEntityEvent event) { Object entity = event.getEntity(); if (entity instanceof DeadLetterJobEntity) { handleWithCorrelationId(event, () -> handle(event, (DeadLetterJobEntity) entity)); } } } | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void entityCreated(FlowableEngineEntityEvent event) { Object entity = event.getEntity(); if (entity instanceof DeadLetterJobEntity) { handleWithCorrelationId(event, () -> handle(event, (DeadLetterJobEntity) entity)); } } @Inject Err... | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void entityCreated(FlowableEngineEntityEvent event) { Object entity = event.getEntity(); if (entity instanceof DeadLetterJobEntity) { handleWithCorrelationId(event, () -> handle(event, (DeadLetterJobEntity) entity)); } } @Inject Err... | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void entityCreated(FlowableEngineEntityEvent event) { Object entity = event.getEntity(); if (entity instanceof DeadLetterJobEntity) { handleWithCorrelationId(event, () -> handle(event, (DeadLetterJobEntity) entity)); } } @Inject Err... |
@Test void testEntityCreatedWithNoException() { FlowableEngineEntityEvent engineEntityEvent = Mockito.mock(FlowableEngineEntityEvent.class); DeadLetterJobEntity job = Mockito.mock(DeadLetterJobEntity.class); Mockito.when(engineEntityEvent.getEntity()) .thenReturn(job); errorProcessListener.entityCreated(engineEntityEve... | @Override protected void entityCreated(FlowableEngineEntityEvent event) { Object entity = event.getEntity(); if (entity instanceof DeadLetterJobEntity) { handleWithCorrelationId(event, () -> handle(event, (DeadLetterJobEntity) entity)); } } | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void entityCreated(FlowableEngineEntityEvent event) { Object entity = event.getEntity(); if (entity instanceof DeadLetterJobEntity) { handleWithCorrelationId(event, () -> handle(event, (DeadLetterJobEntity) entity)); } } } | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void entityCreated(FlowableEngineEntityEvent event) { Object entity = event.getEntity(); if (entity instanceof DeadLetterJobEntity) { handleWithCorrelationId(event, () -> handle(event, (DeadLetterJobEntity) entity)); } } @Inject Err... | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void entityCreated(FlowableEngineEntityEvent event) { Object entity = event.getEntity(); if (entity instanceof DeadLetterJobEntity) { handleWithCorrelationId(event, () -> handle(event, (DeadLetterJobEntity) entity)); } } @Inject Err... | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void entityCreated(FlowableEngineEntityEvent event) { Object entity = event.getEntity(); if (entity instanceof DeadLetterJobEntity) { handleWithCorrelationId(event, () -> handle(event, (DeadLetterJobEntity) entity)); } } @Inject Err... |
@Test void testFindService() { CfService expectedService = Mockito.mock(CfService.class); Mockito.when(env.findServicesByName(SERVICE_NAME)) .thenReturn(List.of(expectedService)); CfService service = environmentServicesFinder.findService(SERVICE_NAME); Assertions.assertEquals(expectedService, service); } | public CfService findService(String name) { if (StringUtils.isEmpty(name)) { return null; } return CollectionUtils.firstElement(env.findServicesByName(name)); } | EnvironmentServicesFinder { public CfService findService(String name) { if (StringUtils.isEmpty(name)) { return null; } return CollectionUtils.firstElement(env.findServicesByName(name)); } } | EnvironmentServicesFinder { public CfService findService(String name) { if (StringUtils.isEmpty(name)) { return null; } return CollectionUtils.firstElement(env.findServicesByName(name)); } EnvironmentServicesFinder(); EnvironmentServicesFinder(CfJdbcEnv env); } | EnvironmentServicesFinder { public CfService findService(String name) { if (StringUtils.isEmpty(name)) { return null; } return CollectionUtils.firstElement(env.findServicesByName(name)); } EnvironmentServicesFinder(); EnvironmentServicesFinder(CfJdbcEnv env); CfJdbcService findJdbcService(String name); CfService findS... | EnvironmentServicesFinder { public CfService findService(String name) { if (StringUtils.isEmpty(name)) { return null; } return CollectionUtils.firstElement(env.findServicesByName(name)); } EnvironmentServicesFinder(); EnvironmentServicesFinder(CfJdbcEnv env); CfJdbcService findJdbcService(String name); CfService findS... |
@Test void testEntityCreated() { FlowableEngineEntityEvent engineEntityEvent = Mockito.mock(FlowableEngineEntityEvent.class); DeadLetterJobEntity job = Mockito.mock(DeadLetterJobEntity.class); Mockito.when(engineEntityEvent.getEntity()) .thenReturn(job); Mockito.when(job.getExceptionMessage()) .thenReturn(ERROR_MESSAGE... | @Override protected void entityCreated(FlowableEngineEntityEvent event) { Object entity = event.getEntity(); if (entity instanceof DeadLetterJobEntity) { handleWithCorrelationId(event, () -> handle(event, (DeadLetterJobEntity) entity)); } } | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void entityCreated(FlowableEngineEntityEvent event) { Object entity = event.getEntity(); if (entity instanceof DeadLetterJobEntity) { handleWithCorrelationId(event, () -> handle(event, (DeadLetterJobEntity) entity)); } } } | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void entityCreated(FlowableEngineEntityEvent event) { Object entity = event.getEntity(); if (entity instanceof DeadLetterJobEntity) { handleWithCorrelationId(event, () -> handle(event, (DeadLetterJobEntity) entity)); } } @Inject Err... | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void entityCreated(FlowableEngineEntityEvent event) { Object entity = event.getEntity(); if (entity instanceof DeadLetterJobEntity) { handleWithCorrelationId(event, () -> handle(event, (DeadLetterJobEntity) entity)); } } @Inject Err... | ErrorProcessListener extends AbstractFlowableEngineEventListener { @Override protected void entityCreated(FlowableEngineEntityEvent event) { Object entity = event.getEntity(); if (entity instanceof DeadLetterJobEntity) { handleWithCorrelationId(event, () -> handle(event, (DeadLetterJobEntity) entity)); } } @Inject Err... |
@Test void testNotify() { setBeforeApplicationStopPhaseListener.notify(delegateExecution); Assertions.assertEquals(SubprocessPhase.BEFORE_APPLICATION_STOP.toString(), delegateExecution.getVariable(Variables.SUBPROCESS_PHASE.getName())); } | @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.SUBPROCESS_PHASE, SubprocessPhase.BEFORE_APPLICATION_STOP); } | SetBeforeApplicationStopPhaseListener implements ExecutionListener { @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.SUBPROCESS_PHASE, SubprocessPhase.BEFORE_APPLICATION_STOP); } } | SetBeforeApplicationStopPhaseListener implements ExecutionListener { @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.SUBPROCESS_PHASE, SubprocessPhase.BEFORE_APPLICATION_STOP); } } | SetBeforeApplicationStopPhaseListener implements ExecutionListener { @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.SUBPROCESS_PHASE, SubprocessPhase.BEFORE_APPLICATION_STOP); } @Override void notify(DelegateExecution execution); } | SetBeforeApplicationStopPhaseListener implements ExecutionListener { @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.SUBPROCESS_PHASE, SubprocessPhase.BEFORE_APPLICATION_STOP); } @Override void notify(DelegateExecution execution); } |
@Test void testNotify() { setBeforeApplicationStartPhaseListener.notify(delegateExecution); Assertions.assertEquals(SubprocessPhase.BEFORE_APPLICATION_START.toString(), delegateExecution.getVariable(Variables.SUBPROCESS_PHASE.getName())); } | @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.SUBPROCESS_PHASE, SubprocessPhase.BEFORE_APPLICATION_START); } | SetBeforeApplicationStartPhaseListener implements ExecutionListener { @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.SUBPROCESS_PHASE, SubprocessPhase.BEFORE_APPLICATION_START); } } | SetBeforeApplicationStartPhaseListener implements ExecutionListener { @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.SUBPROCESS_PHASE, SubprocessPhase.BEFORE_APPLICATION_START); } } | SetBeforeApplicationStartPhaseListener implements ExecutionListener { @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.SUBPROCESS_PHASE, SubprocessPhase.BEFORE_APPLICATION_START); } @Override void notify(DelegateExecution execution); } | SetBeforeApplicationStartPhaseListener implements ExecutionListener { @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.SUBPROCESS_PHASE, SubprocessPhase.BEFORE_APPLICATION_START); } @Override void notify(DelegateExecution execution); } |
@Test void testNotifyInternal() { EndProcessListener endProcessListener = new EndProcessListener(eventHandler); VariableHandling.set(execution, Variables.CORRELATION_ID, execution.getProcessInstanceId()); endProcessListener.notifyInternal(execution); Mockito.verify(eventHandler) .handle(execution, Operation.State.FINIS... | @Override protected void notifyInternal(DelegateExecution execution) { if (isRootProcess(execution)) { eventHandler.handle(execution, Operation.State.FINISHED); } } | EndProcessListener extends AbstractProcessExecutionListener { @Override protected void notifyInternal(DelegateExecution execution) { if (isRootProcess(execution)) { eventHandler.handle(execution, Operation.State.FINISHED); } } } | EndProcessListener extends AbstractProcessExecutionListener { @Override protected void notifyInternal(DelegateExecution execution) { if (isRootProcess(execution)) { eventHandler.handle(execution, Operation.State.FINISHED); } } @Inject EndProcessListener(OperationInFinalStateHandler eventHandler); } | EndProcessListener extends AbstractProcessExecutionListener { @Override protected void notifyInternal(DelegateExecution execution) { if (isRootProcess(execution)) { eventHandler.handle(execution, Operation.State.FINISHED); } } @Inject EndProcessListener(OperationInFinalStateHandler eventHandler); } | EndProcessListener extends AbstractProcessExecutionListener { @Override protected void notifyInternal(DelegateExecution execution) { if (isRootProcess(execution)) { eventHandler.handle(execution, Operation.State.FINISHED); } } @Inject EndProcessListener(OperationInFinalStateHandler eventHandler); } |
@Test void testNotify() { setUndeployPhaseListener.notify(delegateExecution); Assertions.assertEquals(Phase.UNDEPLOY.toString(), delegateExecution.getVariable(Variables.PHASE.getName())); } | @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.PHASE, Phase.UNDEPLOY); } | SetUndeployPhaseListener implements ExecutionListener { @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.PHASE, Phase.UNDEPLOY); } } | SetUndeployPhaseListener implements ExecutionListener { @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.PHASE, Phase.UNDEPLOY); } } | SetUndeployPhaseListener implements ExecutionListener { @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.PHASE, Phase.UNDEPLOY); } @Override void notify(DelegateExecution execution); } | SetUndeployPhaseListener implements ExecutionListener { @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.PHASE, Phase.UNDEPLOY); } @Override void notify(DelegateExecution execution); } |
@Test void testNotify() { setResumePhaseListener.notify(delegateExecution); Assertions.assertEquals(Phase.AFTER_RESUME.toString(), delegateExecution.getVariable(Variables.PHASE.getName())); } | @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.PHASE, Phase.AFTER_RESUME); } | SetAfterResumePhaseListener implements ExecutionListener { @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.PHASE, Phase.AFTER_RESUME); } } | SetAfterResumePhaseListener implements ExecutionListener { @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.PHASE, Phase.AFTER_RESUME); } } | SetAfterResumePhaseListener implements ExecutionListener { @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.PHASE, Phase.AFTER_RESUME); } @Override void notify(DelegateExecution execution); } | SetAfterResumePhaseListener implements ExecutionListener { @Override public void notify(DelegateExecution execution) { VariableHandling.set(execution, Variables.PHASE, Phase.AFTER_RESUME); } @Override void notify(DelegateExecution execution); } |
@Test void testFailToCreateZip() { String fileName = "db/"; ApplicationArchiveReader reader = new ApplicationArchiveReader(); ApplicationZipBuilder zipBuilder = new ApplicationZipBuilder(reader) { @Override protected void copy(InputStream input, OutputStream output, ApplicationArchiveContext applicationArchiveContext) ... | public Path extractApplicationInNewArchive(ApplicationArchiveContext applicationArchiveContext) { Path appPath = null; try { appPath = createTempFile(); saveAllEntries(appPath, applicationArchiveContext); return appPath; } catch (Exception e) { FileUtils.cleanUp(appPath, LOGGER); throw new SLException(e, Messages.ERROR... | ApplicationZipBuilder { public Path extractApplicationInNewArchive(ApplicationArchiveContext applicationArchiveContext) { Path appPath = null; try { appPath = createTempFile(); saveAllEntries(appPath, applicationArchiveContext); return appPath; } catch (Exception e) { FileUtils.cleanUp(appPath, LOGGER); throw new SLExc... | ApplicationZipBuilder { public Path extractApplicationInNewArchive(ApplicationArchiveContext applicationArchiveContext) { Path appPath = null; try { appPath = createTempFile(); saveAllEntries(appPath, applicationArchiveContext); return appPath; } catch (Exception e) { FileUtils.cleanUp(appPath, LOGGER); throw new SLExc... | ApplicationZipBuilder { public Path extractApplicationInNewArchive(ApplicationArchiveContext applicationArchiveContext) { Path appPath = null; try { appPath = createTempFile(); saveAllEntries(appPath, applicationArchiveContext); return appPath; } catch (Exception e) { FileUtils.cleanUp(appPath, LOGGER); throw new SLExc... | ApplicationZipBuilder { public Path extractApplicationInNewArchive(ApplicationArchiveContext applicationArchiveContext) { Path appPath = null; try { appPath = createTempFile(); saveAllEntries(appPath, applicationArchiveContext); return appPath; } catch (Exception e) { FileUtils.cleanUp(appPath, LOGGER); throw new SLExc... |
@Test void getLatestUnusedPackageWithNoPackagesNoDroplet() { Mockito.when(client.getCurrentDropletForApplication(APPLICATION_GUID)) .thenThrow(getNotFoundCloudOperationException()); Optional<CloudPackage> latestUnusedPackage = cloudPackagesGetter.getLatestUnusedPackage(client, APPLICATION_GUID); assertFalse(latestUnuse... | public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return getMostRecentCloudPack... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... |
@Test void getLatestUnusedPackageExceptionIsThrown() { Mockito.when(client.getCurrentDropletForApplication(APPLICATION_GUID)) .thenThrow(getInternalServerErrorCloudOperationException()); Exception exception = assertThrows(CloudOperationException.class, () -> cloudPackagesGetter.getLatestUnusedPackage(client, APPLICATIO... | public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return getMostRecentCloudPack... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... |
@Test void getLatestUnusedPackageWithOneValidPackageNoDroplet() { Mockito.when(client.getCurrentDropletForApplication(APPLICATION_GUID)) .thenThrow(getNotFoundCloudOperationException()); Mockito.when(client.getPackagesForApplication(APPLICATION_GUID)) .thenReturn(List.of(createCloudPackage(PACKAGE_GUID, Status.PROCESSI... | public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return getMostRecentCloudPack... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... |
@Test void testFindServiceWithMultipleMatches() { CfService expectedService1 = Mockito.mock(CfService.class); CfService expectedService2 = Mockito.mock(CfService.class); Mockito.when(env.findServicesByName(SERVICE_NAME)) .thenReturn(List.of(expectedService1, expectedService2)); CfService service = environmentServicesFi... | public CfService findService(String name) { if (StringUtils.isEmpty(name)) { return null; } return CollectionUtils.firstElement(env.findServicesByName(name)); } | EnvironmentServicesFinder { public CfService findService(String name) { if (StringUtils.isEmpty(name)) { return null; } return CollectionUtils.firstElement(env.findServicesByName(name)); } } | EnvironmentServicesFinder { public CfService findService(String name) { if (StringUtils.isEmpty(name)) { return null; } return CollectionUtils.firstElement(env.findServicesByName(name)); } EnvironmentServicesFinder(); EnvironmentServicesFinder(CfJdbcEnv env); } | EnvironmentServicesFinder { public CfService findService(String name) { if (StringUtils.isEmpty(name)) { return null; } return CollectionUtils.firstElement(env.findServicesByName(name)); } EnvironmentServicesFinder(); EnvironmentServicesFinder(CfJdbcEnv env); CfJdbcService findJdbcService(String name); CfService findS... | EnvironmentServicesFinder { public CfService findService(String name) { if (StringUtils.isEmpty(name)) { return null; } return CollectionUtils.firstElement(env.findServicesByName(name)); } EnvironmentServicesFinder(); EnvironmentServicesFinder(CfJdbcEnv env); CfJdbcService findJdbcService(String name); CfService findS... |
@Test void getLatestUnusedPackageWithDropletAndWithoutPackages() { Mockito.when(client.getCurrentDropletForApplication(APPLICATION_GUID)) .thenReturn(createDropletInfo(DROPLET_GUID, PACKAGE_GUID)); Mockito.when(client.getPackage(PACKAGE_GUID)) .thenThrow(getNotFoundCloudOperationException()); Optional<CloudPackage> lat... | public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return getMostRecentCloudPack... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... |
@Test void getLatestUnusedPackageWhenCurrentPackageIsTheSameAsNewestPackage() { Mockito.when(client.getCurrentDropletForApplication(APPLICATION_GUID)) .thenReturn(createDropletInfo(DROPLET_GUID, PACKAGE_GUID)); CloudPackage cloudPackage = createCloudPackage(PACKAGE_GUID, Status.READY, new Date()); Mockito.when(client.g... | public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return getMostRecentCloudPack... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... |
@Test void getLatestUnusedPackageWhenNoPackagesAreFound() { Mockito.when(client.getCurrentDropletForApplication(APPLICATION_GUID)) .thenReturn(createDropletInfo(DROPLET_GUID, PACKAGE_GUID)); Mockito.when(client.getPackage(PACKAGE_GUID)) .thenReturn(createCloudPackage(PACKAGE_GUID, Status.READY, new Date(System.currentT... | public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return getMostRecentCloudPack... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... |
@Test void getLatestUnusedPackageWhenThereIsNewerPackage() throws ParseException { Mockito.when(client.getCurrentDropletForApplication(APPLICATION_GUID)) .thenReturn(createDropletInfo(DROPLET_GUID, PACKAGE_GUID)); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMAT); Mockito.when(client.getPackage(PACK... | public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return getMostRecentCloudPack... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... | CloudPackagesGetter { public Optional<CloudPackage> getLatestUnusedPackage(CloudControllerClient client, UUID applicationGuid) { Optional<DropletInfo> currentDropletForApplication = findOrReturnEmpty(() -> client.getCurrentDropletForApplication(applicationGuid)); if (!currentDropletForApplication.isPresent()) { return ... |
@Test void testToEventType() { OperationInErrorStateHandler handler = mockHandler(); Throwable throwable = new RuntimeException(new SLException(new IOException())); HistoricOperationEvent.EventType eventType = handler.toEventType(throwable); assertEquals(HistoricOperationEvent.EventType.FAILED_BY_INFRASTRUCTURE_ERROR, ... | HistoricOperationEvent.EventType toEventType(Throwable throwable) { return hasCause(throwable, ContentException.class) ? HistoricOperationEvent.EventType.FAILED_BY_CONTENT_ERROR : HistoricOperationEvent.EventType.FAILED_BY_INFRASTRUCTURE_ERROR; } | OperationInErrorStateHandler { HistoricOperationEvent.EventType toEventType(Throwable throwable) { return hasCause(throwable, ContentException.class) ? HistoricOperationEvent.EventType.FAILED_BY_CONTENT_ERROR : HistoricOperationEvent.EventType.FAILED_BY_INFRASTRUCTURE_ERROR; } } | OperationInErrorStateHandler { HistoricOperationEvent.EventType toEventType(Throwable throwable) { return hasCause(throwable, ContentException.class) ? HistoricOperationEvent.EventType.FAILED_BY_CONTENT_ERROR : HistoricOperationEvent.EventType.FAILED_BY_INFRASTRUCTURE_ERROR; } @Inject OperationInErrorStateHandler(Prog... | OperationInErrorStateHandler { HistoricOperationEvent.EventType toEventType(Throwable throwable) { return hasCause(throwable, ContentException.class) ? HistoricOperationEvent.EventType.FAILED_BY_CONTENT_ERROR : HistoricOperationEvent.EventType.FAILED_BY_INFRASTRUCTURE_ERROR; } @Inject OperationInErrorStateHandler(Prog... | OperationInErrorStateHandler { HistoricOperationEvent.EventType toEventType(Throwable throwable) { return hasCause(throwable, ContentException.class) ? HistoricOperationEvent.EventType.FAILED_BY_CONTENT_ERROR : HistoricOperationEvent.EventType.FAILED_BY_INFRASTRUCTURE_ERROR; } @Inject OperationInErrorStateHandler(Prog... |
@Test void testToEventTypeWithContentException() { OperationInErrorStateHandler handler = mockHandler(); Throwable throwable = new RuntimeException(new SLException(new IOException(new ParsingException("")))); HistoricOperationEvent.EventType eventType = handler.toEventType(throwable); assertEquals(HistoricOperationEven... | HistoricOperationEvent.EventType toEventType(Throwable throwable) { return hasCause(throwable, ContentException.class) ? HistoricOperationEvent.EventType.FAILED_BY_CONTENT_ERROR : HistoricOperationEvent.EventType.FAILED_BY_INFRASTRUCTURE_ERROR; } | OperationInErrorStateHandler { HistoricOperationEvent.EventType toEventType(Throwable throwable) { return hasCause(throwable, ContentException.class) ? HistoricOperationEvent.EventType.FAILED_BY_CONTENT_ERROR : HistoricOperationEvent.EventType.FAILED_BY_INFRASTRUCTURE_ERROR; } } | OperationInErrorStateHandler { HistoricOperationEvent.EventType toEventType(Throwable throwable) { return hasCause(throwable, ContentException.class) ? HistoricOperationEvent.EventType.FAILED_BY_CONTENT_ERROR : HistoricOperationEvent.EventType.FAILED_BY_INFRASTRUCTURE_ERROR; } @Inject OperationInErrorStateHandler(Prog... | OperationInErrorStateHandler { HistoricOperationEvent.EventType toEventType(Throwable throwable) { return hasCause(throwable, ContentException.class) ? HistoricOperationEvent.EventType.FAILED_BY_CONTENT_ERROR : HistoricOperationEvent.EventType.FAILED_BY_INFRASTRUCTURE_ERROR; } @Inject OperationInErrorStateHandler(Prog... | OperationInErrorStateHandler { HistoricOperationEvent.EventType toEventType(Throwable throwable) { return hasCause(throwable, ContentException.class) ? HistoricOperationEvent.EventType.FAILED_BY_CONTENT_ERROR : HistoricOperationEvent.EventType.FAILED_BY_INFRASTRUCTURE_ERROR; } @Inject OperationInErrorStateHandler(Prog... |
@Test void testWithErrorMessageAlreadyPersisted() { Mockito.when(flowableFacadeMock.getProcessInstanceId(Mockito.any())) .thenReturn("foo"); ProgressMessageQuery queryMock = new MockBuilder<>(progressMessageQuery).on(query -> query.processId("foo")) .build(); Mockito.doReturn(List.of(ImmutableProgressMessage.builder() ... | public void handle(FlowableEngineEvent event, String errorMessage) { handle(event, HistoricOperationEvent.EventType.FAILED_BY_INFRASTRUCTURE_ERROR, errorMessage); } | OperationInErrorStateHandler { public void handle(FlowableEngineEvent event, String errorMessage) { handle(event, HistoricOperationEvent.EventType.FAILED_BY_INFRASTRUCTURE_ERROR, errorMessage); } } | OperationInErrorStateHandler { public void handle(FlowableEngineEvent event, String errorMessage) { handle(event, HistoricOperationEvent.EventType.FAILED_BY_INFRASTRUCTURE_ERROR, errorMessage); } @Inject OperationInErrorStateHandler(ProgressMessageService progressMessageService, FlowableFacade flowableFacade,
... | OperationInErrorStateHandler { public void handle(FlowableEngineEvent event, String errorMessage) { handle(event, HistoricOperationEvent.EventType.FAILED_BY_INFRASTRUCTURE_ERROR, errorMessage); } @Inject OperationInErrorStateHandler(ProgressMessageService progressMessageService, FlowableFacade flowableFacade,
... | OperationInErrorStateHandler { public void handle(FlowableEngineEvent event, String errorMessage) { handle(event, HistoricOperationEvent.EventType.FAILED_BY_INFRASTRUCTURE_ERROR, errorMessage); } @Inject OperationInErrorStateHandler(ProgressMessageService progressMessageService, FlowableFacade flowableFacade,
... |
@Test void testWithNoErrorMessageAndTaskIdFromContext() { Mockito.when(flowableFacadeMock.getCurrentTaskId("bar")) .thenReturn("barbar"); testWithNoErrorMessageWithExecutionEntity(false); } | private String getCurrentTaskId(FlowableEngineEvent flowableEngineEvent) { Execution currentExecutionForProcess = findCurrentExecution(flowableEngineEvent); return currentExecutionForProcess != null ? currentExecutionForProcess.getActivityId() : flowableFacade.getCurrentTaskId(flowableEngineEvent.getExecutionId()); } | OperationInErrorStateHandler { private String getCurrentTaskId(FlowableEngineEvent flowableEngineEvent) { Execution currentExecutionForProcess = findCurrentExecution(flowableEngineEvent); return currentExecutionForProcess != null ? currentExecutionForProcess.getActivityId() : flowableFacade.getCurrentTaskId(flowableEng... | OperationInErrorStateHandler { private String getCurrentTaskId(FlowableEngineEvent flowableEngineEvent) { Execution currentExecutionForProcess = findCurrentExecution(flowableEngineEvent); return currentExecutionForProcess != null ? currentExecutionForProcess.getActivityId() : flowableFacade.getCurrentTaskId(flowableEng... | OperationInErrorStateHandler { private String getCurrentTaskId(FlowableEngineEvent flowableEngineEvent) { Execution currentExecutionForProcess = findCurrentExecution(flowableEngineEvent); return currentExecutionForProcess != null ? currentExecutionForProcess.getActivityId() : flowableFacade.getCurrentTaskId(flowableEng... | OperationInErrorStateHandler { private String getCurrentTaskId(FlowableEngineEvent flowableEngineEvent) { Execution currentExecutionForProcess = findCurrentExecution(flowableEngineEvent); return currentExecutionForProcess != null ? currentExecutionForProcess.getActivityId() : flowableFacade.getCurrentTaskId(flowableEng... |
@Test void testGetHookPhasesBeforeStopNonHooksClass() { SyncFlowableStep syncFlowableStep = Mockito.mock(SyncFlowableStep.class); List<HookPhase> hookPhasesBeforeStop = hooksPhaseGetter.getHookPhasesBeforeStop(syncFlowableStep, context); Assertions.assertEquals(1, hookPhasesBeforeStop.size()); Assertions.assertEquals(H... | public List<HookPhase> getHookPhasesBeforeStop(SyncFlowableStep syncFlowableStep, ProcessContext context) { if (syncFlowableStep instanceof BeforeStepHookPhaseProvider) { return ((BeforeStepHookPhaseProvider) syncFlowableStep).getHookPhasesBeforeStep(context); } return Collections.singletonList(HookPhase.NONE); } | HooksPhaseGetter { public List<HookPhase> getHookPhasesBeforeStop(SyncFlowableStep syncFlowableStep, ProcessContext context) { if (syncFlowableStep instanceof BeforeStepHookPhaseProvider) { return ((BeforeStepHookPhaseProvider) syncFlowableStep).getHookPhasesBeforeStep(context); } return Collections.singletonList(HookP... | HooksPhaseGetter { public List<HookPhase> getHookPhasesBeforeStop(SyncFlowableStep syncFlowableStep, ProcessContext context) { if (syncFlowableStep instanceof BeforeStepHookPhaseProvider) { return ((BeforeStepHookPhaseProvider) syncFlowableStep).getHookPhasesBeforeStep(context); } return Collections.singletonList(HookP... | HooksPhaseGetter { public List<HookPhase> getHookPhasesBeforeStop(SyncFlowableStep syncFlowableStep, ProcessContext context) { if (syncFlowableStep instanceof BeforeStepHookPhaseProvider) { return ((BeforeStepHookPhaseProvider) syncFlowableStep).getHookPhasesBeforeStep(context); } return Collections.singletonList(HookP... | HooksPhaseGetter { public List<HookPhase> getHookPhasesBeforeStop(SyncFlowableStep syncFlowableStep, ProcessContext context) { if (syncFlowableStep instanceof BeforeStepHookPhaseProvider) { return ((BeforeStepHookPhaseProvider) syncFlowableStep).getHookPhasesBeforeStep(context); } return Collections.singletonList(HookP... |
@Test void testGetHookPhasesAfterStopNonHooksClass() { SyncFlowableStep syncFlowableStep = Mockito.mock(SyncFlowableStep.class); List<HookPhase> hookPhasesAfterStop = hooksPhaseGetter.getHookPhasesAfterStop(syncFlowableStep, context); Assertions.assertEquals(1, hookPhasesAfterStop.size()); Assertions.assertEquals(HookP... | public List<HookPhase> getHookPhasesAfterStop(SyncFlowableStep syncFlowableStep, ProcessContext context) { if (syncFlowableStep instanceof AfterStepHookPhaseProvider) { return ((AfterStepHookPhaseProvider) syncFlowableStep).getHookPhasesAfterStep(context); } return Collections.singletonList(HookPhase.NONE); } | HooksPhaseGetter { public List<HookPhase> getHookPhasesAfterStop(SyncFlowableStep syncFlowableStep, ProcessContext context) { if (syncFlowableStep instanceof AfterStepHookPhaseProvider) { return ((AfterStepHookPhaseProvider) syncFlowableStep).getHookPhasesAfterStep(context); } return Collections.singletonList(HookPhase... | HooksPhaseGetter { public List<HookPhase> getHookPhasesAfterStop(SyncFlowableStep syncFlowableStep, ProcessContext context) { if (syncFlowableStep instanceof AfterStepHookPhaseProvider) { return ((AfterStepHookPhaseProvider) syncFlowableStep).getHookPhasesAfterStep(context); } return Collections.singletonList(HookPhase... | HooksPhaseGetter { public List<HookPhase> getHookPhasesAfterStop(SyncFlowableStep syncFlowableStep, ProcessContext context) { if (syncFlowableStep instanceof AfterStepHookPhaseProvider) { return ((AfterStepHookPhaseProvider) syncFlowableStep).getHookPhasesAfterStep(context); } return Collections.singletonList(HookPhase... | HooksPhaseGetter { public List<HookPhase> getHookPhasesAfterStop(SyncFlowableStep syncFlowableStep, ProcessContext context) { if (syncFlowableStep instanceof AfterStepHookPhaseProvider) { return ((AfterStepHookPhaseProvider) syncFlowableStep).getHookPhasesAfterStep(context); } return Collections.singletonList(HookPhase... |
@Test void testFindServiceWithZeroMatches() { Mockito.when(env.findServicesByName(SERVICE_NAME)) .thenReturn(Collections.emptyList()); CfService service = environmentServicesFinder.findService(SERVICE_NAME); Assertions.assertNull(service); } | public CfService findService(String name) { if (StringUtils.isEmpty(name)) { return null; } return CollectionUtils.firstElement(env.findServicesByName(name)); } | EnvironmentServicesFinder { public CfService findService(String name) { if (StringUtils.isEmpty(name)) { return null; } return CollectionUtils.firstElement(env.findServicesByName(name)); } } | EnvironmentServicesFinder { public CfService findService(String name) { if (StringUtils.isEmpty(name)) { return null; } return CollectionUtils.firstElement(env.findServicesByName(name)); } EnvironmentServicesFinder(); EnvironmentServicesFinder(CfJdbcEnv env); } | EnvironmentServicesFinder { public CfService findService(String name) { if (StringUtils.isEmpty(name)) { return null; } return CollectionUtils.firstElement(env.findServicesByName(name)); } EnvironmentServicesFinder(); EnvironmentServicesFinder(CfJdbcEnv env); CfJdbcService findJdbcService(String name); CfService findS... | EnvironmentServicesFinder { public CfService findService(String name) { if (StringUtils.isEmpty(name)) { return null; } return CollectionUtils.firstElement(env.findServicesByName(name)); } EnvironmentServicesFinder(); EnvironmentServicesFinder(CfJdbcEnv env); CfJdbcService findJdbcService(String name); CfService findS... |
@Test public void testTopicExistsForNonexistentTopic() throws Exception { assertFalse(topicEnsure.topicExists(simpleTopicSpec("unknown-topic"), TIMEOUT_MS)); } | public boolean topicExists(TopicSpec spec, Integer timeOut) throws Exception { try { DescribeTopicsResult topicDescribeResult = adminClient.describeTopics( Collections.singletonList(spec.name()), new DescribeTopicsOptions().timeoutMs(timeOut) ); topicDescribeResult.all().get().get(spec.name()); } catch (ExecutionExcept... | TopicEnsure { public boolean topicExists(TopicSpec spec, Integer timeOut) throws Exception { try { DescribeTopicsResult topicDescribeResult = adminClient.describeTopics( Collections.singletonList(spec.name()), new DescribeTopicsOptions().timeoutMs(timeOut) ); topicDescribeResult.all().get().get(spec.name()); } catch (E... | TopicEnsure { public boolean topicExists(TopicSpec spec, Integer timeOut) throws Exception { try { DescribeTopicsResult topicDescribeResult = adminClient.describeTopics( Collections.singletonList(spec.name()), new DescribeTopicsOptions().timeoutMs(timeOut) ); topicDescribeResult.all().get().get(spec.name()); } catch (E... | TopicEnsure { public boolean topicExists(TopicSpec spec, Integer timeOut) throws Exception { try { DescribeTopicsResult topicDescribeResult = adminClient.describeTopics( Collections.singletonList(spec.name()), new DescribeTopicsOptions().timeoutMs(timeOut) ); topicDescribeResult.all().get().get(spec.name()); } catch (E... | TopicEnsure { public boolean topicExists(TopicSpec spec, Integer timeOut) throws Exception { try { DescribeTopicsResult topicDescribeResult = adminClient.describeTopics( Collections.singletonList(spec.name()), new DescribeTopicsOptions().timeoutMs(timeOut) ); topicDescribeResult.all().get().get(spec.name()); } catch (E... |
@Test(expected = Exception.class) public void testValidateNonexistentTopic() throws Exception { assertFalse(topicEnsure.validateTopic(simpleTopicSpec("unknown-topic"), TIMEOUT_MS)); } | public boolean validateTopic(TopicSpec spec, int timeOut) throws Exception { DescribeTopicsResult topicDescribeResult = adminClient.describeTopics( Collections.singletonList(spec.name()), new DescribeTopicsOptions().timeoutMs(timeOut) ); TopicDescription topic = topicDescribeResult.all().get().get(spec.name()); ConfigR... | TopicEnsure { public boolean validateTopic(TopicSpec spec, int timeOut) throws Exception { DescribeTopicsResult topicDescribeResult = adminClient.describeTopics( Collections.singletonList(spec.name()), new DescribeTopicsOptions().timeoutMs(timeOut) ); TopicDescription topic = topicDescribeResult.all().get().get(spec.na... | TopicEnsure { public boolean validateTopic(TopicSpec spec, int timeOut) throws Exception { DescribeTopicsResult topicDescribeResult = adminClient.describeTopics( Collections.singletonList(spec.name()), new DescribeTopicsOptions().timeoutMs(timeOut) ); TopicDescription topic = topicDescribeResult.all().get().get(spec.na... | TopicEnsure { public boolean validateTopic(TopicSpec spec, int timeOut) throws Exception { DescribeTopicsResult topicDescribeResult = adminClient.describeTopics( Collections.singletonList(spec.name()), new DescribeTopicsOptions().timeoutMs(timeOut) ); TopicDescription topic = topicDescribeResult.all().get().get(spec.na... | TopicEnsure { public boolean validateTopic(TopicSpec spec, int timeOut) throws Exception { DescribeTopicsResult topicDescribeResult = adminClient.describeTopics( Collections.singletonList(spec.name()), new DescribeTopicsOptions().timeoutMs(timeOut) ); TopicDescription topic = topicDescribeResult.all().get().get(spec.na... |
@Test(timeout = 120000) public void zookeeperReady() throws Exception { assertThat( ClusterStatus.isZookeeperReady(this.kafka.getZookeeperConnectString(), 10000)) .isTrue(); } | public static boolean isZookeeperReady(String zkConnectString, int timeoutMs) { log.debug("Check if Zookeeper is ready: {} ", zkConnectString); ZooKeeper zookeeper = null; try { CountDownLatch waitForConnection = new CountDownLatch(1); boolean isSaslEnabled = false; if (System.getProperty(JAVA_SECURITY_AUTH_LOGIN_CONFI... | ClusterStatus { public static boolean isZookeeperReady(String zkConnectString, int timeoutMs) { log.debug("Check if Zookeeper is ready: {} ", zkConnectString); ZooKeeper zookeeper = null; try { CountDownLatch waitForConnection = new CountDownLatch(1); boolean isSaslEnabled = false; if (System.getProperty(JAVA_SECURITY_... | ClusterStatus { public static boolean isZookeeperReady(String zkConnectString, int timeoutMs) { log.debug("Check if Zookeeper is ready: {} ", zkConnectString); ZooKeeper zookeeper = null; try { CountDownLatch waitForConnection = new CountDownLatch(1); boolean isSaslEnabled = false; if (System.getProperty(JAVA_SECURITY_... | ClusterStatus { public static boolean isZookeeperReady(String zkConnectString, int timeoutMs) { log.debug("Check if Zookeeper is ready: {} ", zkConnectString); ZooKeeper zookeeper = null; try { CountDownLatch waitForConnection = new CountDownLatch(1); boolean isSaslEnabled = false; if (System.getProperty(JAVA_SECURITY_... | ClusterStatus { public static boolean isZookeeperReady(String zkConnectString, int timeoutMs) { log.debug("Check if Zookeeper is ready: {} ", zkConnectString); ZooKeeper zookeeper = null; try { CountDownLatch waitForConnection = new CountDownLatch(1); boolean isSaslEnabled = false; if (System.getProperty(JAVA_SECURITY_... |
@Test(timeout = 120000) public void zookeeperReadyWithBadConnectString() throws Exception { assertThat( ClusterStatus.isZookeeperReady("localhost:3245", 10000)) .isFalse(); } | public static boolean isZookeeperReady(String zkConnectString, int timeoutMs) { log.debug("Check if Zookeeper is ready: {} ", zkConnectString); ZooKeeper zookeeper = null; try { CountDownLatch waitForConnection = new CountDownLatch(1); boolean isSaslEnabled = false; if (System.getProperty(JAVA_SECURITY_AUTH_LOGIN_CONFI... | ClusterStatus { public static boolean isZookeeperReady(String zkConnectString, int timeoutMs) { log.debug("Check if Zookeeper is ready: {} ", zkConnectString); ZooKeeper zookeeper = null; try { CountDownLatch waitForConnection = new CountDownLatch(1); boolean isSaslEnabled = false; if (System.getProperty(JAVA_SECURITY_... | ClusterStatus { public static boolean isZookeeperReady(String zkConnectString, int timeoutMs) { log.debug("Check if Zookeeper is ready: {} ", zkConnectString); ZooKeeper zookeeper = null; try { CountDownLatch waitForConnection = new CountDownLatch(1); boolean isSaslEnabled = false; if (System.getProperty(JAVA_SECURITY_... | ClusterStatus { public static boolean isZookeeperReady(String zkConnectString, int timeoutMs) { log.debug("Check if Zookeeper is ready: {} ", zkConnectString); ZooKeeper zookeeper = null; try { CountDownLatch waitForConnection = new CountDownLatch(1); boolean isSaslEnabled = false; if (System.getProperty(JAVA_SECURITY_... | ClusterStatus { public static boolean isZookeeperReady(String zkConnectString, int timeoutMs) { log.debug("Check if Zookeeper is ready: {} ", zkConnectString); ZooKeeper zookeeper = null; try { CountDownLatch waitForConnection = new CountDownLatch(1); boolean isSaslEnabled = false; if (System.getProperty(JAVA_SECURITY_... |
@Test(timeout = 120000) public void isKafkaReady() throws Exception { Map<String, String> config = new HashMap<>(); config.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, kafka.getBootstrapBroker (SecurityProtocol.PLAINTEXT)); assertThat(ClusterStatus.isKafkaReady(config, 3, 10000)) .isTrue(); } | public static boolean isKafkaReady( Map<String, String> config, int minBrokerCount, int timeoutMs ) { log.debug("Check if Kafka is ready: {}", config); AdminClient adminClient = AdminClient.create(new HashMap<String, Object>(config)); long begin = System.currentTimeMillis(); long remainingWaitMs = timeoutMs; Collection... | ClusterStatus { public static boolean isKafkaReady( Map<String, String> config, int minBrokerCount, int timeoutMs ) { log.debug("Check if Kafka is ready: {}", config); AdminClient adminClient = AdminClient.create(new HashMap<String, Object>(config)); long begin = System.currentTimeMillis(); long remainingWaitMs = timeo... | ClusterStatus { public static boolean isKafkaReady( Map<String, String> config, int minBrokerCount, int timeoutMs ) { log.debug("Check if Kafka is ready: {}", config); AdminClient adminClient = AdminClient.create(new HashMap<String, Object>(config)); long begin = System.currentTimeMillis(); long remainingWaitMs = timeo... | ClusterStatus { public static boolean isKafkaReady( Map<String, String> config, int minBrokerCount, int timeoutMs ) { log.debug("Check if Kafka is ready: {}", config); AdminClient adminClient = AdminClient.create(new HashMap<String, Object>(config)); long begin = System.currentTimeMillis(); long remainingWaitMs = timeo... | ClusterStatus { public static boolean isKafkaReady( Map<String, String> config, int minBrokerCount, int timeoutMs ) { log.debug("Check if Kafka is ready: {}", config); AdminClient adminClient = AdminClient.create(new HashMap<String, Object>(config)); long begin = System.currentTimeMillis(); long remainingWaitMs = timeo... |
@Test(timeout = 120000) public void isKafkaReadyFailWithLessBrokers() throws Exception { try { Map<String, String> config = new HashMap<>(); config.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, kafka.getBootstrapBroker (SecurityProtocol.PLAINTEXT)); assertThat(ClusterStatus.isKafkaReady(config, 5, 10000)) .isFalse(... | public static boolean isKafkaReady( Map<String, String> config, int minBrokerCount, int timeoutMs ) { log.debug("Check if Kafka is ready: {}", config); AdminClient adminClient = AdminClient.create(new HashMap<String, Object>(config)); long begin = System.currentTimeMillis(); long remainingWaitMs = timeoutMs; Collection... | ClusterStatus { public static boolean isKafkaReady( Map<String, String> config, int minBrokerCount, int timeoutMs ) { log.debug("Check if Kafka is ready: {}", config); AdminClient adminClient = AdminClient.create(new HashMap<String, Object>(config)); long begin = System.currentTimeMillis(); long remainingWaitMs = timeo... | ClusterStatus { public static boolean isKafkaReady( Map<String, String> config, int minBrokerCount, int timeoutMs ) { log.debug("Check if Kafka is ready: {}", config); AdminClient adminClient = AdminClient.create(new HashMap<String, Object>(config)); long begin = System.currentTimeMillis(); long remainingWaitMs = timeo... | ClusterStatus { public static boolean isKafkaReady( Map<String, String> config, int minBrokerCount, int timeoutMs ) { log.debug("Check if Kafka is ready: {}", config); AdminClient adminClient = AdminClient.create(new HashMap<String, Object>(config)); long begin = System.currentTimeMillis(); long remainingWaitMs = timeo... | ClusterStatus { public static boolean isKafkaReady( Map<String, String> config, int minBrokerCount, int timeoutMs ) { log.debug("Check if Kafka is ready: {}", config); AdminClient adminClient = AdminClient.create(new HashMap<String, Object>(config)); long begin = System.currentTimeMillis(); long remainingWaitMs = timeo... |
@Test(timeout = 120000) public void isKafkaReadyWaitFailureWithNoBroker() throws Exception { try { Map<String, String> config = new HashMap<>(); config.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, "localhost:6789"); assertThat(ClusterStatus.isKafkaReady(config, 3, 10000)).isFalse(); } catch (Exception e) { fail("U... | public static boolean isKafkaReady( Map<String, String> config, int minBrokerCount, int timeoutMs ) { log.debug("Check if Kafka is ready: {}", config); AdminClient adminClient = AdminClient.create(new HashMap<String, Object>(config)); long begin = System.currentTimeMillis(); long remainingWaitMs = timeoutMs; Collection... | ClusterStatus { public static boolean isKafkaReady( Map<String, String> config, int minBrokerCount, int timeoutMs ) { log.debug("Check if Kafka is ready: {}", config); AdminClient adminClient = AdminClient.create(new HashMap<String, Object>(config)); long begin = System.currentTimeMillis(); long remainingWaitMs = timeo... | ClusterStatus { public static boolean isKafkaReady( Map<String, String> config, int minBrokerCount, int timeoutMs ) { log.debug("Check if Kafka is ready: {}", config); AdminClient adminClient = AdminClient.create(new HashMap<String, Object>(config)); long begin = System.currentTimeMillis(); long remainingWaitMs = timeo... | ClusterStatus { public static boolean isKafkaReady( Map<String, String> config, int minBrokerCount, int timeoutMs ) { log.debug("Check if Kafka is ready: {}", config); AdminClient adminClient = AdminClient.create(new HashMap<String, Object>(config)); long begin = System.currentTimeMillis(); long remainingWaitMs = timeo... | ClusterStatus { public static boolean isKafkaReady( Map<String, String> config, int minBrokerCount, int timeoutMs ) { log.debug("Check if Kafka is ready: {}", config); AdminClient adminClient = AdminClient.create(new HashMap<String, Object>(config)); long begin = System.currentTimeMillis(); long remainingWaitMs = timeo... |
@Test public void testTransactionalMode() { CacheConfiguration configuration = new CacheConfiguration(); assertEquals(CacheConfiguration.TransactionalMode.OFF, configuration.getTransactionalMode()); try { configuration.setTransactionalMode(null); fail("expected IllegalArgumentException"); } catch (IllegalArgumentExcept... | public final CacheConfiguration transactionalMode(String transactionalMode) { setTransactionalMode(transactionalMode); return this; } | CacheConfiguration implements Cloneable { public final CacheConfiguration transactionalMode(String transactionalMode) { setTransactionalMode(transactionalMode); return this; } } | CacheConfiguration implements Cloneable { public final CacheConfiguration transactionalMode(String transactionalMode) { setTransactionalMode(transactionalMode); return this; } CacheConfiguration(); CacheConfiguration(String name, int maxEntriesLocalHeap); } | CacheConfiguration implements Cloneable { public final CacheConfiguration transactionalMode(String transactionalMode) { setTransactionalMode(transactionalMode); return this; } CacheConfiguration(); CacheConfiguration(String name, int maxEntriesLocalHeap); @Override CacheConfiguration clone(); final void setName(String... | CacheConfiguration implements Cloneable { public final CacheConfiguration transactionalMode(String transactionalMode) { setTransactionalMode(transactionalMode); return this; } CacheConfiguration(); CacheConfiguration(String name, int maxEntriesLocalHeap); @Override CacheConfiguration clone(); final void setName(String... |
@Test public void testMaxMemoryOffHeap() { CacheConfiguration configuration = new CacheConfiguration(); configuration.setMaxMemoryOffHeap("100m"); assertEquals("100m", configuration.getMaxMemoryOffHeap()); configuration.setMaxBytesLocalOffHeap("1G"); assertEquals("1G", configuration.getMaxMemoryOffHeap()); } | @Deprecated public CacheConfiguration maxMemoryOffHeap(String maxMemoryOffHeap) { setMaxMemoryOffHeap(maxMemoryOffHeap); return this; } | CacheConfiguration implements Cloneable { @Deprecated public CacheConfiguration maxMemoryOffHeap(String maxMemoryOffHeap) { setMaxMemoryOffHeap(maxMemoryOffHeap); return this; } } | CacheConfiguration implements Cloneable { @Deprecated public CacheConfiguration maxMemoryOffHeap(String maxMemoryOffHeap) { setMaxMemoryOffHeap(maxMemoryOffHeap); return this; } CacheConfiguration(); CacheConfiguration(String name, int maxEntriesLocalHeap); } | CacheConfiguration implements Cloneable { @Deprecated public CacheConfiguration maxMemoryOffHeap(String maxMemoryOffHeap) { setMaxMemoryOffHeap(maxMemoryOffHeap); return this; } CacheConfiguration(); CacheConfiguration(String name, int maxEntriesLocalHeap); @Override CacheConfiguration clone(); final void setName(Stri... | CacheConfiguration implements Cloneable { @Deprecated public CacheConfiguration maxMemoryOffHeap(String maxMemoryOffHeap) { setMaxMemoryOffHeap(maxMemoryOffHeap); return this; } CacheConfiguration(); CacheConfiguration(String name, int maxEntriesLocalHeap); @Override CacheConfiguration clone(); final void setName(Stri... |
@Test public void testSynchronousWritesPersistenceConfiguration() { CacheConfiguration configuration = new CacheConfiguration("Test", 10).persistence(new PersistenceConfiguration() .strategy(Strategy.LOCALTEMPSWAP).synchronousWrites(true)); try { cacheManager.addCache(new Cache(configuration)); fail("Expected InvalidCo... | public CacheConfiguration persistence(PersistenceConfiguration persistenceConfiguration) { addPersistence(persistenceConfiguration); return this; } | CacheConfiguration implements Cloneable { public CacheConfiguration persistence(PersistenceConfiguration persistenceConfiguration) { addPersistence(persistenceConfiguration); return this; } } | CacheConfiguration implements Cloneable { public CacheConfiguration persistence(PersistenceConfiguration persistenceConfiguration) { addPersistence(persistenceConfiguration); return this; } CacheConfiguration(); CacheConfiguration(String name, int maxEntriesLocalHeap); } | CacheConfiguration implements Cloneable { public CacheConfiguration persistence(PersistenceConfiguration persistenceConfiguration) { addPersistence(persistenceConfiguration); return this; } CacheConfiguration(); CacheConfiguration(String name, int maxEntriesLocalHeap); @Override CacheConfiguration clone(); final void ... | CacheConfiguration implements Cloneable { public CacheConfiguration persistence(PersistenceConfiguration persistenceConfiguration) { addPersistence(persistenceConfiguration); return this; } CacheConfiguration(); CacheConfiguration(String name, int maxEntriesLocalHeap); @Override CacheConfiguration clone(); final void ... |
@Test public void testOnlyPopulatesOnce() throws InterruptedException, BrokenBarrierException { final int threadCount = Runtime.getRuntime().availableProcessors() * 2; final CachingTier<String, String> cache = new OnHeapCachingTier<String, String>(new CountBasedBackEnd<String, Object>(threadCount * 2)); final AtomicBoo... | @Override public V get(final K key, final Callable<V> source, final boolean updateStats) { if (updateStats) { getObserver.begin(); } Object cachedValue = backEnd.get(key); if (cachedValue == null) { if (updateStats) { getObserver.end(GetOutcome.MISS); } Fault<V> f = new Fault<V>(source); cachedValue = backEnd.putIfAbse... | OnHeapCachingTier implements CachingTier<K, V> { @Override public V get(final K key, final Callable<V> source, final boolean updateStats) { if (updateStats) { getObserver.begin(); } Object cachedValue = backEnd.get(key); if (cachedValue == null) { if (updateStats) { getObserver.end(GetOutcome.MISS); } Fault<V> f = new ... | OnHeapCachingTier implements CachingTier<K, V> { @Override public V get(final K key, final Callable<V> source, final boolean updateStats) { if (updateStats) { getObserver.begin(); } Object cachedValue = backEnd.get(key); if (cachedValue == null) { if (updateStats) { getObserver.end(GetOutcome.MISS); } Fault<V> f = new ... | OnHeapCachingTier implements CachingTier<K, V> { @Override public V get(final K key, final Callable<V> source, final boolean updateStats) { if (updateStats) { getObserver.begin(); } Object cachedValue = backEnd.get(key); if (cachedValue == null) { if (updateStats) { getObserver.end(GetOutcome.MISS); } Fault<V> f = new ... | OnHeapCachingTier implements CachingTier<K, V> { @Override public V get(final K key, final Callable<V> source, final boolean updateStats) { if (updateStats) { getObserver.begin(); } Object cachedValue = backEnd.get(key); if (cachedValue == null) { if (updateStats) { getObserver.end(GetOutcome.MISS); } Fault<V> f = new ... |
@Test public void testEvictsWhenAtCapacityMultiThreaded() throws InterruptedException { final int limit = 1000; final int threadNumber = Runtime.getRuntime().availableProcessors() * 2; final CountBasedBackEnd<String, Element> countBasedBackEnd = new CountBasedBackEnd<String, Element>(limit); final AtomicInteger counter... | @Override public V putIfAbsent(final K key, final V value) { final V v = super.putIfAbsent(key, value); if (v == null) { try { evictIfRequired(key, value); } catch (Throwable e) { LOG.warn("Caught throwable while evicting", e); } } return v; } | CountBasedBackEnd extends ConcurrentHashMap<K, V> implements HeapCacheBackEnd<K, V> { @Override public V putIfAbsent(final K key, final V value) { final V v = super.putIfAbsent(key, value); if (v == null) { try { evictIfRequired(key, value); } catch (Throwable e) { LOG.warn("Caught throwable while evicting", e); } } re... | CountBasedBackEnd extends ConcurrentHashMap<K, V> implements HeapCacheBackEnd<K, V> { @Override public V putIfAbsent(final K key, final V value) { final V v = super.putIfAbsent(key, value); if (v == null) { try { evictIfRequired(key, value); } catch (Throwable e) { LOG.warn("Caught throwable while evicting", e); } } re... | CountBasedBackEnd extends ConcurrentHashMap<K, V> implements HeapCacheBackEnd<K, V> { @Override public V putIfAbsent(final K key, final V value) { final V v = super.putIfAbsent(key, value); if (v == null) { try { evictIfRequired(key, value); } catch (Throwable e) { LOG.warn("Caught throwable while evicting", e); } } re... | CountBasedBackEnd extends ConcurrentHashMap<K, V> implements HeapCacheBackEnd<K, V> { @Override public V putIfAbsent(final K key, final V value) { final V v = super.putIfAbsent(key, value); if (v == null) { try { evictIfRequired(key, value); } catch (Throwable e) { LOG.warn("Caught throwable while evicting", e); } } re... |
@Test public void testCantSwitchPool() throws Exception { Configuration configuration = new Configuration(); CacheManager cacheManager = new CacheManager(configuration.maxBytesLocalHeap(10, MemoryUnit.MEGABYTES).name("new-cacheManager")); CacheConfiguration cacheConfiguration = new CacheConfiguration("one", 0); cacheMa... | public CacheConfiguration getCacheConfiguration() { return configuration; } | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } } | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... |
@Test(expected = InvalidConfigurationException.class) public void testLocalHeapCantSwitchToCountBased() { manager.addCache(new Cache(new CacheConfiguration().name("sizeBased").maxBytesLocalHeap(10, MemoryUnit.MEGABYTES))); Cache sizeBased = manager.getCache("sizeBased"); sizeBased.getCacheConfiguration().setMaxEntriesL... | public CacheConfiguration getCacheConfiguration() { return configuration; } | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } } | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... |
@Test(expected = InvalidConfigurationException.class) public void testLocalHeapCantSwitchToSizeBased() { manager.addCache(new Cache(new CacheConfiguration().name("countBased").maxEntriesLocalHeap(10))); Cache sizeBased = manager.getCache("countBased"); sizeBased.getCacheConfiguration().maxBytesLocalHeap(10, MemoryUnit.... | public CacheConfiguration getCacheConfiguration() { return configuration; } | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } } | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... |
@Test(expected = InvalidConfigurationException.class) public void testLocalDiskCantSwitchToCountBased() { manager.addCache(new Cache(new CacheConfiguration().name("sizeBased").maxBytesLocalDisk(10, MemoryUnit.MEGABYTES))); Cache sizeBased = manager.getCache("sizeBased"); sizeBased.getCacheConfiguration().setMaxEntriesL... | public CacheConfiguration getCacheConfiguration() { return configuration; } | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } } | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... |
@Test(expected = InvalidConfigurationException.class) public void testLocalDiskCantSwitchToSizeBased() { manager.addCache(new Cache(new CacheConfiguration().name("countBased").maxEntriesLocalDisk(10))); Cache sizeBased = manager.getCache("countBased"); sizeBased.getCacheConfiguration().maxBytesLocalDisk(10, MemoryUnit.... | public CacheConfiguration getCacheConfiguration() { return configuration; } | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } } | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... |
@Test public void testAdjustsPoolSizeDynamically() throws Exception { Configuration configuration = new Configuration(); CacheManager cacheManager = new CacheManager(configuration.maxBytesLocalHeap(10, MemoryUnit.MEGABYTES).name("new-cacheManager")); CacheConfiguration cacheConfiguration = new CacheConfiguration("three... | public CacheConfiguration getCacheConfiguration() { return configuration; } | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } } | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... |
@Test public void testMultipleDispose() { Ehcache cache = new Cache("testCache", 1, true, false, 5, 2); manager.addCache(cache); cache.dispose(); for (int i = 0; i < 10; i++) { cache.dispose(); } } | public synchronized void dispose() throws IllegalStateException { if (checkStatusAlreadyDisposed()) { return; } if (bootstrapCacheLoader != null && bootstrapCacheLoader instanceof Disposable) { ((Disposable)bootstrapCacheLoader).dispose(); } if (executorService != null) { executorService.shutdown(); } disposeRegistered... | Cache implements InternalEhcache, StoreListener { public synchronized void dispose() throws IllegalStateException { if (checkStatusAlreadyDisposed()) { return; } if (bootstrapCacheLoader != null && bootstrapCacheLoader instanceof Disposable) { ((Disposable)bootstrapCacheLoader).dispose(); } if (executorService != null)... | Cache implements InternalEhcache, StoreListener { public synchronized void dispose() throws IllegalStateException { if (checkStatusAlreadyDisposed()) { return; } if (bootstrapCacheLoader != null && bootstrapCacheLoader instanceof Disposable) { ((Disposable)bootstrapCacheLoader).dispose(); } if (executorService != null)... | Cache implements InternalEhcache, StoreListener { public synchronized void dispose() throws IllegalStateException { if (checkStatusAlreadyDisposed()) { return; } if (bootstrapCacheLoader != null && bootstrapCacheLoader instanceof Disposable) { ((Disposable)bootstrapCacheLoader).dispose(); } if (executorService != null)... | Cache implements InternalEhcache, StoreListener { public synchronized void dispose() throws IllegalStateException { if (checkStatusAlreadyDisposed()) { return; } if (bootstrapCacheLoader != null && bootstrapCacheLoader instanceof Disposable) { ((Disposable)bootstrapCacheLoader).dispose(); } if (executorService != null)... |
@Test public void testSetCacheName() throws CacheException { Ehcache cache = new Cache("testCache", 1, true, false, 5, 2); try { cache.setName(null); fail(); } catch (IllegalArgumentException e) { } cache.setName("name/with/slash"); manager.addCache(cache); try { cache.setName("trying_to_change_name_after_initialised")... | public final void setName(String name) throws IllegalArgumentException { if (!cacheStatus.isUninitialized()) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } | Cache implements InternalEhcache, StoreListener { public final void setName(String name) throws IllegalArgumentException { if (!cacheStatus.isUninitialized()) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } } | Cache implements InternalEhcache, StoreListener { public final void setName(String name) throws IllegalArgumentException { if (!cacheStatus.isUninitialized()) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(CacheConfiguration cacheConfigur... | Cache implements InternalEhcache, StoreListener { public final void setName(String name) throws IllegalArgumentException { if (!cacheStatus.isUninitialized()) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(CacheConfiguration cacheConfigur... | Cache implements InternalEhcache, StoreListener { public final void setName(String name) throws IllegalArgumentException { if (!cacheStatus.isUninitialized()) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(CacheConfiguration cacheConfigur... |
@Test public void testAutoOverflowsToDisk() { manager.addCache(new Cache(new CacheConfiguration("overflow1", 10).maxBytesLocalDisk(10, MemoryUnit.MEGABYTES))); assertThat(manager.getCache("overflow1").getCacheConfiguration().isOverflowToDisk(), is(true)); CacheManager cacheManager = new CacheManager(new Configuration()... | public CacheConfiguration getCacheConfiguration() { return configuration; } | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } } | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... |
@Test public void testInitialiseFailures() { final String name = "testInitialiseFailures2"; Cache cache = new Cache(name, 1, false, false, 5, 1); manager.addCache(cache); try { cache.initialise(); fail("Calling cache.initialise() multiple times should fail with IllegalStateException"); } catch (IllegalStateException e)... | public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } Pool onHeapPool; if (configuration.getMaxBytesLocalHeap() > 0) { PoolEvictor evictor = new... | Cache implements InternalEhcache, StoreListener { public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } Pool onHeapPool; if (configuration.getMa... | Cache implements InternalEhcache, StoreListener { public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } Pool onHeapPool; if (configuration.getMa... | Cache implements InternalEhcache, StoreListener { public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } Pool onHeapPool; if (configuration.getMa... | Cache implements InternalEhcache, StoreListener { public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } Pool onHeapPool; if (configuration.getMa... |
@Test public void testGetDiskStoreSize() throws Exception { Cache cache = new Cache("testGetDiskStoreSize", 1, true, false, 100, 200); manager.addCache(cache); assertEquals(0, cache.getStatistics().getLocalDiskSize()); cache.put(new Element("key1", "value1")); RetryAssert.assertBy(1, TimeUnit.SECONDS, new GetCacheDiskS... | @Deprecated public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return (int) getStatistics().getRemoteSize(); } else { return (int) getStatistics().getLocalDiskSize(); } } | Cache implements InternalEhcache, StoreListener { @Deprecated public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return (int) getStatistics().getRemoteSize(); } else { return (int) getStatistics().getLocalDiskSize(); } } } | Cache implements InternalEhcache, StoreListener { @Deprecated public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return (int) getStatistics().getRemoteSize(); } else { return (int) getStatistics().getLocalDiskSize(); } } Cache(CacheConfiguration cacheConfigu... | Cache implements InternalEhcache, StoreListener { @Deprecated public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return (int) getStatistics().getRemoteSize(); } else { return (int) getStatistics().getLocalDiskSize(); } } Cache(CacheConfiguration cacheConfigu... | Cache implements InternalEhcache, StoreListener { @Deprecated public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return (int) getStatistics().getRemoteSize(); } else { return (int) getStatistics().getLocalDiskSize(); } } Cache(CacheConfiguration cacheConfigu... |
@Test public void testCloneFailures() throws Exception { Cache cache = new Cache("testGetMemoryStore", 10, false, false, 100, 200); manager.addCache(cache); try { cache.clone(); fail("Should have thrown CloneNotSupportedException"); } catch (CloneNotSupportedException e) { } } | @Override public final Cache clone() throws CloneNotSupportedException { return new Cache(this); } | Cache implements InternalEhcache, StoreListener { @Override public final Cache clone() throws CloneNotSupportedException { return new Cache(this); } } | Cache implements InternalEhcache, StoreListener { @Override public final Cache clone() throws CloneNotSupportedException { return new Cache(this); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
... | Cache implements InternalEhcache, StoreListener { @Override public final Cache clone() throws CloneNotSupportedException { return new Cache(this); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
... | Cache implements InternalEhcache, StoreListener { @Override public final Cache clone() throws CloneNotSupportedException { return new Cache(this); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
... |
@Test public void testToString() { Ehcache cache = new Cache("testGetMemoryStore", 10, false, false, 100, 200); assertTrue(cache.toString().indexOf("testGetMemoryStore") > -1); } | @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(cacheStatus.getStatus()) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk = ").append(configuration.isOverflow... | Cache implements InternalEhcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(cacheStatus.getStatus()) .append(" eternal = ").append(configuration.isEternal()) .append(" o... | Cache implements InternalEhcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(cacheStatus.getStatus()) .append(" eternal = ").append(configuration.isEternal()) .append(" o... | Cache implements InternalEhcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(cacheStatus.getStatus()) .append(" eternal = ").append(configuration.isEternal()) .append(" o... | Cache implements InternalEhcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(cacheStatus.getStatus()) .append(" eternal = ").append(configuration.isEternal()) .append(" o... |
@Test public void testEquals() throws CacheException, InterruptedException, ExecutionException, NoSuchFieldException, IllegalAccessException { Cache cache = new Cache("cache", 1, true, false, 100, 200, false, 1); manager.addCache(cache); Element element1 = new Element("1", new Date()); Element element2 = new Element("2... | @Override public boolean equals(Object object) { if (object == null) { return false; } if (!(object instanceof Ehcache)) { return false; } Ehcache other = (Ehcache) object; return guid.equals(other.getGuid()); } | Cache implements InternalEhcache, StoreListener { @Override public boolean equals(Object object) { if (object == null) { return false; } if (!(object instanceof Ehcache)) { return false; } Ehcache other = (Ehcache) object; return guid.equals(other.getGuid()); } } | Cache implements InternalEhcache, StoreListener { @Override public boolean equals(Object object) { if (object == null) { return false; } if (!(object instanceof Ehcache)) { return false; } Ehcache other = (Ehcache) object; return guid.equals(other.getGuid()); } Cache(CacheConfiguration cacheConfiguration); Cache(Cache... | Cache implements InternalEhcache, StoreListener { @Override public boolean equals(Object object) { if (object == null) { return false; } if (!(object instanceof Ehcache)) { return false; } Ehcache other = (Ehcache) object; return guid.equals(other.getGuid()); } Cache(CacheConfiguration cacheConfiguration); Cache(Cache... | Cache implements InternalEhcache, StoreListener { @Override public boolean equals(Object object) { if (object == null) { return false; } if (!(object instanceof Ehcache)) { return false; } Ehcache other = (Ehcache) object; return guid.equals(other.getGuid()); } Cache(CacheConfiguration cacheConfiguration); Cache(Cache... |
@Test public void testIsKeyInCache() throws CacheException, InterruptedException { Cache cache = new Cache("cache", 1, true, false, 100, 200, false, 1); manager.addCache(cache); Element element1 = new Element("1", new Date()); Element element2 = new Element("2", new Date()); cache.put(element1); cache.put(element2); as... | public boolean isKeyInCache(Object key) { if (key == null) { return false; } return compoundStore.containsKey(key); } | Cache implements InternalEhcache, StoreListener { public boolean isKeyInCache(Object key) { if (key == null) { return false; } return compoundStore.containsKey(key); } } | Cache implements InternalEhcache, StoreListener { public boolean isKeyInCache(Object key) { if (key == null) { return false; } return compoundStore.containsKey(key); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventLis... | Cache implements InternalEhcache, StoreListener { public boolean isKeyInCache(Object key) { if (key == null) { return false; } return compoundStore.containsKey(key); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventLis... | Cache implements InternalEhcache, StoreListener { public boolean isKeyInCache(Object key) { if (key == null) { return false; } return compoundStore.containsKey(key); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventLis... |
@Test public void testGetQuietFromFinalize() throws InterruptedException { final Cache cache = new Cache("test", 1, true, false, 5, 2); manager.addCache(cache); cache.put(new Element("key", "value")); cache.put(new Element("key2", "value")); cache.put(new Element("key3", "value")); cache.put(new Element("key4", "value"... | public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } | Cache implements InternalEhcache, StoreListener { public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } } | Cache implements InternalEhcache, StoreListener { public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners r... | Cache implements InternalEhcache, StoreListener { public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners r... | Cache implements InternalEhcache, StoreListener { public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners r... |
@Test public void testGetWithLoader() { class TestCacheLoader implements CacheLoader { public Object load(Object key, Object argument) throws CacheException { LOG.info("load1 " + key); return key; } public Map loadAll(Collection keys, Object argument) throws CacheException { return null; } public String getName() { ret... | public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { Element element = get(key); if (element != null) { return element; } if (registeredCacheLoaders.size() == 0 && loader == null) { return null; } try { element = getQuiet(key); if (element != null) { return element... | Cache implements InternalEhcache, StoreListener { public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { Element element = get(key); if (element != null) { return element; } if (registeredCacheLoaders.size() == 0 && loader == null) { return null; } try { element = ge... | Cache implements InternalEhcache, StoreListener { public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { Element element = get(key); if (element != null) { return element; } if (registeredCacheLoaders.size() == 0 && loader == null) { return null; } try { element = ge... | Cache implements InternalEhcache, StoreListener { public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { Element element = get(key); if (element != null) { return element; } if (registeredCacheLoaders.size() == 0 && loader == null) { return null; } try { element = ge... | Cache implements InternalEhcache, StoreListener { public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { Element element = get(key); if (element != null) { return element; } if (registeredCacheLoaders.size() == 0 && loader == null) { return null; } try { element = ge... |
@Test public void testAsynchronousLoad() throws InterruptedException, ExecutionException { CountingCacheLoader countingCacheLoader = new CountingCacheLoader(); Cache cache = manager.getCache("sampleCache1"); cache.registerCacheLoader(countingCacheLoader); ExecutorService executorService = cache.getExecutorService(); Fu... | Future<AtomicReference<Object>> asynchronousLoad(final Object key, final CacheLoader specificLoader, final Object argument) { final AtomicReference<Object> result = new AtomicReference<Object>(); return getExecutorService().submit(new Runnable() { public void run() throws CacheException { try { boolean existsOnRun = is... | Cache implements InternalEhcache, StoreListener { Future<AtomicReference<Object>> asynchronousLoad(final Object key, final CacheLoader specificLoader, final Object argument) { final AtomicReference<Object> result = new AtomicReference<Object>(); return getExecutorService().submit(new Runnable() { public void run() thro... | Cache implements InternalEhcache, StoreListener { Future<AtomicReference<Object>> asynchronousLoad(final Object key, final CacheLoader specificLoader, final Object argument) { final AtomicReference<Object> result = new AtomicReference<Object>(); return getExecutorService().submit(new Runnable() { public void run() thro... | Cache implements InternalEhcache, StoreListener { Future<AtomicReference<Object>> asynchronousLoad(final Object key, final CacheLoader specificLoader, final Object argument) { final AtomicReference<Object> result = new AtomicReference<Object>(); return getExecutorService().submit(new Runnable() { public void run() thro... | Cache implements InternalEhcache, StoreListener { Future<AtomicReference<Object>> asynchronousLoad(final Object key, final CacheLoader specificLoader, final Object argument) { final AtomicReference<Object> result = new AtomicReference<Object>(); return getExecutorService().submit(new Runnable() { public void run() thro... |
@Test public void testAsynchronousLoadAll() throws InterruptedException, ExecutionException { CountingCacheLoader countingCacheLoader = new CountingCacheLoader(); Cache cache = manager.getCache("sampleCache1"); cache.registerCacheLoader(countingCacheLoader); ExecutorService executorService = cache.getExecutorService();... | Future asynchronousLoadAll(final Collection keys, final Object argument) { return getExecutorService().submit(new Runnable() { public void run() { try { Set<Object> nonLoadedKeys = new HashSet<Object>(); for (Object key : keys) { if (!isKeyInCache(key)) { nonLoadedKeys.add(key); } } Map<?, ?> map = loadWithRegisteredLo... | Cache implements InternalEhcache, StoreListener { Future asynchronousLoadAll(final Collection keys, final Object argument) { return getExecutorService().submit(new Runnable() { public void run() { try { Set<Object> nonLoadedKeys = new HashSet<Object>(); for (Object key : keys) { if (!isKeyInCache(key)) { nonLoadedKeys.... | Cache implements InternalEhcache, StoreListener { Future asynchronousLoadAll(final Collection keys, final Object argument) { return getExecutorService().submit(new Runnable() { public void run() { try { Set<Object> nonLoadedKeys = new HashSet<Object>(); for (Object key : keys) { if (!isKeyInCache(key)) { nonLoadedKeys.... | Cache implements InternalEhcache, StoreListener { Future asynchronousLoadAll(final Collection keys, final Object argument) { return getExecutorService().submit(new Runnable() { public void run() { try { Set<Object> nonLoadedKeys = new HashSet<Object>(); for (Object key : keys) { if (!isKeyInCache(key)) { nonLoadedKeys.... | Cache implements InternalEhcache, StoreListener { Future asynchronousLoadAll(final Collection keys, final Object argument) { return getExecutorService().submit(new Runnable() { public void run() { try { Set<Object> nonLoadedKeys = new HashSet<Object>(); for (Object key : keys) { if (!isKeyInCache(key)) { nonLoadedKeys.... |
@Test public void testProgrammaticConfigurationWorksProperlyWhenNoDefaultCacheConfigured() { Configuration mgrConfig = new Configuration(); mgrConfig.setUpdateCheck(false); new CacheManager(mgrConfig).shutdown(); } | public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedException ie) { Thr... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce... |
@Test public void testForCacheManagerThreadLeak() throws CacheException, InterruptedException { final Set<Thread> initialThreads = Collections.unmodifiableSet(Thread.getAllStackTraces().keySet()); Configuration config = new Configuration(); config.diskStore(new DiskStoreConfiguration().path("${java.io.tmpdir}/CacheMana... | public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedException ie) { Thr... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce... |
@Test public void testGetCache() throws CacheException { CacheManager manager = new CacheManager(new Configuration().cache(new CacheConfiguration("foo", 100))); try { assertNotNull(manager.getCache("foo")); } finally { manager.shutdown(); } } | public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); Ehcache ehcache = ehcaches.get(name); return ehcache instanceof Cache ? (Cache) ehcache : null; } | CacheManager { public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); Ehcache ehcache = ehcaches.get(name); return ehcache instanceof Cache ? (Cache) ehcache : null; } } | CacheManager { public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); Ehcache ehcache = ehcaches.get(name); return ehcache instanceof Cache ? (Cache) ehcache : null; } CacheManager(Configuration configuration); CacheManager(String configurationFileName); CacheManager(URL ... | CacheManager { public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); Ehcache ehcache = ehcaches.get(name); return ehcache instanceof Cache ? (Cache) ehcache : null; } CacheManager(Configuration configuration); CacheManager(String configurationFileName); CacheManager(URL ... | CacheManager { public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); Ehcache ehcache = ehcaches.get(name); return ehcache instanceof Cache ? (Cache) ehcache : null; } CacheManager(Configuration configuration); CacheManager(String configurationFileName); CacheManager(URL ... |
@Test public void testMultipleCacheManagers() { CacheManager managerOne = new CacheManager(makeCacheManagerConfig("cm1")); try { new CacheManager(makeCacheManagerConfig("cm2")).shutdown(); } finally { managerOne.shutdown(); } } | public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedException ie) { Thr... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce... |
@Test public void testIsSerializable() { Element element = new Element(null, null); assertTrue(element.isSerializable()); Element elementWithNullValue = new Element("1", null); assertTrue(elementWithNullValue.isSerializable()); Element elementWithNullKey = new Element(null, "1"); assertTrue(elementWithNullValue.isSeria... | public final boolean isSerializable() { return isKeySerializable() && (value instanceof Serializable || value == null); } | Element implements Serializable, Cloneable { public final boolean isSerializable() { return isKeySerializable() && (value instanceof Serializable || value == null); } } | Element implements Serializable, Cloneable { public final boolean isSerializable() { return isKeySerializable() && (value instanceof Serializable || value == null); } Element(final Serializable key, final Serializable value, final long version); Element(final Object key, final Object value, final long version); @Depre... | Element implements Serializable, Cloneable { public final boolean isSerializable() { return isKeySerializable() && (value instanceof Serializable || value == null); } Element(final Serializable key, final Serializable value, final long version); Element(final Object key, final Object value, final long version); @Depre... | Element implements Serializable, Cloneable { public final boolean isSerializable() { return isKeySerializable() && (value instanceof Serializable || value == null); } Element(final Serializable key, final Serializable value, final long version); Element(final Object key, final Object value, final long version); @Depre... |
@Test public void testEquals() { Element element = new Element("key", "value"); assertFalse(element.equals("dog")); assertTrue(element.equals(element)); assertFalse(element.equals(null)); assertFalse(element.equals(new Element("cat", "hat"))); } | @Override public final boolean equals(final Object object) { if (object == null || !(object instanceof Element)) { return false; } Element element = (Element) object; if (key == null || element.getObjectKey() == null) { return false; } return key.equals(element.getObjectKey()); } | Element implements Serializable, Cloneable { @Override public final boolean equals(final Object object) { if (object == null || !(object instanceof Element)) { return false; } Element element = (Element) object; if (key == null || element.getObjectKey() == null) { return false; } return key.equals(element.getObjectKey(... | Element implements Serializable, Cloneable { @Override public final boolean equals(final Object object) { if (object == null || !(object instanceof Element)) { return false; } Element element = (Element) object; if (key == null || element.getObjectKey() == null) { return false; } return key.equals(element.getObjectKey(... | Element implements Serializable, Cloneable { @Override public final boolean equals(final Object object) { if (object == null || !(object instanceof Element)) { return false; } Element element = (Element) object; if (key == null || element.getObjectKey() == null) { return false; } return key.equals(element.getObjectKey(... | Element implements Serializable, Cloneable { @Override public final boolean equals(final Object object) { if (object == null || !(object instanceof Element)) { return false; } Element element = (Element) object; if (key == null || element.getObjectKey() == null) { return false; } return key.equals(element.getObjectKey(... |
@Test public void testErrorNotBubleUp() { System.setProperty("net.sf.ehcache.skipUpdateCheck", "false"); System.setProperty("ehcache.update-check.url", "this is a bad url"); UpdateChecker uc = new UpdateChecker(); uc.checkForUpdate(); } | public void checkForUpdate() { try { if (!Boolean.getBoolean("net.sf.ehcache.skipUpdateCheck")) { doCheck(); } } catch (Throwable t) { LOG.log(Level.WARNING, "Update check failed: " + t.toString()); } } | UpdateChecker extends TimerTask { public void checkForUpdate() { try { if (!Boolean.getBoolean("net.sf.ehcache.skipUpdateCheck")) { doCheck(); } } catch (Throwable t) { LOG.log(Level.WARNING, "Update check failed: " + t.toString()); } } } | UpdateChecker extends TimerTask { public void checkForUpdate() { try { if (!Boolean.getBoolean("net.sf.ehcache.skipUpdateCheck")) { doCheck(); } } catch (Throwable t) { LOG.log(Level.WARNING, "Update check failed: " + t.toString()); } } } | UpdateChecker extends TimerTask { public void checkForUpdate() { try { if (!Boolean.getBoolean("net.sf.ehcache.skipUpdateCheck")) { doCheck(); } } catch (Throwable t) { LOG.log(Level.WARNING, "Update check failed: " + t.toString()); } } @Override void run(); void checkForUpdate(); } | UpdateChecker extends TimerTask { public void checkForUpdate() { try { if (!Boolean.getBoolean("net.sf.ehcache.skipUpdateCheck")) { doCheck(); } } catch (Throwable t) { LOG.log(Level.WARNING, "Update check failed: " + t.toString()); } } @Override void run(); void checkForUpdate(); } |
@Test public void testThrashBlockingCache() throws Exception { Ehcache cache = manager.getCache("sampleCache1"); blockingCache = new BlockingCache(cache); long duration = thrashCache(blockingCache, 50, 500L, 1000L); LOG.log(Level.FINE, "Thrash Duration:" + duration); } | protected Ehcache getCache() { return cache; } | BlockingCache implements Ehcache { protected Ehcache getCache() { return cache; } } | BlockingCache implements Ehcache { protected Ehcache getCache() { return cache; } BlockingCache(final Ehcache cache, int numberOfStripes); BlockingCache(final Ehcache cache); } | BlockingCache implements Ehcache { protected Ehcache getCache() { return cache; } BlockingCache(final Ehcache cache, int numberOfStripes); BlockingCache(final Ehcache cache); String getName(); void setName(String name); boolean isExpired(Element element); @Override Object clone(); RegisteredEventListeners getCacheEven... | BlockingCache implements Ehcache { protected Ehcache getCache() { return cache; } BlockingCache(final Ehcache cache, int numberOfStripes); BlockingCache(final Ehcache cache); String getName(); void setName(String name); boolean isExpired(Element element); @Override Object clone(); RegisteredEventListeners getCacheEven... |
@Test public void testLoadConfigurationFromClasspath() throws Exception { Configuration configuration = ConfigurationFactory.parseConfiguration(); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals(null, configurationHelper.getConfigurationBean().getName()); assertEq... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testLoadConfigurationFromFile() throws Exception { File file = new File(SRC_CONFIG_DIR + "ehcache.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals(null, configurat... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testLoadConfigurationFromEhcache11File() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcache-1_1.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals(nu... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testLoadConfigurationFromFileNoCacheManagerListenerDefault() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcache-nolisteners.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, con... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testLoadConfigurationFromFileNoDefault() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcache-nodefault.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEqu... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testLoadConfigurationFromFileNoDisk() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcache-nodisk.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals(nu... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testLoadConfigurationFromInputStream() throws Exception { InputStream fis = new FileInputStream(new File(SRC_CONFIG_DIR + "ehcache.xml").getAbsolutePath()); ConfigurationHelper configurationHelper; try { Configuration configuration = ConfigurationFactory.parseConfiguration(fis); configurationHelper = ... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testLoadConfigurationFromFailsafe() throws Exception { try { File file = new File(AbstractCacheTest.TEST_CLASSES_DIR + "ehcache.xml"); file.renameTo(new File(AbstractCacheTest.TEST_CLASSES_DIR + "hideehcache.xml")); Configuration configuration = ConfigurationFactory.parseConfiguration(); Configuration... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testTerracottaConfiguration() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals("tc", config... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testTerracottaEmbeddedConfig() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-tc-embedded.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals("tc", conf... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testTerracottaEmbeddedXsdConfig() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-tc-embedded-xsd.xml"); Configuration configuration = ConfigurationFactory .parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper( manager, configuration); assertEquals("... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testTerracottaInvalidConfig1() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta-invalid1.xml"); try { Configuration configuration = ConfigurationFactory.parseConfiguration(file); fail("expecting exception to be thrown"); } catch (CacheException e) { assertTrue(e.getMessage().con... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testTerracottaInvalidConfig2() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta-invalid2.xml"); try { Configuration configuration = ConfigurationFactory.parseConfiguration(file); fail("expecting exception to be thrown"); } catch (CacheException e) { assertTrue(e.getMessage().con... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testTerracottaInvalidConfig3() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta-invalid3.xml"); try { Configuration configuration = ConfigurationFactory.parseConfiguration(file); fail("expecting exception to be thrown"); } catch (CacheException e) { assertTrue(e.getMessage().con... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testTerracottaInvalidConfig4() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta-invalid4.xml"); try { Configuration configuration = ConfigurationFactory.parseConfiguration(file); fail("expecting exception to be thrown"); } catch (CacheException e) { assertTrue(e.getMessage().con... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testTerracottaInvalidConfig5() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta-invalid5.xml"); try { Configuration configuration = ConfigurationFactory.parseConfiguration(file); fail("expecting exception to be thrown"); } catch (CacheException e) { assertTrue(e.getMessage().con... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.