Search in sources :

Example 1 with NullLogProvider

use of org.neo4j.logging.NullLogProvider in project neo4j by neo4j.

the class ExecutionEngineTests method shouldConvertListsAndMapsWhenPassingFromScalaToJava.

@Test
public void shouldConvertListsAndMapsWhenPassingFromScalaToJava() throws Exception {
    GraphDatabaseQueryService graph = new GraphDatabaseCypherService(this.database.getGraphDatabaseAPI());
    KernelAPI kernelAPI = graph.getDependencyResolver().resolveDependency(KernelAPI.class);
    Monitors monitors = graph.getDependencyResolver().resolveDependency(Monitors.class);
    NullLogProvider nullLogProvider = NullLogProvider.getInstance();
    CommunityCompatibilityFactory compatibilityFactory = new CommunityCompatibilityFactory(graph, kernelAPI, monitors, nullLogProvider);
    ExecutionEngine executionEngine = new ExecutionEngine(graph, nullLogProvider, compatibilityFactory);
    Result result;
    try (InternalTransaction tx = graph.beginTransaction(KernelTransaction.Type.implicit, SecurityContext.AUTH_DISABLED)) {
        String query = "RETURN { key : 'Value' , collectionKey: [{ inner: 'Map1' }, { inner: 'Map2' }]}";
        TransactionalContext tc = createTransactionContext(graph, tx, query);
        result = executionEngine.executeQuery(query, NO_PARAMS, tc);
        tx.success();
    }
    Map firstRowValue = (Map) result.next().values().iterator().next();
    assertThat(firstRowValue.get("key"), is("Value"));
    List theList = (List) firstRowValue.get("collectionKey");
    assertThat(((Map) theList.get(0)).get("inner"), is("Map1"));
    assertThat(((Map) theList.get(1)).get("inner"), is("Map2"));
}
Also used : GraphDatabaseQueryService(org.neo4j.kernel.GraphDatabaseQueryService) GraphDatabaseCypherService(org.neo4j.cypher.javacompat.internal.GraphDatabaseCypherService) InternalTransaction(org.neo4j.kernel.impl.coreapi.InternalTransaction) Result(org.neo4j.graphdb.Result) Monitors(org.neo4j.kernel.monitoring.Monitors) NullLogProvider(org.neo4j.logging.NullLogProvider) CommunityCompatibilityFactory(org.neo4j.cypher.internal.CommunityCompatibilityFactory) List(java.util.List) TransactionalContext(org.neo4j.kernel.impl.query.TransactionalContext) KernelAPI(org.neo4j.kernel.api.KernelAPI) Map(java.util.Map) Test(org.junit.Test)

Example 2 with NullLogProvider

use of org.neo4j.logging.NullLogProvider in project neo4j by neo4j.

the class RsdrMain method openStore.

private static StoreFactory openStore(FileSystemAbstraction fileSystem, File storeDir, Config config, PageCache pageCache) {
    IdGeneratorFactory idGeneratorFactory = new DefaultIdGeneratorFactory(fileSystem);
    NullLogProvider logProvider = NullLogProvider.getInstance();
    return new StoreFactory(storeDir, config, idGeneratorFactory, pageCache, fileSystem, logProvider);
}
Also used : DefaultIdGeneratorFactory(org.neo4j.kernel.impl.store.id.DefaultIdGeneratorFactory) IdGeneratorFactory(org.neo4j.kernel.impl.store.id.IdGeneratorFactory) DefaultIdGeneratorFactory(org.neo4j.kernel.impl.store.id.DefaultIdGeneratorFactory) NullLogProvider(org.neo4j.logging.NullLogProvider) StoreFactory(org.neo4j.kernel.impl.store.StoreFactory)

Example 3 with NullLogProvider

use of org.neo4j.logging.NullLogProvider in project neo4j by neo4j.

the class ComparableRaftStateTest method twoIdenticalStatesShouldBeEqual.

@Test
public void twoIdenticalStatesShouldBeEqual() throws Exception {
    // given
    NullLogProvider logProvider = NullLogProvider.getInstance();
    ComparableRaftState state1 = new ComparableRaftState(member(0), asSet(member(0), member(1), member(2)), asSet(member(0), member(1), member(2)), new InMemoryRaftLog(), new InFlightMap<>(), logProvider);
    ComparableRaftState state2 = new ComparableRaftState(member(0), asSet(member(0), member(1), member(2)), asSet(member(0), member(1), member(2)), new InMemoryRaftLog(), new InFlightMap<>(), logProvider);
    // then
    assertEquals(state1, state2);
}
Also used : InMemoryRaftLog(org.neo4j.causalclustering.core.consensus.log.InMemoryRaftLog) NullLogProvider(org.neo4j.logging.NullLogProvider) Test(org.junit.Test)

Example 4 with NullLogProvider

use of org.neo4j.logging.NullLogProvider in project neo4j by neo4j.

the class LuceneSchemaIndexProviderCompatibilitySuiteTest method createIndexProvider.

@Override
protected LuceneSchemaIndexProvider createIndexProvider(FileSystemAbstraction fs, File graphDbDir) {
    DirectoryFactory.InMemoryDirectoryFactory directoryFactory = new DirectoryFactory.InMemoryDirectoryFactory();
    NullLogProvider logging = NullLogProvider.getInstance();
    Config config = Config.defaults();
    OperationalMode mode = OperationalMode.single;
    return new LuceneSchemaIndexProvider(fs, directoryFactory, graphDbDir, logging, config, mode);
}
Also used : Config(org.neo4j.kernel.configuration.Config) DirectoryFactory(org.neo4j.kernel.api.impl.index.storage.DirectoryFactory) NullLogProvider(org.neo4j.logging.NullLogProvider) OperationalMode(org.neo4j.kernel.impl.factory.OperationalMode)

Aggregations

NullLogProvider (org.neo4j.logging.NullLogProvider)4 Test (org.junit.Test)2 List (java.util.List)1 Map (java.util.Map)1 InMemoryRaftLog (org.neo4j.causalclustering.core.consensus.log.InMemoryRaftLog)1 CommunityCompatibilityFactory (org.neo4j.cypher.internal.CommunityCompatibilityFactory)1 GraphDatabaseCypherService (org.neo4j.cypher.javacompat.internal.GraphDatabaseCypherService)1 Result (org.neo4j.graphdb.Result)1 GraphDatabaseQueryService (org.neo4j.kernel.GraphDatabaseQueryService)1 KernelAPI (org.neo4j.kernel.api.KernelAPI)1 DirectoryFactory (org.neo4j.kernel.api.impl.index.storage.DirectoryFactory)1 Config (org.neo4j.kernel.configuration.Config)1 InternalTransaction (org.neo4j.kernel.impl.coreapi.InternalTransaction)1 OperationalMode (org.neo4j.kernel.impl.factory.OperationalMode)1 TransactionalContext (org.neo4j.kernel.impl.query.TransactionalContext)1 StoreFactory (org.neo4j.kernel.impl.store.StoreFactory)1 DefaultIdGeneratorFactory (org.neo4j.kernel.impl.store.id.DefaultIdGeneratorFactory)1 IdGeneratorFactory (org.neo4j.kernel.impl.store.id.IdGeneratorFactory)1 Monitors (org.neo4j.kernel.monitoring.Monitors)1