use of org.neo4j.util.VisibleForTesting in project neo4j by neo4j.
the class SetInitialPasswordCommand method loadNeo4jConfig.
@VisibleForTesting
Config loadNeo4jConfig() {
Config cfg = Config.newBuilder().set(GraphDatabaseSettings.neo4j_home, ctx.homeDir().toAbsolutePath()).fromFileNoThrow(ctx.confDir().resolve(Config.DEFAULT_CONFIG_FILE_NAME)).commandExpansion(allowCommandExpansion).build();
ConfigUtils.disableAllConnectors(cfg);
return cfg;
}
use of org.neo4j.util.VisibleForTesting in project neo4j by neo4j.
the class AdminTool method execute.
@SuppressWarnings("InstantiationOfUtilityClass")
@VisibleForTesting
public static int execute(ExecutionContext ctx, String... args) {
PrintWriter out = new PrintWriter(ctx.out(), true);
final var cmd = new CommandLine(new AdminTool()).setOut(out).setErr(new PrintWriter(ctx.err(), true)).setUsageHelpWidth(120).setCaseInsensitiveEnumValuesAllowed(true);
registerCommands(cmd, ctx, Services.loadAll(CommandProvider.class));
if (args.length == 0) {
cmd.usage(out);
return ExitCode.USAGE;
}
return cmd.execute(args);
}
use of org.neo4j.util.VisibleForTesting in project neo4j by neo4j.
the class GBPTree method visit.
@VisibleForTesting
public <VISITOR extends GBPTreeVisitor<KEY, VALUE>> VISITOR visit(VISITOR visitor, CursorContext cursorContext) throws IOException {
try (PageCursor cursor = openRootCursor(PF_SHARED_READ_LOCK, cursorContext)) {
new GBPTreeStructure<>(bTreeNode, layout, stableGeneration(generation), unstableGeneration(generation)).visitTree(cursor, writer.cursor, visitor, cursorContext);
freeList.visitFreelist(visitor, cursorContext);
}
return visitor;
}
use of org.neo4j.util.VisibleForTesting in project neo4j by neo4j.
the class GBPTree method unsafe.
@VisibleForTesting
public void unsafe(GBPTreeUnsafe<KEY, VALUE> unsafe, CursorContext cursorContext) throws IOException {
TreeState state;
try (PageCursor cursor = pagedFile.io(0, PagedFile.PF_SHARED_WRITE_LOCK, cursorContext)) {
// todo find better way of getting TreeState?
Pair<TreeState, TreeState> states = TreeStatePair.readStatePages(cursor, IdSpace.STATE_PAGE_A, IdSpace.STATE_PAGE_B);
state = TreeStatePair.selectNewestValidState(states);
}
unsafe.access(pagedFile, layout, bTreeNode, state);
}
use of org.neo4j.util.VisibleForTesting in project neo4j by neo4j.
the class ImportCommand method loadNeo4jConfig.
@VisibleForTesting
Config loadNeo4jConfig() {
Config cfg = Config.newBuilder().set(GraphDatabaseSettings.neo4j_home, ctx.homeDir().toAbsolutePath()).fromFileNoThrow(ctx.confDir().resolve(Config.DEFAULT_CONFIG_FILE_NAME)).fromFileNoThrow(additionalConfig).commandExpansion(allowCommandExpansion).build();
ConfigUtils.disableAllConnectors(cfg);
return cfg;
}
Aggregations