package com.intellij.notification.impl;

import com.intellij.openapi.components.ProjectComponent;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.openapi.wm.ex.StatusBarEx;
import org.jetbrains.annotations.NotNull;

/**
 * @author spleaner
 */
public class ProjectNotificationsComponent implements ProjectComponent {
  private Project myProject;
  private StatusBarEx myStatusBar;

  public ProjectNotificationsComponent(final Project project) {
    myProject = project;
  }

  public void projectOpened() {
    myStatusBar = (StatusBarEx) WindowManager.getInstance().getStatusBar(myProject);
    myStatusBar.getNotificationArea().connect(myProject);
  }

  public void projectClosed() {
    myStatusBar.getNotificationArea().getModel().clearProjectNotifications();
    myProject = null;
  }

  @NotNull
  public String getComponentName() {
    return "Project Notifications";
  }

  public void initComponent() {
  }

  public void disposeComponent() {
  }
}

@@ -229,16 +229,76 @@
 sBarEx;%0A
+import com.intellij.openapi.application.ApplicationManager;%0A
 import o
@@ -331,16 +331,16 @@
 otNull;%0A
-
 %0A/**%0A * 
@@ -620,24 +620,109 @@
 tOpened() %7B%0A
+    if (ApplicationManager.getApplication().isUnitTestMode()) %7B%0A      return;%0A    %7D%0A%0A
     myStatus
@@ -853,24 +853,24 @@
 ject);%0A  %7D%0A%0A
-
   public voi
@@ -885,24 +885,109 @@
 tClosed() %7B%0A
+    if (ApplicationManager.getApplication().isUnitTestMode()) %7B%0A      return;%0A    %7D%0A%0A
     myStatus

fix tests