/** * Tests is in collection restrictions. */ @Test public void isInCollectionTrue() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.isInCollection("id", Collections.singletonList(1L))); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(true)); }
/** * Test less than restriction. */ @Test public void lessThanOne() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.lessThan("id", 1L)); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(false)); }
/** * Tests is in collection restrictions. */ @Test public void isInCollectionFalse() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.isInCollection("id", Collections.singletonList(2L))); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(false)); }
/** * Test not equal restriction. */ @Test public void notEqualsFalse() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.notEqual("id", 1L)); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(false)); }
/** * Test greater or equal restriction. */ @Test public void greaterEqualTwo() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.greaterEqual("id", 2L)); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(false)); }
/** * Test less than restriction. */ @Test public void lessThanTwo() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.lessThan("id", 2L)); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(true)); }
/** * Test less or equal restriction. */ @Test public void lessEqualOne() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.lessEqual("id", 1L)); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(true)); }
/** * Test equal restriction. */ @Test public void equalsTrue() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.equal("id", 1L)); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(true)); }
/** * Test equal restriction. */ @Test public void equalsFalse() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.equal("id", 0L)); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(false)); }
/** * Test is null restriction. */ @Test public void isNull() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.isNull("id")); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(false)); }
/** * Test greater than restriction. */ @Test public void greaterThanZero() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.greaterThan("id", 0L)); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(true)); }
/** * Test less or equal restriction. */ @Test public void lessEqualTwo() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.lessEqual("id", 2L)); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(true)); }
/** * Test greater than restriction. */ @Test public void greaterThanOne() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.greaterThan("id", 1L)); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(false)); }
/** * Test greater than restriction. */ @Test public void greaterThanTwo() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.greaterThan("id", 2L)); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(false)); }
/** * Test greater or equal restriction. */ @Test public void greaterEqualZero() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.greaterEqual("id", 0L)); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(true)); }
/** * Test not equal restriction. */ @Test public void notEqualsTrue() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.notEqual("id", 0L)); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(true)); }
/** * Test is not null restriction. */ @Test public void isNotNull() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.isNotNull("id")); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(true)); }
/** * Test greater or equal restriction. */ @Test public void greaterEqualOne() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.greaterEqual("id", 1L)); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(true)); }
/** * Test less or equal restriction. */ @Test public void lessEqualZero() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.lessEqual("id", 0L)); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(false)); }
/** * Tests that the same field is invoked twice so we pull method from the cache. */ @Test public void twiceExistingField() { TimerData timerData = new TimerData(); timerData.setId(1L); List<IIndexQueryRestriction> restrictions = Collections.singletonList(IndexQueryRestrictionFactory.equal("id", 1L)); processor.areAllRestrictionsFulfilled(timerData, restrictions); boolean result = processor.areAllRestrictionsFulfilled(timerData, restrictions); assertThat(result, is(true)); }