001: /*
002: * SalomeTMF is a Test Management Framework
003: * Copyright (C) 2005 France Telecom R&D
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: *
019: * @author Fayçal SOUGRATI, Vincent Pautret, Marche Mikael
020: *
021: * Contact: mikael.marche@rd.francetelecom.com
022: */
023:
024: package salomeTMF_plug.beanshell;
025:
026: public class ScriptErrPrint extends java.io.PrintStream {
027: java.io.PrintStream p;
028: String log = "";
029:
030: public String getLog() {
031: return log;
032: }
033:
034: public void setLog(String l) {
035: log += "\n" + l;
036: }
037:
038: public ScriptErrPrint(java.io.PrintStream p) {
039:
040: super (System.out);
041:
042: this .p = p;
043: }
044:
045: public boolean checkError() {
046: return p.checkError();
047: }
048:
049: public void close() {
050: p.close();
051: }
052:
053: public void flush() {
054: p.flush();
055: }
056:
057: public void print(boolean b) {
058: p.print(b);
059: log += b;
060: }
061:
062: public void print(char c) {
063: p.print(c);
064: log += c;
065: }
066:
067: public void print(char[] s) {
068: p.print(s);
069: log += s;
070: }
071:
072: public void print(double d) {
073: p.print(d);
074: log += d;
075: }
076:
077: public void print(float f) {
078: p.print(f);
079: log += f;
080: }
081:
082: public void print(int i) {
083: p.print(i);
084: log += i;
085: }
086:
087: public void print(long l) {
088: p.print(l);
089: log += l;
090: }
091:
092: public void print(Object obj) {
093: p.print(obj);
094: log += obj;
095: }
096:
097: public void print(String s) {
098: p.print(s);
099: log += s;
100: }
101:
102: public void println() {
103: p.println();
104: log += "\n";
105: }
106:
107: public void println(boolean x) {
108: p.println(x);
109: log += x + "\n";
110: }
111:
112: public void println(char x) {
113: p.println(x);
114: log += x + "\n";
115: }
116:
117: public void println(char[] x) {
118: p.println(x);
119: log += x + "\n";
120: }
121:
122: public void println(double x) {
123: p.println(x);
124: log += x + "\n";
125: }
126:
127: public void println(float x) {
128: p.println(x);
129: log += x + "\n";
130: }
131:
132: public void println(int x) {
133: p.println(x);
134: log += x + "\n";
135: }
136:
137: public void println(long x) {
138: p.println(x);
139: log += x + "\n";
140: }
141:
142: public void println(Object x) {
143: p.println(x);
144: log += x + "\n";
145: }
146:
147: public void println(String x) {
148: p.println(x);
149: log += x + "\n";
150: }
151:
152: public void write(byte[] buf, int off, int len) {
153: p.write(buf, off, len);
154: log += new String(buf, off, len);
155: }
156:
157: public void write(int b) {
158: p.write(b);
159: log += b;
160: }
161: }
|