Search in sources :

Example 16 with LabelScanStoreProvider

use of org.neo4j.kernel.impl.api.scan.LabelScanStoreProvider in project neo4j by neo4j.

the class NamedLabelScanStoreSelectionStrategyTest method shouldAutoSelectSingleProviderWithPresentStore.

@Test
public void shouldAutoSelectSingleProviderWithPresentStore() throws Exception {
    // GIVEN
    NamedLabelScanStoreSelectionStrategy strategy = strategy(LabelIndex.AUTO);
    LabelScanStoreProvider nativeProvider = provider(LabelIndex.NATIVE, store(true));
    // WHEN
    LabelScanStoreProvider selected = select(strategy, nativeProvider);
    // THEN
    assertSame(nativeProvider, selected);
}
Also used : LabelScanStoreProvider(org.neo4j.kernel.impl.api.scan.LabelScanStoreProvider) Test(org.junit.Test)

Example 17 with LabelScanStoreProvider

use of org.neo4j.kernel.impl.api.scan.LabelScanStoreProvider in project neo4j by neo4j.

the class NamedLabelScanStoreSelectionStrategyTest method shouldFailOnMissingSpecificallyConfiguredProvider.

@Test
public void shouldFailOnMissingSpecificallyConfiguredProvider() throws Exception {
    // GIVEN
    NamedLabelScanStoreSelectionStrategy strategy = strategy(LabelIndex.LUCENE);
    LabelScanStoreProvider nativeProvider = provider(LabelIndex.NATIVE, store(false));
    // WHEN
    try {
        select(strategy, nativeProvider);
        fail("Should've failed");
    } catch (IllegalArgumentException e) {
    // THEN good
    }
}
Also used : LabelScanStoreProvider(org.neo4j.kernel.impl.api.scan.LabelScanStoreProvider) Test(org.junit.Test)

Aggregations

LabelScanStoreProvider (org.neo4j.kernel.impl.api.scan.LabelScanStoreProvider)17 Test (org.junit.Test)9 IOException (java.io.IOException)4 Dependencies (org.neo4j.kernel.impl.util.Dependencies)3 SchemaIndexProvider (org.neo4j.kernel.api.index.SchemaIndexProvider)2 Config (org.neo4j.kernel.configuration.Config)2 NamedLabelScanStoreSelectionStrategy (org.neo4j.kernel.extension.dependency.NamedLabelScanStoreSelectionStrategy)2 StandardConstraintSemantics (org.neo4j.kernel.impl.constraints.StandardConstraintSemantics)2 IndexConfigStore (org.neo4j.kernel.impl.index.IndexConfigStore)2 KernelContext (org.neo4j.kernel.impl.spi.KernelContext)2 SimpleKernelContext (org.neo4j.kernel.impl.spi.SimpleKernelContext)2 VisibleMigrationProgressMonitor (org.neo4j.kernel.impl.storemigration.monitoring.VisibleMigrationProgressMonitor)2 SynchronizedArrayIdOrderingQueue (org.neo4j.kernel.impl.util.SynchronizedArrayIdOrderingQueue)2 ArrayList (java.util.ArrayList)1 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)1 PageCache (org.neo4j.io.pagecache.PageCache)1 AvailabilityGuard (org.neo4j.kernel.AvailabilityGuard)1 GraphDatabaseDependencies (org.neo4j.kernel.GraphDatabaseDependencies)1 NeoStoreDataSource (org.neo4j.kernel.NeoStoreDataSource)1 KernelException (org.neo4j.kernel.api.exceptions.KernelException)1