Package org.geotools.swing.dialog.JTextReporter

Examples of org.geotools.swing.dialog.JTextReporter.Connection


        windowFixture.textBox().requireText(TEXT[0]);
    }
       
    @Test
    public void connectionObjectIsReturned() throws Exception {
        Connection conn = null;
        try {
            conn = showDialog(TITLE).get(DISPLAY_TIMEOUT, TimeUnit.MILLISECONDS);
        } catch (TimeoutException ex) {
            fail("connection object not returned");
        }
View Full Code Here


        assertNotNull(conn);
    }
   
    @Test
    public void appendText() throws Exception {
        Connection conn = showDialog(TITLE).get();
       
        conn.append(TEXT[0]);
        windowFixture.robot.waitForIdle();
       
        windowFixture.textBox().requireText(TEXT[0]);
    }
View Full Code Here

    @Test
    public void appendTextWithFormattedNewlines() throws Exception {
        final String text = getConcatenatedText(String.format("%n"));
       
        Connection conn = showDialog(TITLE).get();
        conn.append(text);

        windowFixture.robot.waitForIdle();
        String displayedText = windowFixture.textBox().text();
       
        assertEquals(text, displayedText);
View Full Code Here

   
    @Test
    public void appendTextWithEmbeddedNewlines() throws Exception {
        final String text = getConcatenatedText("\n");
       
        Connection conn = showDialog(TITLE).get();
        conn.append(text);

        windowFixture.robot.waitForIdle();
        String displayedText = windowFixture.textBox().text();
       
        String regex = "(\\n|\\r)+";
View Full Code Here

        assertEquals(text.replaceAll(regex, "|"), displayedText.replaceAll(regex, "|"));
    }
   
    @Test
    public void appendNewline() throws Exception {
        Connection conn = showDialog(TITLE, TEXT[0]).get();
       
        conn.appendNewline();
        conn.appendNewline();
        conn.append(TEXT[1]);
        conn.appendNewline();
       
        windowFixture.robot.waitForIdle();
        String displayedText = windowFixture.textBox().text();
        String expectedText = String.format("%s%n%n%s%n", TEXT[0], TEXT[1]);
        assertEquals(expectedText, displayedText);
View Full Code Here

        assertEquals(expectedText, displayedText);
    }
   
    @Test
    public void appendDefaultSeparatorLine() throws Exception {
        Connection conn = showDialog(TITLE, TEXT[0] + "\n").get();
       
        final int N = 10;
        conn.appendSeparatorLine(N);
       
        char[] chars = new char[N];
        Arrays.fill(chars, JTextReporter.DEFAULT_SEPARATOR_CHAR);
        String expected = String.format("%s%n%s%n", TEXT[0], String.valueOf(chars));
       
View Full Code Here

        assertEquals(expected, displayedText);
    }
   
    @Test
    public void appendCustomSeparatorLine() throws Exception {
        Connection conn = showDialog(TITLE, TEXT[0] + "\n").get();
       
        final int N = 10;
        final char c = '#';
        conn.appendSeparatorLine(N, c);
       
        char[] chars = new char[N];
        Arrays.fill(chars, c);
        String expected = String.format("%s%n%s%n", TEXT[0], String.valueOf(chars));
       
View Full Code Here

        assertEquals(expected, displayedText);
    }
   
    @Test
    public void appendMethodsCanBeChained() throws Exception {
        Connection conn = showDialog(TITLE).get();
       
        conn.append(TEXT[0]).appendNewline().append(TEXT[1]);
        windowFixture.robot.waitForIdle();
       
        String actual = windowFixture.textBox().text();
        String expected = String.format("%s%n%s", TEXT[0], TEXT[1]);
        assertEquals(expected, actual);
View Full Code Here

        assertEquals(expected, actual);
    }
   
    @Test
    public void appendAfterDialogDismissedCausesLoggerMessage() throws Exception {
        Connection conn = showDialog(TITLE).get();
        windowFixture.close();
        windowFixture.robot.waitForIdle();
       
        captureLogger();
        conn.append("This should not work");

        assertLogMessage(Level.SEVERE.toString());
        assertLogMessage("appending text to an expired JTextReporter connection");
       
        releaseLogger();
View Full Code Here

    }
   
    @Test
    public void getTextFromConnection() throws Exception {
        final String text = getConcatenatedText(String.format("%n"));
        Connection conn = showDialog(TITLE, text).get();
        assertEquals(text, conn.getText());
    }
View Full Code Here

TOP

Related Classes of org.geotools.swing.dialog.JTextReporter.Connection

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.