public static void main(String args[]) {
        switch (args.length) {
        case 0:
            // Run tests normally.
            junit.textui.TestRunner.run(suite());
            break;
        case 2:
            // Run registry, test server or client process.
            int config = new Integer(args[1]).intValue();
            String param = args[0].intern();
            DGCTest dgcTest = new DGCTest();

            try {
                if (param == REGISTRY_ID) {
                    dgcTest.runRegistry(config);
                } else if (param == SERVER_ID_0) {
                    dgcTest.runTestServer0(config);
                } else if (param == CLIENT_ID_0) {
                    dgcTest.runTestClient0(config);
                } else if (param == SERVER_ID_3) {
                    dgcTest.runTestServer3(config);
                } else {
                    System.err.println("Bad parameter: " + param);
                    abort();
                }
            } catch (Exception e) {
                System.err.println("Child process ("
                        + param + ", " + config + ") failed: " + e);
                e.printStackTrace();
                abort();
            }
            System.err.println("Child process ("
                    + param + ", " + config + ") is terminating OK");
            break;
        default:
            System.err.println("Bad number of parameters: "
                    + args.length + ", expected: 2.");
            abort();
        }
    }