Skip to content

Commit

Permalink
Fix test in headless
Browse files Browse the repository at this point in the history
  • Loading branch information
nroduit committed Jul 12, 2024
1 parent 4bb34ab commit be6e4bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import bibliothek.gui.dock.common.event.CVetoFocusListener;
import bibliothek.gui.dock.common.intern.CDockable;
import bibliothek.gui.dock.event.KeyboardListener;
import java.awt.GraphicsEnvironment;
import java.awt.Window;
import java.awt.event.KeyEvent;
import java.io.DataOutputStream;
Expand Down Expand Up @@ -99,7 +100,11 @@ private static final class Holder {
/** Do not instantiate UICore, get OSGI singleton service from GuiUtils.getUICore() */
private UICore() {
this.dockingControl = new CControl();
this.baseArea = dockingControl.getContentArea();
if (GraphicsEnvironment.isHeadless()) {
this.baseArea = null; // For test where no GUI is available
} else {
this.baseArea = dockingControl.getContentArea();
}
this.mainArea = dockingControl.createWorkingArea("mainArea");
this.toolbarContainer = new ToolBarContainer();
this.dicomLaunchers = Launcher.loadLaunchers(Launcher.Type.DICOM);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.lang.management.ManagementFactory;
import java.net.URI;
import javax.management.ObjectName;
import javax.swing.JFrame;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
Expand Down

0 comments on commit be6e4bc

Please sign in to comment.