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

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