Are there any JUnit tests in SWT (or Platform?) that spawn a child process? #2524
Replies: 2 comments 2 replies
-
There is Java has the ToolProvider where you maybe can get something more or less platform independent as well. One could also think about spawning another java process that starts a Single-File Source-Code Program, this can then e.g. open a Swing UI quite easily and you can ask it to copy/past using Stdin/out commands... that would be most flexible I think. |
Beta Was this translation helpful? Give feedback.
-
In the end I did it by letting JDT compile my independent code as part of the project and then extracting the needed class files* and running I used RMI for communication as it meant I didn't have to write any new serializing/deserializing code. You can see that in action here: #2541 * Open question in the PR is if I can run the jar file directly (for cases when testing from a bundled jar). ** Not yet tested on non Linux or in Maven or in aggregator build. My focus has been running it in Eclipse IDE so far with JDT but the other combinations will come now that I created the PR |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on improving the clipboard for GTK4 in #2126
The Gdk clipboard behaves differently if you are copy-pasting between processes vs within the same process (is local). So to test the code thoroughly I need to copy-paste between processes.
Are there existing examples of this in the SWT (or wider Platform) testsuite?
On Linux there are some command line programs that can do it. Perhaps I can launch those iff on Linux. Alternatively a cross-platform option of launching another SWT program from within a test (e.g. add a main method to current class).
Any other thoughts?
Beta Was this translation helpful? Give feedback.
All reactions