EMMA Coverage Report (generated Sun Apr 20 22:38:01 CEST 2008)
[all classes][net.sf.jomic.ui]

COVERAGE SUMMARY FOR SOURCE FILE [CreateComicDialogTest.java]

nameclass, %method, %block, %line, %
CreateComicDialogTest.java100% (2/2)100% (6/6)91%  (83/91)89%  (23.3/26)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CreateComicDialogTest100% (1/1)100% (4/4)86%  (50/58)86%  (16.3/19)
testConvertFrame (): void 100% (1/1)76%  (22/29)73%  (7.3/10)
setUp (): void 100% (1/1)96%  (22/23)99%  (6/6)
CreateComicDialogTest (): void 100% (1/1)100% (3/3)100% (1/1)
tearDown (): void 100% (1/1)100% (3/3)100% (2/2)
     
class CreateComicDialogTest$1100% (1/1)100% (2/2)100% (33/33)100% (7/7)
CreateComicDialogTest$1 (CreateComicDialogTest): void 100% (1/1)100% (6/6)100% (1/1)
run (): void 100% (1/1)100% (27/27)100% (6/6)

1// Jomic - a viewer for comic book archives.
2// Copyright (C) 2004-2008 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 javax.swing.SwingUtilities;
19 
20import junit.framework.TestCase;
21import net.sf.jomic.tools.StandardConstants;
22import net.sf.jomic.tools.TestTools;
23import net.sf.wraplog.Logger;
24 
25/**
26 *  TestCase for CreateComicDialog.
27 *
28 * @author    Thomas Aglassinger
29 */
30public class CreateComicDialogTest extends TestCase implements StandardConstants
31{
32    private boolean dialogOpened;
33    private Logger logger;
34    private CreateComicDialog newComicDialog;
35    private TestTools testTools;
36 
37    protected void setUp()
38        throws Exception {
39        super.setUp();
40        testTools = TestTools.instance();
41        dialogOpened = false;
42        newComicDialog = null;
43        logger = Logger.getLogger(CreateComicDialogTest.class);
44    }
45 
46    public void testConvertFrame() {
47 
48        SwingUtilities.invokeLater(
49                    new Runnable()
50                    {
51                        public void run() {
52                            newComicDialog = new CreateComicDialog();
53                            newComicDialog.setModal(false);
54                            newComicDialog.pack();
55                            newComicDialog.setVisible(true);
56                            dialogOpened = true;
57                        }
58                    });
59        while (!dialogOpened) {
60            try {
61                Thread.sleep(TICK);
62            } catch (InterruptedException interruption) {
63                logger.warn("ignoring interruption", interruption);
64            }
65        }
66        logger.debug("dialog opened");
67 
68        testTools.waitSomeTime();
69 
70//        JButton convertButton = convertDialog.getConvertButton();
71//        String targetDirName = testTools.getTestFileName(ConvertDialogTest.class, "testConvertFrame", null, null);
72//        File targetDir = testTools.getTestOutputFile(targetDirName);
73//
74//        assertFalse(convertButton.isEnabled());
75//        convertDialog.addComicToConvert(testTools.getTestComicFile());
76//        assertFalse(convertButton.isEnabled());
77//        convertDialog.setTargetDir(targetDir);
78//        assertTrue(convertButton.isEnabled());
79//
80//        testTools.waitSomeTime();
81//
82//        if (convertButton.isEnabled()) {
83//            convertButton.doClick();
84//            assertEquals(JOptionPane.OK_OPTION, convertDialog.getSelection());
85//            assertNotNull(convertDialog.getTargetDir());
86//
87//            File[] selectedFiles = convertDialog.getSelectedFiles();
88//
89//            assertNotNull(selectedFiles);
90//            testTools.assertGreaterThan(selectedFiles.length, 0);
91//        }
92        newComicDialog.dispose();
93    }
94 
95    protected void tearDown()
96        throws Exception {
97        super.tearDown();
98    }
99}

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