| 1 | // Jomic - a viewer for comic book archives. |
| 2 | // Copyright (C) 2004-2011 Thomas Aglassinger |
| 3 | // |
| 4 | // This program is free software: you can redistribute it and/or modify |
| 5 | // it under the terms of the GNU General Public License as published by |
| 6 | // the Free Software Foundation, either version 3 of the License, or |
| 7 | // (at your option) any later version. |
| 8 | // |
| 9 | // This program is distributed in the hope that it will be useful, |
| 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | // GNU General Public License for more details. |
| 13 | // |
| 14 | // You should have received a copy of the GNU General Public License |
| 15 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | package net.sf.jomic.ui; |
| 17 | |
| 18 | import javax.swing.JMenuItem; |
| 19 | |
| 20 | import net.sf.jomic.JomicTestFixture; |
| 21 | import net.sf.jomic.comic.ComicView; |
| 22 | |
| 23 | /** |
| 24 | * TestCase for items in "View" menu. |
| 25 | * |
| 26 | * @author Thomas Aglassinger |
| 27 | */ |
| 28 | public class ViewMenuTest extends JomicTestFixture |
| 29 | { |
| 30 | public void testViewMenu() |
| 31 | throws Exception { |
| 32 | JomicFrame jomicFrame = setUpJomicFrame(); |
| 33 | ComicView comicView = jomicFrame.getComicView(); |
| 34 | |
| 35 | assertNotNull(comicView); |
| 36 | |
| 37 | JMenuItem viewActualSizeItem = findMenuItem("View|Actual size"); |
| 38 | JMenuItem viewZoomToFitItem = findMenuItem("View|Zoom to fit"); |
| 39 | JMenuItem viewZoomToFitHeightItem = findMenuItem("View|Zoom to fit height"); |
| 40 | JMenuItem viewZoomToFitWidthItem = findMenuItem("View|Zoom to fit width"); |
| 41 | JMenuItem rotateLeftItem = findMenuItem("View|Rotate left"); |
| 42 | JMenuItem rotateRightItem = findMenuItem("View|Rotate right"); |
| 43 | |
| 44 | viewActualSizeItem.doClick(); |
| 45 | viewZoomToFitHeightItem.doClick(); |
| 46 | viewZoomToFitWidthItem.doClick(); |
| 47 | viewZoomToFitItem.doClick(); |
| 48 | |
| 49 | for (int rotation = 0; rotation < 4; rotation += 1) { |
| 50 | System.gc(); |
| 51 | rotateLeftItem.doClick(); |
| 52 | } |
| 53 | for (int rotation = 0; rotation < 4; rotation += 1) { |
| 54 | System.gc(); |
| 55 | rotateRightItem.doClick(); |
| 56 | } |
| 57 | } |
| 58 | } |