JUnit: pause for user input

I am learning JUnit. Since my application includes graphical output, I want me to be able to see the result and manually pass or fail the test based on what I see. He must wait for me for a while, and then lose if he expires.

Is there a way to do this in JUnit (or its extensions), or do I just need to call the dialog box and assertTrue in the output? It seems like this could be a common problem with an existing solution.

Edit: If I should not use JUnit for this, what should I use? I want to manually check the assembly so often and unit test automatically, and it would be great if the two testing frameworks passed.

+3
source share
5 answers

Manually accepting / rejecting a test strikes the purpose of using an automated testing system. JUnit is not made for this kind of thing. If you don’t find a way to create and introduce a mockup of an object representing your output device, you should consider alternatives (I don’t really know, sorry).

I once wrote automated tests for a video decoding component. I dumped the decoded data to a file using some other decoder as a reference, and then compared the output of my decoder to that using PSNR of each pair of images. It is not 100% standalone (requires external files as resources), but at least it is automated and works fine for me.

+6

, , , , JUnit. , . , " " , , .

Abbot, .

+3

. , - , , .

, . , QA'ing. ( QA, .)

+1

, MVC, (.. Swing , ). , , , .

Visual Studio , , , , . , Q/A.

0

FEST-Swing. .

, , - , gui- . , . , , .

0

Source: https://habr.com/ru/post/1724500/


All Articles