-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathUiBoosterOptionsTest.java
63 lines (48 loc) · 1.79 KB
/
UiBoosterOptionsTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package de.milchreis.uibooster;
import de.milchreis.uibooster.model.UiBoosterOptions;
import de.milchreis.uibooster.model.options.DarkUiBoosterOptions;
import org.junit.jupiter.api.Test;
import java.awt.*;
import static java.lang.Thread.sleep;
class UiBoosterOptionsTest {
@Test
public void test_plain() {
new UiBooster();
}
@Test
public void test_theme() {
new UiBooster(
UiBoosterOptions.Theme.DARK_THEME
);
}
@Test
public void test_theme_and_icon() throws InterruptedException {
final UiBooster uiBooster = new UiBooster(
UiBoosterOptions.Theme.SWING,
"src/test/resources/avatar1.png"
);
uiBooster.showInfoDialog("some title");
uiBooster.showWarningDialog("warning text", "some title");
uiBooster.showErrorDialog("warning text", "some title");
String res = uiBooster.showTextInputDialog("some title");
System.out.println(res);
final boolean isConfirmed = uiBooster.showConfirmDialog("message", "some title");
System.out.println("Is confirmed? -> " + isConfirmed);
final String selectedOption = uiBooster
.showSelectionDialog("some message", "some title", "Option 1", "Option 2");
System.out.println(selectedOption);
uiBooster.showFileSelection();
uiBooster.showDirectorySelection();
uiBooster.showWaitingDialog("message", "title", true);
sleep(2000);
}
@Test
public void test_options() {
new UiBooster(new DarkUiBoosterOptions());
}
@Test
public void test_different_font() {
final UiBooster booster = new UiBooster(new Font("Comic Sans MS", Font.BOLD, 24));
booster.showInfoDialog("Some fancy information with crazy font");
}
}