MCPcopy Create free account
hub / github.com/BaseXdb/basex / initSandbox

Method initSandbox

basex-core/src/main/java/org/basex/core/Sandbox.java:495–511  ·  view source on GitHub ↗

Creates the sandbox.

()

Source from the content-addressed store, hash-verified

493 * Creates the sandbox.
494 */
495 public static void initSandbox() {
496 final IOFile sb = sandbox();
497 //sb.delete();
498 if(!sb.md()) fail("Sandbox could not be created.");
499
500 final String path = sb.path();
501 Prop.put(StaticOptions.DBPATH, path + "/data");
502 Prop.put(StaticOptions.WEBPATH, path + "/webapp");
503 Prop.put(StaticOptions.RESTXQPATH, path + "/webapp");
504 Prop.put(StaticOptions.REPOPATH, path + "/repo");
505 Prop.put(StaticOptions.SERVERPORT, Integer.toString(DB_PORT));
506 context = new Context();
507
508 // disable loop unrolling and function inlining
509 context.options.set(MainOptions.UNROLLLIMIT, 0);
510 context.options.set(MainOptions.INLINELIMIT, 0);
511 }
512
513 /**
514 * Removes test databases and closes the database context.

Callers 3

initTestsMethod · 0.80
initTestsMethod · 0.80
initTestsMethod · 0.80

Calls 6

sandboxMethod · 0.95
mdMethod · 0.95
putMethod · 0.95
toStringMethod · 0.65
setMethod · 0.65
pathMethod · 0.45

Tested by 3

initTestsMethod · 0.64
initTestsMethod · 0.64
initTestsMethod · 0.64