assertj / assertj/assertj-swing

CellWriter can block main thread when celleditor.stopEditing() is called

Aperta
#83 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
import from fest-swing Improvement Major
Lingua principale
Java
Stelle
121
Fork
52
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

_Issue by **[Shawn Clowater](http://jira.codehaus.org/secure/ViewProfile.jspa?name=sclowater)** from Fri, 10 Dec 2010 18:34:19 -0600_
_Originally opened as http://jira.codehaus.org/browse/FEST-409_

---

We have a text editor that can pop a dialog from an inputVerifier() call. (it executes a lookup and will display an advanced search dialog if either no match or multiple matches were found)

In the case of setting a value and fest ultimately calling the stopEditing() which causes this dialog to display it causes a deadlock in the main execution thread so we can't do anything to process the dialog and our tests hang.

It's all fine until it gets down into the JTableStopCellEditingTask.doStopCellEditing(TableCellEditor cellEditor) method and then it will essentially wait forever. (until the test timeout kicks in)

I've managed to work around it by essentially cloning the BasicJTableCellWriter and then swapping out the textComponentWriter reference with an editor that issues a F2 keyevent in place of the stopEditing call.

It all works but to actually get at the pieces I needed to clone the BasicJTableCellWriter since the code I needed to override was either private or final. i.e. the handling of the cellWriterFor() method.

Looking back in the changelog history I see that F2 was wired up to start the editing at some point, it might be worthwhile to do the same thing for the stop Editing.

---

votes (original issue): 0
watches (original issue): 0

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia da JTableStopCellEditingTask.doStopCellEditing(TableCellEditor cellEditor) e verifica come BasicJTableCellWriter invoca stopEditing quando un inputVerifier apre una finestra di dialogo. Riproduci lo scenario del test bloccato, quindi verifica che la modifica della cella possa terminare senza bloccare il thread principale e che la finestra di dialogo rimanga utilizzabile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
desktop, testing
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.