Skip to content

Commit

Permalink
Gather all non unique native index populator tests under same umbrell…
Browse files Browse the repository at this point in the history
…a as unique

Except for spatial which we expect to need some special treatment later on.
  • Loading branch information
burqen committed Oct 3, 2018
1 parent 74b7bc8 commit 2f52169
Show file tree
Hide file tree
Showing 14 changed files with 184 additions and 555 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

Expand Up @@ -19,8 +19,10 @@
*/
package org.neo4j.kernel.impl.index.schema;

import org.neo4j.storageengine.api.schema.IndexDescriptor;

@FunctionalInterface
interface LayoutTestUtilFactory<KEY extends NativeIndexKey<KEY>, VALUE extends NativeIndexValue>
{
LayoutTestUtil<KEY,VALUE> create();
LayoutTestUtil<KEY,VALUE> create( IndexDescriptor descriptor );
}

This file was deleted.

This file was deleted.

Expand Up @@ -37,7 +37,6 @@
import org.neo4j.kernel.configuration.Config;
import org.neo4j.kernel.impl.index.schema.config.ConfiguredSpaceFillingCurveSettingsCache;
import org.neo4j.kernel.impl.index.schema.config.IndexSpecificSpaceFillingCurveSettingsCache;
import org.neo4j.storageengine.api.schema.IndexDescriptor;
import org.neo4j.storageengine.api.schema.StoreIndexDescriptor;
import org.neo4j.values.storable.ValueGroup;

Expand All @@ -47,47 +46,46 @@ public class NativeIndexAccessorTest<KEY extends NativeIndexKey<KEY>, VALUE exte
@Parameterized.Parameters( name = "{index}: {0}" )
public static Collection<Object[]> data()
{
IndexDescriptor descriptor = TestIndexDescriptorFactory.forLabel( 42, 666 );
return Arrays.asList( new Object[][]{
{"Number",
numberAccessorFactory(),
(LayoutTestUtilFactory) () -> new NumberLayoutTestUtil( descriptor )
(LayoutTestUtilFactory) NumberLayoutTestUtil::new
},
{"String",
stringAccessorFactory(),
(LayoutTestUtilFactory) () -> new StringLayoutTestUtil( descriptor )
(LayoutTestUtilFactory) StringLayoutTestUtil::new
},
{"Date",
temporalAccessorFactory( ValueGroup.DATE ),
(LayoutTestUtilFactory) () -> new DateLayoutTestUtil( descriptor )
(LayoutTestUtilFactory) DateLayoutTestUtil::new
},
{"DateTime",
temporalAccessorFactory( ValueGroup.ZONED_DATE_TIME ),
(LayoutTestUtilFactory) () -> new DateTimeLayoutTestUtil( descriptor )
(LayoutTestUtilFactory) DateTimeLayoutTestUtil::new
},
{"Duration",
temporalAccessorFactory( ValueGroup.DURATION ),
(LayoutTestUtilFactory) () -> new DurationLayoutTestUtil( descriptor )
(LayoutTestUtilFactory) DurationLayoutTestUtil::new
},
{"LocalDateTime",
temporalAccessorFactory( ValueGroup.LOCAL_DATE_TIME ),
(LayoutTestUtilFactory) () -> new LocalDateTimeLayoutTestUtil( descriptor )
(LayoutTestUtilFactory) LocalDateTimeLayoutTestUtil::new
},
{"LocalTime",
temporalAccessorFactory( ValueGroup.LOCAL_TIME ),
(LayoutTestUtilFactory) () -> new LocalTimeLayoutTestUtil( descriptor )
(LayoutTestUtilFactory) LocalTimeLayoutTestUtil::new
},
{"LocalDateTime",
temporalAccessorFactory( ValueGroup.LOCAL_DATE_TIME ),
(LayoutTestUtilFactory) () -> new LocalDateTimeLayoutTestUtil( descriptor )
(LayoutTestUtilFactory) LocalDateTimeLayoutTestUtil::new
},
{"Time",
temporalAccessorFactory( ValueGroup.ZONED_TIME ),
(LayoutTestUtilFactory) () -> new TimeLayoutTestUtil( descriptor )
(LayoutTestUtilFactory) TimeLayoutTestUtil::new
},
{"Generic",
genericAccessorFactory(),
(LayoutTestUtilFactory) () -> new GenericLayoutTestUtil( descriptor )
(LayoutTestUtilFactory) GenericLayoutTestUtil::new
},
//{ Spatial has it's own subclass because it need to override some of the test methods }
} );
Expand All @@ -112,7 +110,7 @@ NativeIndexAccessor<KEY,VALUE> makeAccessor() throws IOException
@Override
LayoutTestUtil<KEY,VALUE> createLayoutTestUtil()
{
return layoutTestUtilFactory.create();
return layoutTestUtilFactory.create( TestIndexDescriptorFactory.forLabel( 42, 666 ) );
}

/* Helpers */
Expand Down

0 comments on commit 2f52169

Please sign in to comment.