Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
12   68   4   3
0   32   0.33   4
4     1  
1    
 
  InterruptExceptionTest       Line # 27 12 4 100% 1.0
 
  (3)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2013, Michael Meyling <mime@qedeq.org>.
4    *
5    * "Hilbert II" is free software; you can redistribute
6    * it and/or modify it under the terms of the GNU General Public
7    * License as published by the Free Software Foundation; either
8    * version 2 of the License, or (at your option) any later version.
9    *
10    * This program is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13    * GNU General Public License for more details.
14    */
15   
16    package org.qedeq.kernel.se.visitor;
17   
18    import org.qedeq.base.test.QedeqTestCase;
19    import org.qedeq.kernel.se.common.DefaultModuleAddress;
20    import org.qedeq.kernel.se.common.ModuleContext;
21   
22    /**
23    * Test class.
24    *
25    * @author Michael Meyling
26    */
 
27    public class InterruptExceptionTest extends QedeqTestCase {
28   
29    private InterruptException ex1;
30   
31    private InterruptException ex2;
32   
33    private InterruptException ex3;
34   
 
35  3 toggle public void setUp() throws Exception {
36  3 super.setUp();
37  3 this.ex1 = new InterruptException(new ModuleContext(
38    new DefaultModuleAddress()));
39  3 this.ex2 = new InterruptException(new ModuleContext(
40    new DefaultModuleAddress()));
41  3 this.ex3 = new InterruptException(new ModuleContext(
42    new DefaultModuleAddress(true, "another")));
43    }
44   
45    /**
46    * Test constructor.
47    */
 
48  1 toggle public void testConstructor() throws Exception {
49  1 assertEquals(87001, ex1.getErrorCode());
50  1 assertEquals("Process execution was canceled", ex1.getMessage());
51  1 assertEquals(new ModuleContext(new DefaultModuleAddress()), ex1.getContext());
52    }
53   
54    /**
55    * Test hash code generation.
56    */
 
57  1 toggle public void testHashCode() throws Exception {
58  1 assertTrue(ex1.hashCode() == ex2.hashCode());
59  1 assertFalse(ex1.hashCode() == ex3.hashCode());
60    }
61   
 
62  1 toggle public void testEqualsObject() throws Exception {
63  1 assertEquals(ex1, ex2);
64  1 assertFalse(ex1.equals(ex3));
65  1 assertFalse(ex3.equals(ex2));
66    }
67   
68    }