当前位置: 首页>>代码示例>>Java>>正文


Java ProcessCommunicator.executeChildProcess方法代码示例

本文整理汇总了Java中test.java.awt.regtesthelpers.process.ProcessCommunicator.executeChildProcess方法的典型用法代码示例。如果您正苦于以下问题:Java ProcessCommunicator.executeChildProcess方法的具体用法?Java ProcessCommunicator.executeChildProcess怎么用?Java ProcessCommunicator.executeChildProcess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在test.java.awt.regtesthelpers.process.ProcessCommunicator的用法示例。


在下文中一共展示了ProcessCommunicator.executeChildProcess方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入方法依赖的package包/类
public void start() {

        SourceFrame sourceFrame = new SourceFrame();

        Util.waitForIdle(null);

        String [] args = new String [] {
            String.valueOf(sourceFrame.getNextLocationX()),
            String.valueOf(sourceFrame.getNextLocationY()),
            String.valueOf(sourceFrame.getDragSourcePointX()),
            String.valueOf(sourceFrame.getDragSourcePointY()),
        };
        String classpath = System.getProperty("java.class.path");
        ProcessResults processResults =
            ProcessCommunicator.executeChildProcess(this.getClass(),classpath,args);

        verifyTestResults(processResults);

    }
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:20,代码来源:DragInterceptorAppletTest.java

示例2: start

import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入方法依赖的package包/类
public void start() {

        SourceFileListFrame sourceFrame = new SourceFileListFrame();

        Util.waitForIdle(null);

        String [] args = new String [] {
                String.valueOf(sourceFrame.getNextLocationX()),
                String.valueOf(sourceFrame.getNextLocationY()),
                String.valueOf(sourceFrame.getDragSourcePointX()),
                String.valueOf(sourceFrame.getDragSourcePointY()),
                String.valueOf(sourceFrame.getSourceFilesNumber())
        };

        ProcessResults processResults =
                ProcessCommunicator.executeChildProcess(this.getClass(), args);

        verifyTestResults(processResults);

    }
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:21,代码来源:FileListBetweenJVMsTest.java

示例3: start

import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入方法依赖的package包/类
public void start() {

    String toolkit = Toolkit.getDefaultToolkit().getClass().getName();
    if (toolkit.equals("sun.awt.windows.WToolkit")){
        System.out.println("This test is not for the Windows platform. Passed.");
        return;
    } else {
        System.out.println("Toolkit = " + toolkit);
    }

        SourceFileListFrame sourceFrame = new SourceFileListFrame();

        Util.waitForIdle(null);

        String [] args = new String [] {
                String.valueOf(sourceFrame.getNextLocationX()),
                String.valueOf(sourceFrame.getNextLocationY()),
                String.valueOf(sourceFrame.getDragSourcePointX()),
                String.valueOf(sourceFrame.getDragSourcePointY()),
                String.valueOf(sourceFrame.getSourceFilesNumber())
        };

        String classpath = System.getProperty("java.class.path");
        ProcessResults processResults =
                ProcessCommunicator.executeChildProcess(this.getClass(), classpath, args);

        verifyTestResults(processResults);

    }
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:30,代码来源:URIListBetweenJVMsTest.java

示例4: addTrayIcon

import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入方法依赖的package包/类
void addTrayIcon() throws Exception {

        SystemTray tray = SystemTray.getSystemTray();
        TrayIcon icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB));
        tray.add(icon);

        new Robot().delay(2000);

        ProcessResults processResults =
                ProcessCommunicator.executeChildProcess(this.getClass(), new String[]{NEW_JVM});

        if (processResults.getExitValue() != 0)
            throw new RuntimeException("\n"+processResults.getStdErr());
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:InterJVM.java

示例5: main

import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入方法依赖的package包/类
public static void main(String[] args) {
    final AtomicBoolean passed = new AtomicBoolean(false);
    new Thread(() -> {
        for (int trial = 0; trial < 5; ++trial) {
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                throw new RuntimeException("Test FAILED!", e);
            }
            if (passed.get()) {
                break;
            } else if (trial == 4) {
                throw new RuntimeException("Child process never exits");
            }
        }
    }, "TimeoutThread").start();

    String classpath = System.getProperty("java.class.path");
    String policyPath = System.getProperty("test.src")+File.separatorChar+"policy";
    System.out.println("policyPath in main: "+policyPath);
    ProcessResults pres = ProcessCommunicator.executeChildProcess(TestApplication.class, classpath+" -Djava.security.manager -Djava.security.policy="+policyPath, new String[0]);
    passed.set(true);
    if (pres.getStdErr() != null && pres.getStdErr().length() > 0) {
        System.err.println("========= Child VM System.err ========");
        System.err.print(pres.getStdErr());
        System.err.println("======================================");
    }

    if (pres.getStdOut() != null && pres.getStdOut().length() > 0) {
        System.err.println("========= Child VM System.out ========");
        System.err.print(pres.getStdOut());
        System.err.println("======================================");
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:35,代码来源:WarningWindowDisposeTest.java

示例6: main

import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    Producer contents = new Producer();
    clipboard.setContents(contents, null);
    ProcessResults processResults =
            ProcessCommunicator
                    .executeChildProcess(Consumer.class, new String[0]);
    if (!"Hello".equals(processResults.getStdErr())) {
        throw new RuntimeException("transfer of remote object failed");
    }
    System.out.println("ok");
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:DataFlavorRemoteTest.java

示例7: main

import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入方法依赖的package包/类
public static void main(String[] args) {
    final AtomicBoolean passed = new AtomicBoolean(false);
    new Thread(() -> {
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            throw new RuntimeException("Test FAILED!", e);
        }
        if (!passed.get()) {
            throw new RuntimeException("Test FAILED! The child process never exits");
        }
    }, "TimeoutThread").start();

    String classpath = System.getProperty("java.class.path");
    String policyPath = System.getProperty("test.src")+File.separatorChar+"policy";
    System.out.println("policyPath in main: "+policyPath);
    ProcessResults pres = ProcessCommunicator.executeChildProcess(TestApplication.class, classpath+" -Djava.security.manager -Djava.security.policy="+policyPath, new String[0]);
    passed.set(true);
    if (pres.getStdErr() != null && pres.getStdErr().length() > 0) {
        System.err.println("========= Child VM System.err ========");
        System.err.print(pres.getStdErr());
        System.err.println("======================================");
    }

    if (pres.getStdOut() != null && pres.getStdOut().length() > 0) {
        System.err.println("========= Child VM System.out ========");
        System.err.print(pres.getStdOut());
        System.err.println("======================================");
    }
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:31,代码来源:WarningWindowDisposeTest.java

示例8: start

import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入方法依赖的package包/类
public void start() {

        String toolkit = Toolkit.getDefaultToolkit().getClass().getName();
        if (!toolkit.equals("sun.awt.windows.WToolkit")){
            System.out.println("This test is for Windows only. Passed.");
            return;
        }
        else{
            System.out.println("Toolkit = " + toolkit);
        }

        final Frame sourceFrame = new Frame("Source frame");
        final SourcePanel sourcePanel = new SourcePanel();
        sourceFrame.add(sourcePanel);
        sourceFrame.pack();
        sourceFrame.addWindowListener( new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                sourceFrame.dispose();
            }
        });
        sourceFrame.setVisible(true);

        Util.waitForIdle(null);

        NextFramePositionCalculator positionCalculator = new NextFramePositionCalculator(sourceFrame);

        String [] args = new String [] {
                String.valueOf(positionCalculator.getNextLocationX()),
                String.valueOf(positionCalculator.getNextLocationY()),
                String.valueOf(AbsoluteComponentCenterCalculator.calculateXCenterCoordinate(sourcePanel)),
                String.valueOf(AbsoluteComponentCenterCalculator.calculateYCenterCoordinate(sourcePanel)),
        };


       ProcessResults processResults =
                // ProcessCommunicator.executeChildProcess(this.getClass()," -cp \"C:\\Documents and Settings\\df153228\\IdeaProjects\\UnicodeTestDebug\\out\\production\\UnicodeTestDebug\" -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 ", args);
                ProcessCommunicator.executeChildProcess(this.getClass(), args);

        verifyTestResults(processResults);

    }
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:43,代码来源:DragUnicodeBetweenJVMTest.java

示例9: main

import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入方法依赖的package包/类
public static void main(String[] arg) throws Exception {
    ImageDragSource ids = new ImageDragSource();
    ids.frame.setLocation(100, 100);
    ids.frame.setVisible(true);
    Util.sync();
    String classpath = System.getProperty("java.class.path");
    String[] args = new String[ids.formats.length + 4];
    args[0] = "200";
    args[1] = "100";
    args[2] = args[3] = "150";

    System.arraycopy(ids.formats, 0, args, 4, ids.formats.length);
    ProcessResults pres = ProcessCommunicator.executeChildProcess(ImageDropTarget.class, classpath, args);

    if (pres.getStdErr() != null && pres.getStdErr().length() > 0) {
        System.err.println("========= Child VM System.err ========");
        System.err.print(pres.getStdErr());
        System.err.println("======================================");
    }

    if (pres.getStdOut() != null && pres.getStdOut().length() > 0) {
        System.err.println("========= Child VM System.out ========");
        System.err.print(pres.getStdOut());
        System.err.println("======================================");
    }

    boolean failed = false;
    String passedFormats = "";
    String failedFormats = "";

    for (int i = 0; i < ids.passedArray.length; i++) {
        if (ids.passedArray[i]) passedFormats += ids.formats[i] + " ";
        else {
            failed = true;
            failedFormats += ids.formats[i] + " ";
        }
    }

    if (failed) {
        throw new RuntimeException("test failed: images in following " +
                "native formats are not transferred properly: " + failedFormats);
    } else {
        System.err.println("images in following " +
                "native formats are transferred properly: " + passedFormats);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:47,代码来源:ImageTransferTest.java

示例10: start

import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入方法依赖的package包/类
public void start() {

        SourceFileListFrame sourceFrame = new SourceFileListFrame();

        Util.waitForIdle(null);

        String [] args = new String [] {
                String.valueOf(sourceFrame.getNextLocationX()),
                String.valueOf(sourceFrame.getNextLocationY()),
                String.valueOf(sourceFrame.getDragSourcePointX()),
                String.valueOf(sourceFrame.getDragSourcePointY()),
                String.valueOf(sourceFrame.getSourceFilesNumber())
        };

        ProcessResults processResults = ProcessCommunicator.executeChildProcess(this.getClass(), args);

        verifyTestResults(processResults);

    }
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:20,代码来源:URIListToFileListBetweenJVMsTest.java

示例11: start

import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入方法依赖的package包/类
public void start() {
    if (OSInfo.getOSType() != OSInfo.OSType.MACOSX
            && OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
        System.out.println("This test is for Windows and Mac only. Passed.");
        return;
    }

    final Frame sourceFrame = new Frame("Source frame");
    final SourcePanel sourcePanel = new SourcePanel();
    sourceFrame.add(sourcePanel);
    sourceFrame.pack();
    sourceFrame.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            sourceFrame.dispose();
        }
    });
    sourceFrame.setVisible(true);

    Util.waitForIdle(null);

    NextFramePositionCalculator positionCalculator = new NextFramePositionCalculator(sourceFrame);

    ArrayList<String> args = new ArrayList<String>(5);
    args.add(String.valueOf(positionCalculator.getNextLocationX()));
    args.add(String.valueOf(positionCalculator.getNextLocationY()));
    args.add(String.valueOf(AbsoluteComponentCenterCalculator.calculateXCenterCoordinate(sourcePanel)));
    args.add(String.valueOf(AbsoluteComponentCenterCalculator.calculateYCenterCoordinate(sourcePanel)));
    args.add(concatStrings(DataFlavorSearcher.RICH_TEXT_NAMES));

    ProcessResults processResults =
            ProcessCommunicator.executeChildProcess(this.getClass(),
                    "." + File.separator + System.getProperty("java.class.path"), args.toArray(new String[]{}));

    verifyTestResults(processResults);

    args.set(args.size() - 1, concatStrings(DataFlavorSearcher.HTML_NAMES));

    ProcessCommunicator.executeChildProcess(this.getClass(),
            "." + File.separator + System.getProperty("java.class.path"), args.toArray(new String[]{}));
    verifyTestResults(processResults);


}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:45,代码来源:MissedHtmlAndRtfBug.java

示例12: main

import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    Util.setClipboardContents(clipboard, t, null);
    ProcessResults result = ProcessCommunicator.executeChildProcess(
            UnicodeTransferTestChild.class, new String[0]);
    verifyTestResults(result);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:7,代码来源:UnicodeTransferTest.java

示例13: start

import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入方法依赖的package包/类
public void start() {
        if (OSInfo.getOSType() != OSInfo.OSType.MACOSX
                && OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
            System.out.println("This test is for Windows and Mac only. Passed.");
            return;
        }

        final Frame sourceFrame = new Frame("Source frame");
        final SourcePanel sourcePanel = new SourcePanel();
        sourceFrame.add(sourcePanel);
        sourceFrame.pack();
        sourceFrame.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                sourceFrame.dispose();
            }
        });
        sourceFrame.setVisible(true);

        Util.waitForIdle(null);

        NextFramePositionCalculator positionCalculator = new NextFramePositionCalculator(sourceFrame);

        ArrayList<String> args = new ArrayList<String>(5);
        args.add(String.valueOf(positionCalculator.getNextLocationX()));
        args.add(String.valueOf(positionCalculator.getNextLocationY()));
        args.add(String.valueOf(AbsoluteComponentCenterCalculator.calculateXCenterCoordinate(sourcePanel)));
        args.add(String.valueOf(AbsoluteComponentCenterCalculator.calculateYCenterCoordinate(sourcePanel)));
        args.add(concatStrings(DataFlavorSearcher.RICH_TEXT_NAMES));

        ProcessResults processResults =
//                ProcessCommunicator.executeChildProcess(this.getClass(), "/Users/mcherkasov/ws/clipboard/DataFlover/out/production/DataFlover" +
//                        " -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 ",
//                        args.toArray(new String[0]));
                ProcessCommunicator.executeChildProcess(this.getClass(),
                        "." + File.separator + System.getProperty("java.class.path"), args.toArray(new String[]{}));

        verifyTestResults(processResults);

        args.set(args.size() - 1, concatStrings(DataFlavorSearcher.HTML_NAMES));

        ProcessCommunicator.executeChildProcess(this.getClass(),
                "." + File.separator + System.getProperty("java.class.path"), args.toArray(new String[]{}));
        verifyTestResults(processResults);


    }
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:48,代码来源:MissedHtmlAndRtfBug.java


注:本文中的test.java.awt.regtesthelpers.process.ProcessCommunicator.executeChildProcess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。