Examples of PrintStream


Examples of java.io.PrintStream

        stat.execute("create index idx_e_id on e(id)");
        conn.close();

        Recover rec = new Recover();
        ByteArrayOutputStream buff = new ByteArrayOutputStream();
        rec.setOut(new PrintStream(buff));
        rec.runTool("-dir", getBaseDir(), "-db", "recovery", "-trace");
        String out = new String(buff.toByteArray());
        assertTrue(out.indexOf("Created file") >= 0);

        Connection conn2 = getConnection("recovery2");
View Full Code Here

Examples of java.io.PrintStream

    public void send(MailMessage mailMessage) throws MessagingException {
        Properties props = (Properties) System.getProperties().clone();
        props.put("mail.smtp.host", smtp);
        LogOutputStream logStream = new LogOutputStream(log, LogOutputStream.LEVEL_DEBUG);
        PrintStream debugOut = new PrintStream(logStream, true);

        Session session = Session.getDefaultInstance(props);
        session.setDebug(true);
        session.setDebugOut(debugOut);
View Full Code Here

Examples of java.io.PrintStream

     * @param defaultPrintStream if not null, this utility will always write to this stream. Typically this is System.out
     * @return the single PrintStream that wraps all the input streams for writing and comparison.
     * @since 4.2
     */
    public static PrintStream getPrintStream(OutputStream resultsOutput, BufferedReader expectedResultsInput, PrintStream defaultPrintStream) {
        PrintStream out = null;
        if (defaultPrintStream == null) {
            defaultPrintStream = new PrintStream(new OutputStream () {
                                                     public void write(int b) throws IOException {}
                                                 });
        }
        if (resultsOutput == null && expectedResultsInput == null) {
            out = defaultPrintStream;
        } else if (resultsOutput == null && expectedResultsInput != null) {
            out = new ComparingPrintStream(defaultPrintStream, expectedResultsInput);
        } else if (resultsOutput!= null && expectedResultsInput == null) {
            PrintStream filePrintStream = new PrintStream(resultsOutput);
            out = new MuxingPrintStream(new PrintStream[] {defaultPrintStream, filePrintStream});
        } else {
            PrintStream filePrintStream = new PrintStream(resultsOutput);
            out = new ComparingPrintStream(new MuxingPrintStream(new PrintStream[] {defaultPrintStream, filePrintStream}), expectedResultsInput);
        }
        return out;
    }
View Full Code Here

Examples of java.io.PrintStream

     * @param defaultPrintStream the default stream to which to write the results. Can be null.
     * @return The List of line numbers which differ between the actual and expected results.
     * @since 4.3
     */
    public static List writeAndCompareUpdateCount(int updateCount, OutputStream resultsOutput, BufferedReader expectedResultsInput, PrintStream defaultPrintStream) {
        PrintStream out = getPrintStream(resultsOutput, expectedResultsInput, defaultPrintStream);
        printUpdateCount(updateCount, out);
        return getUnequalLines(out);
    }
View Full Code Here

Examples of java.io.PrintStream

     * @param defaultPrintStream the default stream to which to write the results. Can be null.
     * @return The List of line numbers which differ between the actual and expected results.
     * @since 4.3
     */
    public static List writeAndCompareBatchedUpdateCounts(int[] counts, OutputStream resultsOutput, BufferedReader expectedResultsInput, PrintStream defaultPrintStream) {
        PrintStream out = getPrintStream(resultsOutput, expectedResultsInput, defaultPrintStream);
        printBatchedUpdateCounts(counts, out);
        return getUnequalLines(out);
    }
View Full Code Here

Examples of java.io.PrintStream

     * @return The List of line numbers which differ between the actual and expected results.
     * @throws SQLException
     * @since 4.3
     */
    public static List writeAndCompareResultSet(ResultSet rs, int maxColWidth, boolean printMetadata, OutputStream resultsOutput, BufferedReader expectedResultsInput, PrintStream defaultPrintStream) throws SQLException {
        PrintStream out = getPrintStream(resultsOutput, expectedResultsInput, defaultPrintStream);
        printResultSet(rs, maxColWidth, printMetadata, out);
        return getUnequalLines(out);
    }
View Full Code Here

Examples of java.io.PrintStream

        }
        return writeAndCompareThrowable(t, resultsOutputStream, expectedResultsReader, printToConsole ? System.out : null);
    }
   
    public static List writeAndCompareThrowable(Throwable t, OutputStream resultsOutput, BufferedReader expectedResultsInput, PrintStream defaultPrintStream) throws SQLException {
        PrintStream out = getPrintStream(resultsOutput, expectedResultsInput, defaultPrintStream);
        printThrowable(t, out);
        return getUnequalLines(out);
    }
View Full Code Here

Examples of java.io.PrintStream

        BufferedReader expectedResultsReader = null;
        if (expectedResultsFile != null && expectedResultsFile.exists() && expectedResultsFile.canRead()) {
            expectedResultsReader = new BufferedReader(new FileReader(expectedResultsFile));
        }
       
        PrintStream out =  TestResultSetUtil.getPrintStream(null,expectedResultsReader, printToConsole ? System.out : null);
        
         printThrowable(t, query, out);
        return TestResultSetUtil.getUnequalLines(out);
     }
View Full Code Here

Examples of java.io.PrintStream

     * @param defaultPrintStream if not null, this utility will always write to this stream. Typically this is System.out
     * @return the single PrintStream that wraps all the input streams for writing and comparison.
     * @since 4.2
     */
    public static PrintStream getPrintStream(OutputStream resultsOutput, BufferedReader expectedResultsInput, PrintStream defaultPrintStream) {
        PrintStream out = null;
        if (defaultPrintStream == null) {
            defaultPrintStream = new PrintStream(new OutputStream () {
                                                     public void write(int b) throws IOException {}
                                                 });
        }
        if (resultsOutput == null && expectedResultsInput == null) {
            out = defaultPrintStream;
        } else if (resultsOutput == null && expectedResultsInput != null) {
            out = new ComparingPrintStream(defaultPrintStream, expectedResultsInput);
        } else if (resultsOutput!= null && expectedResultsInput == null) {
            PrintStream filePrintStream = new PrintStream(resultsOutput);
            out = new MuxingPrintStream(new PrintStream[] {defaultPrintStream, filePrintStream});
        } else {
            PrintStream filePrintStream = new PrintStream(resultsOutput);
            out = new ComparingPrintStream(new MuxingPrintStream(new PrintStream[] {defaultPrintStream, filePrintStream}), expectedResultsInput);
        }
        return out;
    }
View Full Code Here

Examples of java.io.PrintStream

     * @return The List of line numbers which differ between the actual and expected results.
     * @throws SQLException
     * @since 4.3
     */
    public static List writeAndCompareResultSet(ResultSet rs, String query, int maxColWidth, boolean printMetadata, OutputStream resultsOutput, BufferedReader expectedResultsInput, PrintStream defaultPrintStream) throws SQLException {
        PrintStream out = getPrintStream(resultsOutput, expectedResultsInput, defaultPrintStream);
        printResultSet(rs, query, maxColWidth, printMetadata, out);
        return getUnequalLines(out);
    }
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.