EMMA Coverage Report (generated Sat Oct 08 11:41:37 CEST 2011)
[all classes][net.sf.jomic.ui]

COVERAGE SUMMARY FOR SOURCE FILE [GoToPageDialogTest.java]

nameclass, %method, %block, %line, %
GoToPageDialogTest.java100% (1/1)100% (4/4)86%  (61/71)97%  (23.3/24)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class GoToPageDialogTest100% (1/1)100% (4/4)86%  (61/71)97%  (23.3/24)
testGoToPageDialog (): void 100% (1/1)81%  (43/53)95%  (15.3/16)
GoToPageDialogTest (): void 100% (1/1)100% (3/3)100% (1/1)
setUp (): void 100% (1/1)100% (9/9)100% (4/4)
tearDown (): void 100% (1/1)100% (6/6)100% (3/3)

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/>.
16package net.sf.jomic.ui;
17 
18import junit.framework.TestCase;
19import net.sf.jomic.tools.TestTools;
20 
21/**
22 *  TestCase for GoToPageDialog.
23 *
24 * @author    Thomas Aglassinger
25 */
26public class GoToPageDialogTest extends TestCase
27{
28    private TestTools testTools;
29 
30    protected void setUp()
31        throws Exception {
32        super.setUp();
33        testTools = TestTools.instance();
34        testTools.setupCache();
35    }
36 
37    public void testGoToPageDialog() {
38        JomicFrame frame = new JomicFrame();
39 
40        try {
41            frame.pack();
42            frame.setSize(TestTools.FRAME_WIDTH, TestTools.FRAME_HEIGHT);
43            frame.validate();
44            frame.openSynchronously(testTools.getTestComicFile());
45 
46            GoToPageDialog dialog = new GoToPageDialog(frame);
47 
48            try {
49                dialog.pack();
50                // Note: Because of setModal(false), the dialog will not close when the Ok or
51                // Cancel button is pressed.
52                dialog.setModal(false);
53                dialog.setVisible(true);
54                testTools.waitSomeTime();
55                dialog.setVisible(false);
56            } finally {
57                dialog.dispose();
58            }
59        } finally {
60            frame.dispose();
61        }
62    }
63 
64    protected void tearDown()
65        throws Exception {
66        testTools = null;
67        super.tearDown();
68    }
69}

[all classes][net.sf.jomic.ui]
EMMA 2.0.4217 (C) Vladimir Roubtsov