ConfigureLogcatHeaderDialog extends DialogWrapper { ConfigureLogcatHeaderDialog(@NotNull Project project, @NotNull AndroidLogcatPreferences preferences, @NotNull ZoneId timeZone) { super(project, false, IdeModalityType.PROJECT); myTimeZone = timeZone; String format = preferences.LOGCAT_FORMAT_STRING; myShowDateAndTimeCheckBox = createShowDateAndTimeCheckBox(format); myShowAsSecondsSinceEpochCheckBox = createCheckBox("Show as seconds since epoch", preferences.SHOW_AS_SECONDS_SINCE_EPOCH, 8); myShowProcessAndThreadIdsCheckBox = createCheckBox("Show process and thread IDs", format.isEmpty() || format.contains("%2$s"), 5); myShowPackageNameCheckBox = createCheckBox("Show package name", format.isEmpty() || format.contains("%3$s"), 13); myShowTagCheckBox = createCheckBox("Show tag", format.isEmpty() || format.contains("%5$s"), 7); mySampleLabel = createSampleLabel(); init(); setTitle(AndroidBundle.message("android.configure.logcat.header.title")); } ConfigureLogcatHeaderDialog(@NotNull Project project, @NotNull AndroidLogcatPreferences preferences, @NotNull ZoneId timeZone);   }
@Test public void configureLogcatHeaderDialog() { assertTrue(myDialog.getShowDateAndTimeCheckBox().isSelected()); assertFalse(myDialog.getShowAsSecondsSinceEpochCheckBox().isSelected()); assertTrue(myDialog.getShowProcessAndThreadIdsCheckBox().isSelected()); assertTrue(myDialog.getShowPackageNameCheckBox().isSelected()); assertTrue(myDialog.getShowTagCheckBox().isSelected()); assertEquals("2018-02-06 14:16:28.555 123-456/com.android.sample I/SampleTag: This is a sample message", myDialog.getSampleLabel().getText()); assertEquals("", myDialog.getFormat()); }