Examples of PrintStream


Examples of java.io.PrintStream

 
 
  FileOutputStream actualOut = null;
  try {
      actualOut = new FileOutputStream(fos);
      PrintStream filePrintStream = new PrintStream(actualOut);
      if (ex != null) {
    TestResultSetUtil.printThrowable(ex, query, filePrintStream);
      } else if (result != null ){
    result.beforeFirst();
    TestResultSetUtil.printResultSet(result, query, MAX_COL_WIDTH, true, filePrintStream);
View Full Code Here

Examples of java.io.PrintStream

      // the error was due to a thrown exception, and not based comparison issues
      if (resultSet == null) {
    FileOutputStream actualOut = null;
    try {
        actualOut = new FileOutputStream(errorFile);
        PrintStream filePrintStream = new PrintStream(actualOut);
       

        TestResultSetUtil.printThrowable(queryError, sql, filePrintStream);
       
        filePrintStream.flush();

    } catch (Exception e) {
          e.printStackTrace();
          throw new QueryTestFailedException(e);
    } finally {
View Full Code Here

Examples of java.io.PrintStream

      throws QueryTestFailedException {
 
  FileOutputStream actualOut = null;
  try {
      actualOut = new FileOutputStream(resultsFile);
      PrintStream filePrintStream = new PrintStream(actualOut);
     
      TestResultSetUtil.printResultSet(actualResult, sql, MAX_COL_WIDTH, true, filePrintStream);

//      if (results != null) {
//              for (Iterator<String> it=results.iterator(); it.hasNext();) {
View Full Code Here

Examples of java.io.PrintStream

           
            if( profile != null ) {
             
              //System.out.println("TelnetUI: creating console input" );
             
              ui.createNewConsoleInput("Telnet Console " + threadNum++, socket.getInputStream(), new PrintStream(socket.getOutputStream()), profile);
              break;
            }
           
            //System.out.println("TelnetUI: failed to obtain login profile" );
           
View Full Code Here

Examples of java.io.PrintStream

  private UserProfile login(InputStream in, OutputStream out) throws IOException
  {
    if( userManager == null )
      return UserProfile.DEFAULT_USER_PROFILE;
   
    PrintStream ps = new PrintStream(out);
    BufferedReader br = new BufferedReader(new InputStreamReader(in));
    ps.print("Username: ");
    String username = br.readLine();
    ps.print("Password: ");
    String password = br.readLine();
    UserProfile userProfile = userManager.authenticate(username, password);
    if( userProfile != null )
    {
      ps.println("Login successful");
      return userProfile;
    }
    ps.println("Login failed");
    return null;
  }
View Full Code Here

Examples of java.io.PrintStream

   
    if ((!isStarted()) || (console == null) || (!console.isAlive())) {
//      ConsoleInput.printconsolehelp(System.out);
      System.out.println();
     
      PrintStream this_out = System.out;

      // Unless a system property tells us not to, we'll take stdout and stderr offline.
      if (!"on".equals(System.getProperty("azureus.console.noisy"))) {
      // We'll hide any output to stdout or stderr - we don't want to litter our
      // view.
      PrintStream ps = new PrintStream(new java.io.OutputStream() {
        public void write(int c) {}
        public void write(byte[] b, int i1, int i2) {}
      });
      System.setOut(ps);
      System.setErr(ps);
View Full Code Here

Examples of java.io.PrintStream

          if (colors != null && colorIdx >= 0)
            consoleText.setLineBackground(nbLinesBefore, nbLinesNow
                - nbLinesBefore, colors[colorIdx]);
        } catch (Exception e) {
          // don't send it to log, we might be feeding ourselves
          PrintStream ps = Logger.getOldStdErr();
          if (ps != null) {
            ps.println("Error writing event to console:");
            e.printStackTrace(ps);
          }
        }

      }
View Full Code Here

Examples of java.io.PrintStream

    try {
      if (System.out != psOut) {
        if (psOldOut == null)
          psOldOut = System.out;

        psOut = new PrintStream(new RedirectorStream(psOldOut, LogIDs.STDOUT,
            LogEvent.LT_INFORMATION));

        System.setOut(psOut);
      }

      if (System.err != psErr) {
        if (psOldErr == null)
          psOldErr = System.err;

        psErr = new PrintStream(new RedirectorStream(psOldErr, LogIDs.STDERR,
            LogEvent.LT_ERROR));

        System.setErr(psErr);
      }
View Full Code Here

Examples of java.io.PrintStream

            writeFile(t, data);
        }
    }

    private PrintStream filter(PrintStream out, final String[] exclude) {
        return new PrintStream(new FilterOutputStream(out) {
            private ByteArrayOutputStream buff = new ByteArrayOutputStream();

            public void write(byte[] b) throws IOException {
                write(b, 0, b.length);
            }
View Full Code Here

Examples of java.io.PrintStream

     *
     * @param args the command line arguments to pass
     */
    protected void javadoc(String...args) {
        int result;
        PrintStream old = System.out;
        try {
            println("Javadoc");
            if (quiet) {
                System.setOut(filter(System.out, new String[] {
                        "Loading source files for package",
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.