/** * Sets the message based on the page contents. */ protected void setPageMessage() { if (thresholdBox.getText().isEmpty()) { setMessage("Threshold must not be empty!", ERROR); return; } if (timerangeSpinner.getText().isEmpty()) { setMessage("Check interval must not be empty!", ERROR); return; } Pair<Integer, String> emailsErrorMessage = checkEmailText(); if (null != emailsErrorMessage) { setMessage("The email address '" + emailsErrorMessage.getSecond() + "' in line " + emailsErrorMessage.getFirst() + " is not valid!", ERROR); return; } setMessage(DEFAULT_MESSAGE); }
@Test private void musteReturnAnObjectWithAPairLongStringIfTheTimerDataHasHttpTimerData() { InvocationSequenceData invocationSequenceData = new InvocationSequenceData(new Timestamp(10L), 10L, 20L, 108L); HttpTimerData timerData = new HttpTimerData(new Timestamp(10), 10, 10, 108L); HttpInfo httpInfo = new HttpInfo("URI", "requestMethod", "headerValue"); timerData.setHttpInfo(httpInfo); invocationSequenceData.setTimerData(timerData); Pair<Long, String> aggregationKey = (Pair<Long, String>) DiagnosisDataAggregator.getInstance().getAggregationKey(invocationSequenceData); assertThat("The string of the pair must be the sql data", aggregationKey.getSecond(), is(timerData.getHttpInfo().getUri())); }
@SuppressWarnings("unchecked") @Override public void onRemoval(RemovalNotification<AbstractEUMSpanDetails, Pair<Boolean, AbstractEUMPointBuilder>> notification) { AbstractEUMSpanDetails element = notification.getKey(); synchronized (element) { AbstractEUMPointBuilder builder = notification.getValue().getSecond(); Long sessId = element.getOwningSpan().getSessionId(); Long tabId = element.getOwningSpan().getTabId(); Pair<Long, Long> plrSessionTabId = new Pair<Long, Long>(sessId, tabId); missingSessionInfosMap.remove(sessId, element); missingPageLoadRequestsMap.remove(plrSessionTabId, element); // Force a write even if data is still missing in case of an cache // eviction because of the timeout if (notification.getCause() != RemovalCause.EXPLICIT) { PageLoadRequest plr = pageLoadRequestCache.getIfPresent(plrSessionTabId); UserSessionInfo sessionInfo = sessionInfoCache.getIfPresent(sessId); dataPointsToWrite.addAll(builder.build(sessionInfo, plr, element)); } } } }).build();
if (pair != null) { @SuppressWarnings("rawtypes") AbstractEUMPointBuilder responsibleBuilder = pair.getSecond(); boolean isBrowserInfoCaptured = pair.getFirst();
@Test private void musteReturnAnObjectWithAPairLongStringIfTheTimerDataHasSqlData() { InvocationSequenceData invocationSequenceData = new InvocationSequenceData(new Timestamp(10L), 10L, 20L, 108L); SqlStatementData sqlStatementData = new SqlStatementData(new Timestamp(10), 10, 10, 108L); sqlStatementData.setCount(1); sqlStatementData.setSql("blahblahblah"); invocationSequenceData.setSqlStatementData(sqlStatementData); TimerData timerData = new TimerData(); invocationSequenceData.setTimerData(timerData); Pair<Long, String> aggregationKey = (Pair<Long, String>) DiagnosisDataAggregator.getInstance().getAggregationKey(invocationSequenceData); assertThat("The string of the pair must be the sql data", aggregationKey.getSecond(), is(sqlStatementData.getSql())); }
if (serviceStatus == ExternalServiceStatus.CONNECTED) { serviceEntry.getValue().getFirst().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_RECORD_GREEN)); serviceEntry.getValue().getSecond().setText("Connected"); } else if (serviceStatus == ExternalServiceStatus.DISCONNECTED) { serviceEntry.getValue().getFirst().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_RECORD)); serviceEntry.getValue().getSecond().setText("Disconnected"); } else if (serviceStatus == ExternalServiceStatus.DISABLED) { serviceEntry.getValue().getFirst().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_RECORD_GRAY)); serviceEntry.getValue().getSecond().setText("Disabled"); } else if (serviceStatus == ExternalServiceStatus.UNKNOWN) { serviceEntry.getValue().getFirst().setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_RECORD_YELLOW)); serviceEntry.getValue().getSecond().setText("Unknown status"); serviceEntry.getValue().getSecond().setText("");