Search in sources :

Example 1 with Services

use of org.structr.core.Services in project structr by structr.

the class StructrLDAPClientModuleTest 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 LDAPService");
    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);
}
Also used : Services(org.structr.core.Services) Date(java.util.Date) BeforeClass(org.junit.BeforeClass)

Example 2 with Services

use of org.structr.core.Services in project structr by structr.

the class StructrMessagingEngineModuleTest 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");
    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);
}
Also used : Services(org.structr.core.Services)

Example 3 with Services

use of org.structr.core.Services in project structr by structr.

the class StructrLDAPServerModuleTest 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 LDAPServerService");
    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);
}
Also used : Services(org.structr.core.Services) Date(java.util.Date) BeforeClass(org.junit.BeforeClass)

Example 4 with Services

use of org.structr.core.Services in project structr by structr.

the class StructrMediaModuleTest 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);
}
Also used : Services(org.structr.core.Services) Date(java.util.Date) BeforeClass(org.junit.BeforeClass)

Example 5 with Services

use of org.structr.core.Services in project structr by structr.

the class GeoTest method startSystem.

public static void startSystem(final Map<String, Object> additionalConfig) {
    final Date now = new Date();
    final long timestamp = now.getTime();
    basePath = "/tmp/structr-test-" + timestamp;
    Settings.Services.setValue("NodeService 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.Servlets.setValue("JsonRestServlet WebSocketServlet HtmlServlet");
    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);
}
Also used : Services(org.structr.core.Services) Date(java.util.Date)

Aggregations

Services (org.structr.core.Services)30 BeforeClass (org.junit.BeforeClass)21 Date (java.util.Date)20 SuperUserAuthenticator (org.structr.core.auth.SuperUserAuthenticator)5 DefaultResourceProvider (org.structr.rest.DefaultResourceProvider)5 GraphDatabaseCommand (org.structr.core.graph.GraphDatabaseCommand)4 Tx (org.structr.core.graph.Tx)2 IOException (java.io.IOException)1 Method (java.lang.reflect.Method)1 HttpSession (javax.servlet.http.HttpSession)1 Task (org.structr.agent.Task)1 SettingsGroup (org.structr.api.config.SettingsGroup)1 Service (org.structr.api.service.Service)1 StructrServices (org.structr.api.service.StructrServices)1 Attr (org.structr.api.util.html.Attr)1 Document (org.structr.api.util.html.Document)1 Tag (org.structr.api.util.html.Tag)1 SecurityContext (org.structr.common.SecurityContext)1 DatabaseServiceNotAvailableException (org.structr.common.error.DatabaseServiceNotAvailableException)1 FrameworkException (org.structr.common.error.FrameworkException)1