use of org.neo4j.driver.v1.Config in project neo4j by neo4j.
the class TransactionGuardIntegrationTest method terminateLongRunningDriverPeriodicCommitQuery.
@Test
public void terminateLongRunningDriverPeriodicCommitQuery() throws Exception {
GraphDatabaseAPI database = startDatabaseWithTimeoutCustomGuard();
CommunityNeoServer neoServer = startNeoServer((GraphDatabaseFacade) database);
org.neo4j.driver.v1.Config driverConfig = getDriverConfig();
try (Driver driver = GraphDatabase.driver("bolt://localhost:" + boltPortCustomGuard, driverConfig);
Session session = driver.session()) {
URL url = prepareTestImportFile(8);
session.run("USING PERIODIC COMMIT 5 LOAD CSV FROM '" + url + "' AS line CREATE ();").consume();
fail("Transaction should be already terminated by execution guard.");
} catch (Exception expected) {
//
}
assertDatabaseDoesNotHaveNodes(database);
}
use of org.neo4j.driver.v1.Config in project neo4j by neo4j.
the class TransactionGuardIntegrationTest method terminateLongRunningDriverQuery.
@Test
public void terminateLongRunningDriverQuery() throws Exception {
GraphDatabaseAPI database = startDatabaseWithTimeout();
CommunityNeoServer neoServer = startNeoServer((GraphDatabaseFacade) database);
org.neo4j.driver.v1.Config driverConfig = getDriverConfig();
try (Driver driver = GraphDatabase.driver("bolt://localhost:" + boltPortDatabaseWithTimeout, driverConfig);
Session session = driver.session()) {
org.neo4j.driver.v1.Transaction transaction = session.beginTransaction();
transaction.run("create (n)").consume();
transaction.success();
fakeClock.forward(3, TimeUnit.SECONDS);
try {
transaction.run("create (n)").consume();
fail("Transaction should be already terminated by execution guard.");
} catch (Exception expected) {
// ignored
}
}
assertDatabaseDoesNotHaveNodes(database);
}
use of org.neo4j.driver.v1.Config in project jdk8u_jdk by JetBrains.
the class EType method initStatic.
public static void initStatic() {
boolean allowed = false;
try {
Config cfg = Config.getInstance();
String temp = cfg.get("libdefaults", "allow_weak_crypto");
if (temp != null && temp.equals("true"))
allowed = true;
} catch (Exception exc) {
if (DEBUG) {
System.out.println("Exception in getting allow_weak_crypto, " + "using default value " + exc.getMessage());
}
}
allowWeakCrypto = allowed;
}
use of org.neo4j.driver.v1.Config in project jdk8u_jdk by JetBrains.
the class ParseConfig method main.
public static void main(String[] args) throws Exception {
System.setProperty("java.security.krb5.conf", System.getProperty("test.src", ".") + "/krb5.conf");
Config config = Config.getInstance();
config.listTable();
String sample = "kdc.example.com kdc2.example.com";
for (int i = 0; i < 4; i++) {
String expected = config.getAll("realms", "EXAMPLE_" + i + ".COM", "kdc");
if (!sample.equals(expected)) {
throw new Exception("krb5.conf: unexpected kdc value \"" + expected + "\"");
}
}
// JDK-8055045: IOOBE when reading an empty value
config.get("empty1", "NOVAL.COM");
config.get("empty2", "NOVAL.COM");
config.get("quote1", "NOVAL.COM");
config.get("quote2", "NOVAL.COM");
}
use of org.neo4j.driver.v1.Config in project jdk8u_jdk by JetBrains.
the class DNS method main.
public static void main(String[] args) throws Exception {
System.setProperty("java.security.krb5.conf", System.getProperty("test.src", ".") + "/no-such-file.conf");
Config config = Config.getInstance();
try {
String r = config.getDefaultRealm();
throw new Exception("What? There is a default realm " + r + "?");
} catch (KrbException ke) {
ke.printStackTrace();
if (ke.getCause() != null) {
throw new Exception("There should be no cause. Won't try DNS");
}
}
String kdcs = config.getKDCList("X");
if (!kdcs.equals("a.com.:88 b.com.:99") && !kdcs.equals("a.com. b.com.:99")) {
throw new Exception("Strange KDC: [" + kdcs + "]");
}
;
}
Aggregations