forked from cmadsen/vldocking
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
src/test/java/com/vlsolutions/swing/docking/DockingDesktopTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.vlsolutions.swing.docking; | ||
|
||
import com.vlsolutions.swing.TestBase; | ||
import com.vlsolutions.swing.sample.MySplitDockApp; | ||
import org.assertj.swing.fixture.FrameFixture; | ||
import org.junit.Test; | ||
|
||
import javax.swing.*; | ||
|
||
import java.awt.*; | ||
import java.lang.reflect.InvocationTargetException; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class DockingDesktopTest extends TestBase { | ||
@Override | ||
protected void onSetUp() { | ||
application = createDockedApplication(MySplitDockApp.class); | ||
window = new FrameFixture(robot(), application); | ||
window.show(); | ||
} | ||
|
||
@Test | ||
public void testFloating() throws InterruptedException, InvocationTargetException { | ||
SwingUtilities.invokeAndWait(() -> { | ||
application.setVisible(true); | ||
application.getDesktop().setFloating(application.getTreePanel(), true); | ||
}); | ||
assertTrue(application.getDesktop().getDockableState(application.getTreePanel()).isFloating()); | ||
} | ||
|
||
@Test | ||
public void testFloatingPoint() throws InterruptedException, InvocationTargetException { | ||
SwingUtilities.invokeAndWait(() -> { | ||
application.setVisible(true); | ||
Point p = application.getDesktop().getBounds().getLocation(); | ||
application.getDesktop().setFloating(application.getTreePanel(), true, p); | ||
}); | ||
assertEquals(DockableState.Location.FLOATING, application.getTreePanel().getDockKey().getLocation()); | ||
assertTrue(application.getDesktop().getDockableState(application.getTreePanel()).isFloating()); | ||
} | ||
|
||
@Test | ||
public void testMaximize() throws InterruptedException, InvocationTargetException { | ||
SwingUtilities.invokeAndWait(() -> { | ||
application.setVisible(true); | ||
application.getDesktop().maximize(application.getTreePanel()); | ||
}); | ||
assertTrue(application.getDesktop().getDockableState(application.getTreePanel()).isMaximized()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters