Search in sources :

Example 6 with NetworkServerTestSetup

use of org.apache.derbyTesting.junit.NetworkServerTestSetup in project derby by apache.

the class ServerPropertiesTest method decorateTest.

/**
 * <p>
 * Compose the required decorators to bring up the server in the correct
 * configuration.
 * </p>
 */
private static Test decorateTest(String testName, String[] startupProperties, String[] startupArgs, boolean startServer) {
    ServerPropertiesTest spt = new ServerPropertiesTest(testName);
    String[] startupProps;
    if (startupProperties == null)
        startupProps = new String[] {};
    else
        startupProps = startupProperties;
    if (startupArgs == null)
        startupArgs = new String[] {};
    NetworkServerTestSetup networkServerTestSetup;
    if (startServer) {
        // start networkServer as a process
        networkServerTestSetup = new NetworkServerTestSetup(spt, startupProps, startupArgs, true);
    } else {
        // get networkserver setup but don't start anything
        networkServerTestSetup = new NetworkServerTestSetup(spt, true, false);
    }
    Test test = decorateWithPolicy(networkServerTestSetup);
    test = TestConfiguration.defaultServerDecorator(test);
    return test;
}
Also used : Test(junit.framework.Test) NetworkServerTestSetup(org.apache.derbyTesting.junit.NetworkServerTestSetup)

Aggregations

NetworkServerTestSetup (org.apache.derbyTesting.junit.NetworkServerTestSetup)6 Test (junit.framework.Test)5 BaseTestSuite (org.apache.derbyTesting.junit.BaseTestSuite)3 SupportFilesSetup (org.apache.derbyTesting.junit.SupportFilesSetup)3 SystemPropertyTestSetup (org.apache.derbyTesting.junit.SystemPropertyTestSetup)2 File (java.io.File)1 Properties (java.util.Properties)1 JDBCClientSetup (org.apache.derbyTesting.junit.JDBCClientSetup)1