-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jemmy output to robot log at debug level. Also SwingLirbary no longer…
… extends AnnotationLibrary
- Loading branch information
1 parent
3d4533b
commit 8861c1b
Showing
3 changed files
with
62 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/main/java/org/robotframework/swing/util/StandardOutOutput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package org.robotframework.swing.util; | ||
|
||
import org.netbeans.jemmy.TestOut; | ||
|
||
import java.io.InputStream; | ||
import java.io.PrintWriter; | ||
|
||
|
||
public class StandardOutOutput extends TestOut { | ||
|
||
public final long starterThreadId; | ||
|
||
|
||
public StandardOutOutput() { | ||
super((InputStream)null, (PrintWriter)null, (PrintWriter)null); | ||
starterThreadId = Thread.currentThread().getId(); | ||
} | ||
|
||
@Override | ||
public void print(String line) { | ||
log(line); | ||
} | ||
|
||
@Override | ||
public void printLine(String line) { | ||
log(line); | ||
} | ||
|
||
@Override | ||
public void printTrace(String text) { | ||
log(text); | ||
} | ||
|
||
@Override | ||
public void printErrLine(String line) { | ||
log(line); | ||
} | ||
|
||
@Override | ||
public void printError(String text) { | ||
log(text); | ||
} | ||
|
||
@Override | ||
public void printStackTrace(Throwable e) { | ||
log("Error in Jemmy:"); | ||
e.printStackTrace(System.out); | ||
} | ||
|
||
private void log(String msg) { | ||
if (Thread.currentThread().getId() == starterThreadId) | ||
System.out.println("*DEBUG:"+System.currentTimeMillis()+"* Jemmy: "+ msg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters