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


Java ProcessCommunicator类代码示例

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


ProcessCommunicator类属于test.java.awt.regtesthelpers.process包,在下文中一共展示了ProcessCommunicator类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: DragInterceptorAppletTest

import test.java.awt.regtesthelpers.process.ProcessCommunicator; //导入依赖的package包/类
public DragInterceptorAppletTest(Point targetFrameLocation, Point dragSourcePoint)
        throws InterruptedException
{
    DragInterceptorFrame targetFrame = new DragInterceptorFrame(targetFrameLocation);

    Util.waitForIdle(null);

    final Robot robot = Util.createRobot();

    robot.mouseMove((int)dragSourcePoint.getX(),(int)dragSourcePoint.getY());
    sleep(100);
    robot.mousePress(InputEvent.BUTTON1_MASK);
    sleep(100);
    robot.mouseRelease(InputEvent.BUTTON1_MASK);
    sleep(100);

    Util.drag(robot, dragSourcePoint, targetFrame.getDropTargetPoint(),
            InputEvent.BUTTON1_MASK);

    sleep(2000);
    ProcessCommunicator.destroyProcess();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:23,代码来源:DragInterceptorAppletTest.java

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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


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