Package org.openide.util.RequestProcessor

Examples of org.openide.util.RequestProcessor.Task


    private void testReadPagePrefix(String encoding, int iterations) throws Exception {
        this.encoding = encoding;
        pis = new PipedInputStream();
        pos = new PipedOutputStream();
        pos.connect(pis);
        Task t = RequestProcessor.getDefault().post(this);
        Random r = new Random();
        int all = 0;
        for (int i = 0; i < iterations; i++) {
            int size = r.nextInt(100);
            String text = "";
            for (int j = 0; j < size; j++) {
                text = text.concat(hallo);
            }
            all += size * 10;
            pos.write(text.getBytes(encoding));
        }
        pos.close();
        t.waitFinished(10000);
        assertNotNull(result);
        int expected = Math.min(all, ReporterUtils.MAX_PREFIX_LEN);
        assertEquals(expected, result.length());
    }
View Full Code Here

TOP

Related Classes of org.openide.util.RequestProcessor.Task

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.