Skip to content

Commit

Permalink
fix failing tests with zulu jdk 7
Browse files Browse the repository at this point in the history
  • Loading branch information
ancho committed Oct 1, 2017
1 parent bcc8ba0 commit 69dfb52
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ configurations {
dependencies {
compile group: 'commons-io', name: 'commons-io', version: commonsIoVersion
compile group: 'commons-configuration', name: 'commons-configuration', version: commonsConfigurationVersion
compile group: 'org.apache.commons', name: 'commons-vfs2', version: commonsVfs2Version
compile(group: 'org.apache.commons', name: 'commons-vfs2', version: commonsVfs2Version) {
exclude group: "commons-logging", module: "commons-logging"
}
compile group: 'org.apache.commons', name: 'commons-lang3', version: commonsLangVersion
compile group: 'com.googlecode.json-simple', name: 'json-simple', version: jsonSimpleVersion
compile group: 'args4j', name: 'args4j', version: args4jVersion
Expand All @@ -87,7 +89,9 @@ dependencies {
compile group: 'org.slf4j', name: 'jul-to-slf4j', version: slf4jVersion
compile group: 'ch.qos.logback', name: 'logback-classic', version: logbackVersion
compile group: 'ch.qos.logback', name: 'logback-core', version: logbackVersion
compile group: 'de.neuland-bfi', name: 'jade4j', version: jade4jVersion
compile(group: 'de.neuland-bfi', name: 'jade4j', version: jade4jVersion) {
exclude group: "com.googlecode.concurrentlinkedhashmap", module: "concurrentlinkedhashmap-lru"
}
compile group: 'org.jsoup', name:'jsoup', version: jsoupVersion

dist group: 'org.asciidoctor', name: 'asciidoctorj-diagram', version: asciidoctorjDiagramVersion
Expand Down Expand Up @@ -115,7 +119,7 @@ dependencyUpdates.resolutionStrategy = {
}

test {
jvmArgs '-XX:MaxDirectMemorySize=512m', '-Dorientdb.installCustomFormatter=false=false'
jvmArgs '-Xmx512m', '-XX:MaxPermSize=512m', '-XX:MaxDirectMemorySize=128m', '-Dorientdb.installCustomFormatter=false=false'
}

task smokeTest(type: Test, dependsOn: installDist) {
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/org/jbake/app/ContentStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/
package org.jbake.app;

import com.orientechnologies.common.log.OLogManager;
import com.orientechnologies.orient.core.Orient;
import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal;
import com.orientechnologies.orient.core.db.OPartitionedDatabasePool;
Expand Down Expand Up @@ -58,16 +59,12 @@ public class ContentStore {

public ContentStore(final String type, String name) {
startupIfEnginesAreMissing();
db = new ODatabaseDocumentTx(type + ":" + name);
boolean exists = db.exists();
if (!exists) {
db.create();
}
db = new OPartitionedDatabasePoolFactory().get(type+":"+name, "admin", "admin").acquire();
OPartitionedDatabasePool pool = new OPartitionedDatabasePoolFactory().get(type+":"+name, "admin", "admin");
pool.setAutoCreate(true);
db = pool.acquire();

ODatabaseRecordThreadLocal.INSTANCE.set(db);
if (!exists) {
updateSchema();
}
updateSchema();
}

public long getStart() {
Expand All @@ -93,12 +90,13 @@ public void resetPagination() {

public final void updateSchema() {
OSchema schema = db.getMetadata().getSchema();

for (String docType : DocumentTypes.getDocumentTypes()) {
if (schema.getClass(docType) == null) {
if (!schema.existsClass(docType)) {
createDocType(schema, docType);
}
}
if (schema.getClass("Signatures") == null) {
if (!schema.existsClass("Signatures")) {
createSignatureType(schema);
}
}
Expand All @@ -115,9 +113,11 @@ public void shutdown() {
private void startupIfEnginesAreMissing() {
// If an instance of Orient was previously shutdown all engines are removed.
// We need to startup Orient again.
OLogManager.instance().setWarnEnabled(false);
if ( Orient.instance().getEngines().size() == 0 ) {
Orient.instance().startup();
}
OLogManager.instance().setWarnEnabled(true);
}

public void drop() {
Expand Down

0 comments on commit 69dfb52

Please sign in to comment.