Skip to content

Commit

Permalink
PR comment: Better test coverage in CompositeIndexAccessorCompatibility
Browse files Browse the repository at this point in the history
Some tests still miss Spatial implementation, left as todo.
Also remove testSuite.supportsTemporal() because always true.
  • Loading branch information
burqen committed Jul 27, 2018
1 parent c7746b2 commit dad19f3
Show file tree
Hide file tree
Showing 8 changed files with 385 additions and 298 deletions.
Expand Up @@ -51,9 +51,4 @@ public boolean supportsSpatial()
return true;
}

@Override
public boolean supportsTemporal()
{
return true;
}
}
Expand Up @@ -51,9 +51,4 @@ public boolean supportsSpatial()
return true;
}

@Override
public boolean supportsTemporal()
{
return true;
}
}
Expand Up @@ -51,9 +51,4 @@ public boolean supportsSpatial()
return true;
}

@Override
public boolean supportsTemporal()
{
return true;
}
}

Large diffs are not rendered by default.

Expand Up @@ -51,12 +51,6 @@ public boolean supportsSpatial()
return false;
}

@Override
public boolean supportsTemporal()
{
return true;
}

@Override
public boolean supportsGranularCompositeQueries()
{
Expand Down
Expand Up @@ -72,8 +72,6 @@ public abstract class IndexProviderCompatibilityTestSuite

public abstract boolean supportsSpatial();

public abstract boolean supportsTemporal();

public boolean supportsGranularCompositeQueries()
{
return false;
Expand Down Expand Up @@ -112,7 +110,6 @@ public Compatibility( IndexProviderCompatibilityTestSuite testSuite, IndexDescri
this.descriptor = descriptor.withId( 17 );
this.valueSet1 = allValues(
testSuite.supportsSpatial(),
testSuite.supportsTemporal(),
Arrays.asList(
Values.of( "string1" ),
Values.of( 42 ),
Expand Down Expand Up @@ -184,7 +181,6 @@ public Compatibility( IndexProviderCompatibilityTestSuite testSuite, IndexDescri

this.valueSet2 = allValues(
testSuite.supportsSpatial(),
testSuite.supportsTemporal(),
Arrays.asList( Values.of( "string2" ), Values.of( 1337 ), Values.of( false ),
Values.of( new char[]{'b', 'c'} ),
Values.of( new String[]{"someString1", "someString2"} ),
Expand Down Expand Up @@ -264,7 +260,6 @@ List<IndexEntryUpdate<?>> updates( List<NodeAndValue> values, long nodeIdOffset
}

private static List<NodeAndValue> allValues( boolean supportsSpatial,
boolean supportsTemporal,
List<Value> common,
List<Value> temporal,
List<Value> spatial )
Expand All @@ -282,12 +277,9 @@ private static List<NodeAndValue> allValues( boolean supportsSpatial,
result.add( new NodeAndValue( nodeIds++, value ) );
}
}
if ( supportsTemporal )
for ( Value value : temporal )
{
for ( Value value : temporal )
{
result.add( new NodeAndValue( nodeIds++, value ) );
}
result.add( new NodeAndValue( nodeIds++, value ) );
}
return result;
}
Expand Down
Expand Up @@ -161,8 +161,6 @@ public void testIndexSeekByPrefixOnNonStrings() throws Exception
@Test
public void testIndexRangeSeekByDateTimeWithSneakyZones() throws Exception
{
Assume.assumeTrue( testSuite.supportsTemporal() );

DateTimeValue d1 = datetime( 9999, 100, ZoneId.of( "+18:00" ) );
DateTimeValue d4 = datetime( 10000, 100, ZoneId.of( "UTC" ) );
DateTimeValue d5 = datetime( 10000, 100, ZoneId.of( "+01:00" ) );
Expand Down Expand Up @@ -306,7 +304,6 @@ public void testIndexRangeSeekByStringWithDuplicates() throws Exception
@Test
public void testIndexRangeSeekByDateWithDuplicates() throws Exception
{
Assume.assumeTrue( testSuite.supportsTemporal() );
testIndexRangeSeekWithDuplicates( epochDate( 100 ),
epochDate( 101 ),
epochDate( 200 ),
Expand All @@ -316,7 +313,6 @@ public void testIndexRangeSeekByDateWithDuplicates() throws Exception
@Test
public void testIndexRangeSeekByLocalDateTimeWithDuplicates() throws Exception
{
Assume.assumeTrue( testSuite.supportsTemporal() );
testIndexRangeSeekWithDuplicates( localDateTime( 1000, 10 ),
localDateTime( 1000, 11 ),
localDateTime( 2000, 10 ),
Expand All @@ -326,7 +322,6 @@ public void testIndexRangeSeekByLocalDateTimeWithDuplicates() throws Exception
@Test
public void testIndexRangeSeekByDateTimeWithDuplicates() throws Exception
{
Assume.assumeTrue( testSuite.supportsTemporal() );
testIndexRangeSeekWithDuplicates( datetime( 1000, 10, UTC ),
datetime( 1000, 11, UTC ),
datetime( 2000, 10, UTC ),
Expand All @@ -336,7 +331,6 @@ public void testIndexRangeSeekByDateTimeWithDuplicates() throws Exception
@Test
public void testIndexRangeSeekByLocalTimeWithDuplicates() throws Exception
{
Assume.assumeTrue( testSuite.supportsTemporal() );
testIndexRangeSeekWithDuplicates( localTime( 1000 ),
localTime( 1001 ),
localTime( 2000 ),
Expand All @@ -346,7 +340,6 @@ public void testIndexRangeSeekByLocalTimeWithDuplicates() throws Exception
@Test
public void testIndexRangeSeekByTimeWithDuplicates() throws Exception
{
Assume.assumeTrue( testSuite.supportsTemporal() );
testIndexRangeSeekWithDuplicates( time( 1000, UTC ),
time( 1001, UTC ),
time( 2000, UTC ),
Expand All @@ -356,7 +349,6 @@ public void testIndexRangeSeekByTimeWithDuplicates() throws Exception
@Test
public void testIndexRangeSeekByTimeWithZonesAndDuplicates() throws Exception
{
Assume.assumeTrue( testSuite.supportsTemporal() );
testIndexRangeSeekWithDuplicates( time( 20, 31, 53, 4, ZoneOffset.of("+17:02") ),
time( 20, 31, 54, 3, ZoneOffset.of("+17:02") ),
time( 19, 31, 54, 2, UTC ),
Expand All @@ -366,7 +358,6 @@ public void testIndexRangeSeekByTimeWithZonesAndDuplicates() throws Exception
@Test
public void testIndexRangeSeekByDurationWithDuplicates() throws Exception
{
Assume.assumeTrue( testSuite.supportsTemporal() );
testIndexRangeSeekWithDuplicates( duration( 1, 1, 1, 1 ),
duration( 1, 1, 1, 2 ),
duration( 2, 1, 1, 1 ),
Expand Down
Expand Up @@ -32,7 +32,12 @@ private IndexQueryHelper()

public static IndexQuery exact( int propertyKeyId, Object value )
{
return IndexQuery.exact( propertyKeyId, Values.of( value ) );
return exact( propertyKeyId, Values.of( value ) );
}

public static IndexQuery exact( int propertyKeyId, Value value )
{
return IndexQuery.exact( propertyKeyId, value );
}

public static IndexEntryUpdate<SchemaDescriptor> add(
Expand Down

0 comments on commit dad19f3

Please sign in to comment.