Clover Coverage Report - Checkstyle
Coverage timestamp: Fri May 9 2008 10:48:13 EST
7   41   4   2.33
0   32   0.57   1.5
3     1.33  
2    
 
  AutomaticBeanTest       Line # 6 87.5% 0.875
3.02 6 3 3 0.5
  AutomaticBeanTest.TestBean       Line # 8 0% 0.0
2 1 1 1 1
 
  (1)
 
1    package com.puppycrawl.tools.checkstyle.api;
2   
3    import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
4    import junit.framework.TestCase;
5   
 
6    public class AutomaticBeanTest extends TestCase
7    {
 
8    private class TestBean extends AutomaticBean
9    {
10    private String mName = null;
11   
 
12  0 toggle public void setName(String aName)
13    {
14  0 mName = aName;
15    }
16    }
17   
18    DefaultConfiguration mConf = null;
19   
20    TestBean mTestBean = new TestBean();
21   
 
22  1 toggle public void setUp()
23    {
24  1 mConf = new DefaultConfiguration("testConf");
25    }
26   
 
27  1 toggle public void testNoSuchAttribute()
28    {
29  1 mConf.addAttribute("NonExisting", "doesn't matter");
30  1 try {
31  1 mTestBean.configure(mConf);
32  0 fail("AutomaticBean.configure() accepted nonexisting attribute name");
33    }
34    catch (CheckstyleException ex)
35    {
36    // expected exception
37    }
38  1 assertEquals(mTestBean.mName, null);
39   
40    }
41    }