Search in sources :

Example 11 with MessageDialogResult

use of org.openecard.gui.message.MessageDialogResult in project open-ecard by ecsec.

the class RunMessageBox method showInputDialog.

@Test(enabled = !true)
public void showInputDialog() {
    MessageDialog messageBox = uc.obtainMessageDialog();
    MessageDialogResult result = messageBox.showInputDialog("Enter the text \"test\"!", TITLE);
    Assert.assertEquals(result.getReturnValue(), ReturnType.OK);
    Assert.assertEquals(result.getUserInput(), "test");
}
Also used : MessageDialogResult(org.openecard.gui.message.MessageDialogResult) MessageDialog(org.openecard.gui.MessageDialog) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Example 12 with MessageDialogResult

use of org.openecard.gui.message.MessageDialogResult in project open-ecard by ecsec.

the class RunMessageBox method showConfirmDialog2.

@Test(enabled = !true)
public void showConfirmDialog2() {
    MessageDialog messageBox = uc.obtainMessageDialog();
    MessageDialogResult result = messageBox.showConfirmDialog("Press ok!", TITLE, OptionType.OK_CANCEL_OPTION);
    Assert.assertEquals(result.getReturnValue(), ReturnType.OK);
}
Also used : MessageDialogResult(org.openecard.gui.message.MessageDialogResult) MessageDialog(org.openecard.gui.MessageDialog) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Example 13 with MessageDialogResult

use of org.openecard.gui.message.MessageDialogResult in project open-ecard by ecsec.

the class RunMessageBox method showConfirmDialog.

@Test(enabled = !true)
public void showConfirmDialog() {
    MessageDialog messageBox = uc.obtainMessageDialog();
    MessageDialogResult result = messageBox.showConfirmDialog("Press yes!", TITLE);
    Assert.assertEquals(result.getReturnValue(), ReturnType.OK);
    result = messageBox.showConfirmDialog("Press no!", TITLE);
    Assert.assertEquals(result.getReturnValue(), ReturnType.NO);
    result = messageBox.showConfirmDialog("Press cancel!", TITLE);
    Assert.assertEquals(result.getReturnValue(), ReturnType.CANCEL);
}
Also used : MessageDialogResult(org.openecard.gui.message.MessageDialogResult) MessageDialog(org.openecard.gui.MessageDialog) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Example 14 with MessageDialogResult

use of org.openecard.gui.message.MessageDialogResult in project open-ecard by ecsec.

the class RunMessageBox method showInputDialog3.

@Test(enabled = !true)
public void showInputDialog3() {
    MessageDialog messageBox = uc.obtainMessageDialog();
    MessageDialogResult result = messageBox.showInputDialog("Press ok!", TITLE, DialogType.ERROR_MESSAGE, "");
    Assert.assertEquals(result.getReturnValue(), ReturnType.OK);
}
Also used : MessageDialogResult(org.openecard.gui.message.MessageDialogResult) MessageDialog(org.openecard.gui.MessageDialog) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

MessageDialogResult (org.openecard.gui.message.MessageDialogResult)14 MessageDialog (org.openecard.gui.MessageDialog)9 BeforeTest (org.testng.annotations.BeforeTest)9 Test (org.testng.annotations.Test)9 JDialog (javax.swing.JDialog)5 JOptionPane (javax.swing.JOptionPane)5 ImageIcon (javax.swing.ImageIcon)4