Package org.apache.derbyTesting.junit

Examples of org.apache.derbyTesting.junit.SpawnedProcess$StreamSaver


                    cmd.toArray(new String[cmd.size()]), null);
        } catch (IOException ioe) {
            return "shutdown process failed to start: " + ioe.getMessage();
        }

        SpawnedProcess spawnedShutdown =
                new SpawnedProcess(proc, "shutdown process");
        int exitCode = -1;
        try {
            exitCode = spawnedShutdown.complete(10*1000L);
        catch (IOException ioe) {
            fail(spawnedShutdown.getFailMessage("shutdown process failed"));
        }
        if (exitCode == 0) {
            return null;
        } else {
            return spawnedShutdown.getFailMessage("abnormal process exit");
        }
    }
View Full Code Here


    public void spawnProcess() throws Exception {
        if (TestConfiguration.isDefaultBasePort()) {
            String[] cmd = {
                    "junit.textui.TestRunner", spawnedTestClass.getName()
                           };
            SpawnedProcess proc = new SpawnedProcess
                    (execJavaCmd(cmd), spawnedTestClass.getName());
            if (proc.complete() != 0) {
                fail(proc.getFailMessage("Test process failed"));
            }
        }
        else
        {
            // if we're not using the default port of 1527, ensure we're
            // passing on the baseport value to the spawned process.
            String[] cmd = {
                    "-Dderby.tests.basePort=" + TestConfiguration.getBasePort(),
                    "junit.textui.TestRunner", spawnedTestClass.getName()
            };           
            SpawnedProcess proc = new SpawnedProcess
                    (execJavaCmd(cmd), spawnedTestClass.getName());
            if (proc.complete() != 0) {
                fail(proc.getFailMessage("Test process failed"));
            }
        }
    }
View Full Code Here

        String[] cmd = (String[]) cmdList.toArray(commandSpecifics);

        Process serverProcess = execJavaCmd(cmd);
       
        SpawnedProcess spawned = new SpawnedProcess(serverProcess,
                cmdList.toString());
       
        // Ensure it completes without failures.
        assertEquals(0, spawned.complete());
       
        return spawned.getFullServerOutput();
    }
View Full Code Here

        println( "Server command is " + command );

        Process     process = Runtime.getRuntime().exec( command );
       
        SpawnedProcess spawned = new SpawnedProcess( process, "UnbootedTest" );
       
        // Ensure it completes without failures.
        assertEquals(0, spawned.complete(false));

        assertEquals( SUCCESS, spawned.getFullServerOutput() );
    }
View Full Code Here

        println( "Server command is " + command );

        Process     process = Runtime.getRuntime().exec( command );
       
        SpawnedProcess spawned = new SpawnedProcess( process, "UnbootedTest" );
       
        // Ensure it completes without failures.
        assertEquals(0, spawned.complete());

        assertEquals( SUCCESS, spawned.getFullServerOutput() );
    }
View Full Code Here

                     return result;
                 }
             }
            );
       
        SpawnedProcess spawned = new SpawnedProcess(serverProcess,
                commandSpecifics);
       
        // Ensure it completes without failures.
        assertEquals(0, spawned.complete(false));
       
        return spawned.getFullServerOutput();
    }
View Full Code Here

                     return result;
                 }
             }
            );
       
        SpawnedProcess spawned = new SpawnedProcess(serverProcess,
                commandSpecifics);
       
        // Ensure it completes without failures.
        assertEquals(0, spawned.complete(false));
       
        return spawned.getFullServerOutput();
    }
View Full Code Here

        String[] cmd = (String[]) cmdList.toArray(commandSpecifics);

        Process serverProcess = execJavaCmd(cmd);
       
        SpawnedProcess spawned = new SpawnedProcess(serverProcess,
                cmdList.toString());
       
        // Ensure it completes without failures.
        assertEquals(0, spawned.complete());
       
        return spawned.getFullServerOutput();
    }
View Full Code Here

            getClass().getName()
        };

        Process process = execJavaCmd(command);
       
        SpawnedProcess spawned = new SpawnedProcess( process, "UnbootedTest" );
       
        // Ensure it completes without failures.
        assertEquals(0, spawned.complete());

        assertEquals( SUCCESS, spawned.getFullServerOutput() );
    }
View Full Code Here

     * been called previously in the same JVM process. Spawn a new process to
     * satisfy those requirements.
     */
    public void testLeak() throws IOException {
        String[] cmd = {"-Xmx16M", getClass().getName()};
        SpawnedProcess sp = new SpawnedProcess(execJavaCmd(cmd), "DERBY-5730");
        if (sp.complete() != 0) {
            fail(sp.getFailMessage("Process failed"));
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.derbyTesting.junit.SpawnedProcess$StreamSaver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.