Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Listener that enables TESTAR to listen to the StdOut/Err SUT #63

Closed
tanjavos opened this issue May 9, 2018 · 7 comments
Closed

Comments

@tanjavos
Copy link
Member

tanjavos commented May 9, 2018

It should be able to listen during testing (ONLINE oracle) and it should stores it all in a file that can be inspected after testing (OFFLINE oracle).

System.out and System.err listens to the StdOut/Err of TESTAR itself. We should somehow catch the StdOUT/ERR of the SUT when it is started up.

HINTS on a possible solution within Java: https://stackoverflow.com/questions/3643939/java-process-with-input-output-stream

HINTS on a possible solution in cpp WinAPI:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682499(v=vs.85).aspx

@ferpasri
Copy link
Member

I have added a version to create the SUT process from Java and then search it through PID.
https://github.com/TESTARtool/TESTAR_dev/blob/fernando_dev/windows/src/org/fruit/alayer/windows/WinProcess.java

It seems to work and read processes correctly.
I have used:
https://sourceforge.net/projects/simpcalc/
https://sourceforge.net/projects/procalculatorboiler/?source=directory
VLC

I'm going to test it more, if someone finds mistakes or has ideas they'll be welcome

@ferpasri
Copy link
Member

ferpasri commented Jun 8, 2018

Final version:
https://github.com/TESTARtool/TESTAR_dev/tree/issue63_stdOutErr_dev

Only available if we run the SUT through Command_line

@tanjavos
Copy link
Member Author

tanjavos commented Jul 9, 2018

Also make sure that:

@ferpasri
Copy link
Member

ferpasri commented Sep 12, 2018

Solved:
When the buggy calculator is used as SUT and it stays frozen (3 clicks on "tan x"), TESTAR kills its own java process instead of the calculator.

@ferpasri
Copy link
Member

Refactor and prepare a new class

@pekkakaho
Copy link
Member

The functionality works, so the only thing left is to refactor the code outside of DefaultProtocol

ferpasri added a commit that referenced this issue Dec 14, 2018
Refactor ProcessListeners:

- Moved out of DefaultProtocol class
- Update lastExecutedAction on DefaultProtocol
- Add procalc.jar, nice app to test the process listeners
ferpasri added a commit that referenced this issue Jan 7, 2019
@ferpasri
Copy link
Member

Implemented, lets close this enhancement thread.
If some issues / idea exists in the future, we will reopen or create new one.

eddyou pushed a commit that referenced this issue May 5, 2019
Refactor ProcessListeners:

- Moved out of DefaultProtocol class
- Update lastExecutedAction on DefaultProtocol
- Add procalc.jar, nice app to test the process listeners
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants