mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
be test friendly
This commit is contained in:
@@ -41,6 +41,7 @@ public class ZipperUpdater {
|
||||
|
||||
public void queue(final Runnable runnable, final boolean urgent) {
|
||||
synchronized (myLock) {
|
||||
if (myAlarm.isDisposed()) return;
|
||||
final boolean wasRaised = myRaised;
|
||||
myRaised = true;
|
||||
if (! wasRaised) {
|
||||
|
||||
+7
-2
@@ -155,7 +155,12 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
|
||||
CommitChangeListDialog dialog =
|
||||
new CommitChangeListDialog(project, changes, initialSelection, executors, showVcsCommit, defaultList, changeLists, null, false,
|
||||
comment);
|
||||
dialog.show();
|
||||
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
dialog.show();
|
||||
}
|
||||
else {
|
||||
dialog.doOKAction();
|
||||
}
|
||||
return dialog.isOK();
|
||||
}
|
||||
|
||||
@@ -193,7 +198,7 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
|
||||
|
||||
public static boolean commitChanges(final Project project, final Collection<Change> changes, final LocalChangeList initialSelection,
|
||||
final List<CommitExecutor> executors, final boolean showVcsCommit, final String comment) {
|
||||
if (changes.isEmpty()) {
|
||||
if (changes.isEmpty() && !ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
Messages.showInfoMessage(project, VcsBundle.message("commit.dialog.no.changes.detected.text") ,
|
||||
VcsBundle.message("commit.dialog.no.changes.detected.title"));
|
||||
return false;
|
||||
|
||||
@@ -581,8 +581,8 @@ public void addMessageToConsoleWindow(final String message, final TextAttributes
|
||||
}
|
||||
|
||||
public void stopBackgroundVcsOperation() {
|
||||
// in fact, the condition is "should not be called under ApplicationManager.invokeLater() and similiar"
|
||||
assert ! ApplicationManager.getApplication().isDispatchThread();
|
||||
// in fact, the condition is "should not be called under ApplicationManager.invokeLater() and similar"
|
||||
assert !ApplicationManager.getApplication().isDispatchThread() || ApplicationManager.getApplication().isUnitTestMode();
|
||||
LOG.assertTrue(myBackgroundOperationCounter > 0, "myBackgroundOperationCounter > 0");
|
||||
myBackgroundOperationCounter--;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user