Examples of LaunchConfiguration


Examples of org.apache.ace.processlauncher.LaunchConfiguration

        // This test will not work on Windows!
        if (getOSName().contains("windows")) {
            return;
        }

        LaunchConfiguration launchConfig = createLaunchConfiguration("/bin/sh", "-c", "sleep 10");

        int processCountBefore = m_processManager.getRunningProcessesCount();

        for (int i = 0; i < 5; i++) {
            m_processManager.launch(String.format("myPid%d", i), launchConfig);
View Full Code Here

Examples of org.apache.ace.processlauncher.LaunchConfiguration

        // This test will only work on Windows!
        if (!getOSName().contains("windows")) {
            return;
        }

        LaunchConfiguration launchConfig = createLaunchConfiguration("PING", "-n", "11", "127.0.0.1");

        int processCountBefore = m_processManager.getRunningProcessesCount();

        for (int i = 0; i < 5; i++) {
            m_processManager.launch(String.format("myPid%d", i), launchConfig);
View Full Code Here

Examples of org.apache.ace.processlauncher.LaunchConfiguration

        // This test will not work on Windows!
        if (getOSName().contains("windows")) {
            return;
        }

        LaunchConfiguration launchConfig = createLaunchConfiguration("/bin/sh", "-c", "sleep 10");

        int processCountBefore = m_processManager.getRunningProcessesCount();

        final String pid = "myPid";
        m_processManager.launch(pid, launchConfig);
View Full Code Here

Examples of org.apache.ace.processlauncher.LaunchConfiguration

        // This test will not work on Windows!
        if (!getOSName().contains("windows")) {
            return;
        }

        LaunchConfiguration launchConfig = createLaunchConfiguration("PING", "-n", "11", "127.0.0.1");

        int processCountBefore = m_processManager.getRunningProcessesCount();

        final String pid = "myPid";
        m_processManager.launch(pid, launchConfig);
View Full Code Here

Examples of org.apache.ace.processlauncher.LaunchConfiguration

     */
    public void testCreateLaunchConfigurationBasedOnPropertiesFileOk() throws Exception {
        Properties props = TestUtil.getProperties("launch.properties");
        assertNotNull(props);

        LaunchConfiguration config = LaunchConfigurationFactory.create(props);
        assertNotNull(config);

        assertEquals(2, config.getInstanceCount());
        assertEquals("/bin/sh", config.getExecutableName());
        assertArrayEquals(new String[] { "-c", "'sleep 1 && exit'", "-c", "'echo \"foo bar!\n\"'" },
            config.getExecutableArgs());
        assertNull(config.getProcessStreamListener());
    }
View Full Code Here

Examples of org.apache.ace.processlauncher.LaunchConfiguration

        props.put(LaunchConfigurationFactory.EXECUTABLE_ARGS, "");
        props.put(LaunchConfigurationFactory.PROCESS_STREAM_LISTENER_FILTER, "(foo=bar)");
        props.put(LaunchConfigurationFactory.RESPAWN_AUTOMATICALLY, "false");
        props.put(LaunchConfigurationFactory.NORMAL_EXIT_VALUE, "2");

        LaunchConfiguration config = LaunchConfigurationFactory.create(props);
        assertNotNull(config);

        assertEquals(1, config.getInstanceCount());
        assertEquals("/path/to/foo", config.getExecutableName());
        assertArrayEquals(new String[0], config.getExecutableArgs());
        assertEquals(2, config.getNormalExitValue());
        assertNotNull(config.getProcessStreamListener());
        assertFalse(config.isRespawnAutomatically());
    }
View Full Code Here

Examples of org.apache.ace.processlauncher.LaunchConfiguration

    /**
     * Test that creating a valid {@link LaunchConfigurationImpl} works.
     */
    public void testCreateLaunchConfigurationOk() {
        LaunchConfiguration launchConfig = new LaunchConfigurationImpl(1, "/path/to/foo", new String[0], null, false);
        assertNotNull(launchConfig);
    }
View Full Code Here

Examples of org.apache.ace.processlauncher.LaunchConfiguration

    /**
     * Test that the {@link LaunchConfigurationImpl#getCommandLine()} method works properly when one
     * executable arguments are given.
     */
    public void testGetCommandLineWithOneArgumentsOk() {
        LaunchConfiguration launchConfig =
            new LaunchConfigurationImpl(1, "/path/to/foo", new String[] { "-bar" }, null, false);

        String[] commandLine = launchConfig.getCommandLine();
        assertNotNull(commandLine);
        assertEquals(2, commandLine.length);

        assertEquals("/path/to/foo", commandLine[0]);
        assertEquals("-bar", commandLine[1]);
View Full Code Here

Examples of org.apache.ace.processlauncher.LaunchConfiguration

    /**
     * Test that the {@link LaunchConfigurationImpl#getCommandLine()} method works properly when no
     * executable arguments are given.
     */
    public void testGetCommandLineWithoutArgumentsOk() {
        LaunchConfiguration launchConfig =
            new LaunchConfigurationImpl(1, "cwd", "/path/to/foo", new String[0], 0, "(foo=bar)", "(qux=quu)", false);

        String[] commandLine = launchConfig.getCommandLine();
        assertNotNull(commandLine);
        assertEquals(1, commandLine.length);

        assertEquals("/path/to/foo", commandLine[0]);
        assertEquals("cwd", launchConfig.getWorkingDirectory().getName());
        assertNotNull(launchConfig.getProcessStreamListener());
        assertFalse(launchConfig.isRespawnAutomatically());
    }
View Full Code Here

Examples of org.apache.ace.processlauncher.LaunchConfiguration

    /**
     * Test that the {@link LaunchConfigurationImpl#getCommandLine()} method works properly when two
     * executable arguments are given.
     */
    public void testGetCommandLineWithTwoArgumentsOk() {
        LaunchConfiguration launchConfig =
            new LaunchConfigurationImpl(1, "/path/to/foo", new String[] { "-qux", "-bar" }, null, true);

        String[] commandLine = launchConfig.getCommandLine();
        assertNotNull(commandLine);
        assertEquals(3, commandLine.length);

        assertEquals("/path/to/foo", commandLine[0]);
        assertEquals("-qux", commandLine[1]);
        assertEquals("-bar", commandLine[2]);
        assertNull(launchConfig.getProcessStreamListener());
        assertTrue(launchConfig.isRespawnAutomatically());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.