use of org.structr.core.Services in project structr by structr.
the class StructrCsvModuleTest method startSystem.
@BeforeClass
public static void startSystem() {
final Date now = new Date();
final long timestamp = now.getTime();
basePath = "/tmp/structr-test-" + timestamp;
Settings.Services.setValue("NodeService LogService SchemaService");
Settings.ConnectionUrl.setValue(Settings.TestingConnectionUrl.getValue());
// example for new configuration setup
Settings.BasePath.setValue(basePath);
Settings.DatabasePath.setValue(basePath + "/db");
Settings.FilesPath.setValue(basePath + "/files");
Settings.RelationshipCacheSize.setValue(1000);
Settings.NodeCacheSize.setValue(1000);
Settings.SuperUserName.setValue("superadmin");
Settings.SuperUserPassword.setValue("sehrgeheim");
final Services services = Services.getInstance();
// wait for service layer to be initialized
do {
try {
Thread.sleep(100);
} catch (Throwable t) {
}
} while (!services.isInitialized());
securityContext = SecurityContext.getSuperUserInstance();
app = StructrApp.getInstance(securityContext);
}
use of org.structr.core.Services in project structr by structr.
the class StructrTest method startSystem.
@BeforeClass
public static void startSystem() {
final Date now = new Date();
final long timestamp = now.getTime();
basePath = "/tmp/structr-test-" + timestamp;
Settings.Services.setValue("NodeService LogService SchemaService");
Settings.ConnectionUrl.setValue(Settings.TestingConnectionUrl.getValue());
// example for new configuration setup
Settings.BasePath.setValue(basePath);
Settings.DatabasePath.setValue(basePath + "/db");
Settings.FilesPath.setValue(basePath + "/files");
Settings.RelationshipCacheSize.setValue(1000);
Settings.NodeCacheSize.setValue(1000);
Settings.SuperUserName.setValue("superadmin");
Settings.SuperUserPassword.setValue("sehrgeheim");
// Settings.CypherDebugLogging.setValue(true);
final Services services = Services.getInstance();
// wait for service layer to be initialized
do {
try {
Thread.sleep(100);
} catch (Throwable t) {
}
} while (!services.isInitialized());
securityContext = SecurityContext.getSuperUserInstance();
app = StructrApp.getInstance(securityContext);
}
use of org.structr.core.Services in project structr by structr.
the class PropertyViewRestTest method start.
public static void start(final Map<String, Object> additionalConfig) {
final Date now = new Date();
final long timestamp = now.getTime();
basePath = "/tmp/structr-test-" + timestamp;
// modify default date format
Settings.DefaultDateFormat.setValue("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
Settings.Services.setValue("NodeService LogService HttpService SchemaService");
Settings.ConnectionUrl.setValue(Settings.TestingConnectionUrl.getValue());
// example for new configuration setup
Settings.BasePath.setValue(basePath);
Settings.DatabasePath.setValue(basePath + "/db");
Settings.FilesPath.setValue(basePath + "/files");
Settings.RelationshipCacheSize.setValue(1000);
Settings.NodeCacheSize.setValue(1000);
Settings.SuperUserName.setValue("superadmin");
Settings.SuperUserPassword.setValue("sehrgeheim");
Settings.ApplicationTitle.setValue("structr unit test app" + timestamp);
Settings.ApplicationHost.setValue(host);
Settings.HttpPort.setValue(httpPort);
Settings.Servlets.setValue("JsonRestServlet");
Settings.RestAuthenticator.setValue(SuperUserAuthenticator.class.getName());
Settings.RestResourceProvider.setValue(DefaultResourceProvider.class.getName());
Settings.RestServletPath.setValue(restUrl);
Settings.RestUserClass.setValue("");
final Services services = Services.getInstance();
securityContext = SecurityContext.getSuperUserInstance();
app = StructrApp.getInstance(securityContext);
// wait for service layer to be initialized
do {
try {
Thread.sleep(100);
} catch (Throwable t) {
}
} while (!services.isInitialized());
}
use of org.structr.core.Services in project structr by structr.
the class StructrRestTest method start.
@BeforeClass
public static void start() {
final Date now = new Date();
final long timestamp = now.getTime();
basePath = "/tmp/structr-test-" + timestamp;
Settings.Services.setValue("NodeService LogService HttpService SchemaService");
Settings.ConnectionUrl.setValue(Settings.TestingConnectionUrl.getValue());
// example for new configuration setup
Settings.BasePath.setValue(basePath);
Settings.DatabasePath.setValue(basePath + "/db");
Settings.FilesPath.setValue(basePath + "/files");
Settings.RelationshipCacheSize.setValue(1000);
Settings.NodeCacheSize.setValue(1000);
Settings.SuperUserName.setValue("superadmin");
Settings.SuperUserPassword.setValue("sehrgeheim");
Settings.ApplicationTitle.setValue("structr unit test app" + timestamp);
Settings.ApplicationHost.setValue(host);
Settings.HttpPort.setValue(httpPort);
Settings.Servlets.setValue("JsonRestServlet");
Settings.RestAuthenticator.setValue(SuperUserAuthenticator.class.getName());
Settings.RestResourceProvider.setValue(DefaultResourceProvider.class.getName());
Settings.RestServletPath.setValue(restUrl);
Settings.RestUserClass.setValue("");
// Settings.LogSchemaOutput.setValue(true);
final Services services = Services.getInstance();
// wait for service layer to be initialized
do {
try {
Thread.sleep(100);
} catch (Throwable t) {
}
} while (!services.isInitialized());
securityContext = SecurityContext.getSuperUserInstance();
app = StructrApp.getInstance(securityContext);
// sleep again to wait for schema initialization
try {
Thread.sleep(2000);
} catch (Throwable t) {
}
}
use of org.structr.core.Services in project structr by structr.
the class StructrPaymentModuleTest method startSystem.
@BeforeClass
public static void startSystem() {
final Date now = new Date();
final long timestamp = now.getTime();
basePath = "/tmp/structr-test-" + timestamp;
Settings.Services.setValue("NodeService LogService SchemaService HttpService AgentService");
Settings.ConnectionUrl.setValue(Settings.TestingConnectionUrl.getValue());
// example for new configuration setup
Settings.BasePath.setValue(basePath);
Settings.DatabasePath.setValue(basePath + "/db");
Settings.FilesPath.setValue(basePath + "/files");
Settings.RelationshipCacheSize.setValue(1000);
Settings.NodeCacheSize.setValue(1000);
Settings.SuperUserName.setValue("superadmin");
Settings.SuperUserPassword.setValue("sehrgeheim");
Settings.ApplicationTitle.setValue("structr unit test app" + timestamp);
Settings.ApplicationHost.setValue(host);
Settings.HttpPort.setValue(httpPort);
Settings.Servlets.setValue("JsonRestServlet");
// Settings.LogSchemaOutput.setValue(true);
final Services services = Services.getInstance();
// wait for service layer to be initialized
do {
try {
Thread.sleep(100);
} catch (Throwable t) {
}
} while (!services.isInitialized());
securityContext = SecurityContext.getSuperUserInstance();
app = StructrApp.getInstance(securityContext);
}
Aggregations