ダイアログ ボックスなどのプレーンな Java Swing コンポーネントを作成する場合、ダイアログを表示するための単体テストを作成するのは非常に簡単です。基本的には、ダイアログのインスタンスを作成して setIsVisible(true) を呼び出すだけです。グリフォンビューでこれを行う方法を理解するのに本当に苦労しています。統合テストでこれを実行しようとしましたが、取得できないようです。
ビューを表示するためにいくつかのことを試しましたが、何も機能していないようです。ビューのインスタンスを取得できると思われる唯一の方法は次のとおりです。
AirplaneView view = helper.newInstance(app, griffonpractice.AirplaneView.class, "Airplane")
この後、私はできるかもしれないと思ったview.setIsVisible(true) or view.frame.setIsVisible(true)
が、運がなかった。私はこれについて間違った方法で考えていると思います.これを行うにはかなり簡単な方法が必要です. どんな助けでも大歓迎です。私のビューは次のようになります。バインディングがないため、何もモックする必要がないことに注意してください。
package griffonpractice
import javax.swing.JFrame
JFrame frame = application(title: 'GriffonPractice',
size: [320,480],
pack: true,
location: [50,50],
locationByPlatform:true){
borderLayout()
{
hbox(constraints: BL.NORTH)
{
label(text: "shane")
label(text: "Jack");
}
}
}