/** * Tests is in collection restrictions with field navigation. */ @Test public void isInCollectionFalseNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.isInCollection("httpInfo.id", Collections.singletonList(2L))); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(false)); }
/** * Test equal restriction with field navigation. */ @Test public void equalsTrueNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.equal("httpInfo.id", 1L)); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(true)); }
/** * Test not equal restriction with field navigation. */ @Test public void notEqualsFalseNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.notEqual("httpInfo.id", 1L)); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(false)); }
/** * Test less than restriction with field navigation. */ @Test public void lessThanZeroNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.lessThan("httpInfo.id", 0L)); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(false)); }
/** * Test is not null restriction with field navigation. */ @Test public void isNotNullNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.isNotNull("httpInfo.id")); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(true)); }
/** * Test greater or equal restriction with field navigation. */ @Test public void greaterEqualOneNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.greaterEqual("httpInfo.id", 1L)); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(true)); }
/** * Test equal restriction with field navigation. */ @Test public void equalsFalseNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.equal("httpInfo.id", 0L)); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(false)); }
/** * Test greater than restriction with field navigation. */ @Test public void greaterThanOneNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.greaterThan("httpInfo.id", 1L)); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(false)); }
/** * Test greater than restriction with field navigation. */ @Test public void greaterThanZeroNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.greaterThan("httpInfo.id", 0L)); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(true)); }
/** * Test less or equal restriction with field navigation. */ @Test public void lessEqualTwoNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.lessEqual("httpInfo.id", 2L)); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(true)); }
/** * Test not equal restriction with field navigation. */ @Test public void notEqualsTrueRestrictionNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.notEqual("httpInfo.id", 0L)); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(true)); }
/** * Test is null restriction with field navigation. */ @Test public void isNullNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.isNull("httpInfo.id")); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(false)); }
/** * Test greater or equal restriction with field navigation. */ @Test public void greaterEqualZeroNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.greaterEqual("httpInfo.id", 0L)); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(true)); }
/** * Test less than restriction with field navigation. */ @Test public void lessThanTwoNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.lessThan("httpInfo.id", 2L)); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(true)); }
/** * Test greater than restriction with field navigation. */ @Test public void greaterThanTwoNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.greaterThan("httpInfo.id", 2L)); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(false)); }
/** * Test less than restriction with field navigation. */ @Test public void lessThanOneNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.lessThan("httpInfo.id", 1L)); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(false)); }
/** * Test less or equal restriction with field navigation. */ @Test public void lessEqualOneNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.lessEqual("httpInfo.id", 1L)); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(true)); }
/** * Test less or equal restriction with field navigation. */ @Test public void lessEqualZeroNavigation() { HttpTimerData httpData = new HttpTimerData(); httpData.getHttpInfo().setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.lessEqual("httpInfo.id", 0L)); boolean result = processor.areAllRestrictionsFulfilled(httpData, restrictions); assertThat(result, is(false)); }
@Test private void musteReturnAnInstanceWithHttpSourceTypeDataIfTheTimerDataIsHttpTimerData() { InvocationSequenceData invocationSequenceData = new InvocationSequenceData(new Timestamp(10L), 10L, 20L, 108L); HttpTimerData timerData = new HttpTimerData(); invocationSequenceData.setTimerData(timerData); AggregatedDiagnosisData aggregatedDiagnosisData = DiagnosisDataAggregator.getInstance().getAggregatedDiagnosisData(invocationSequenceData); assertThat("The object must have HTTP as source type", aggregatedDiagnosisData.getSourceType(), is(SourceType.HTTP)); }
@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())); }