Clover Coverage Report - EasyMock 3.0
Coverage timestamp: sam. mai 8 2010 14:37:27 CEST
10   67   6   1,67
0   39   0,6   6
6     1  
1    
 
  ClassInstantiatorFactoryTest       Line # 32 10 0% 6 0 100% 1.0
 
  (8)
 
1    /**
2    * Copyright 2001-2010 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10    * Unless required by applicable law or agreed to in writing, software
11    * distributed under the License is distributed on an "AS IS" BASIS,
12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    * See the License for the specific language governing permissions and
14    * limitations under the License.
15    */
16   
17    package org.easymock.tests;
18   
19    import static org.junit.Assert.*;
20   
21    import org.easymock.internal.ClassInstantiatorFactory;
22    import org.easymock.internal.DefaultClassInstantiator;
23    import org.easymock.internal.IClassInstantiator;
24    import org.easymock.internal.ObjenesisClassInstantiator;
25    import org.junit.After;
26    import org.junit.Before;
27    import org.junit.Test;
28   
29    /**
30    * @author Henri Tremblay
31    */
 
32    public class ClassInstantiatorFactoryTest {
33   
 
34  8 toggle @Before
35    public void setUp() throws Exception {
36    }
37   
 
38  8 toggle @After
39    public void tearDown() throws Exception {
40    }
41   
 
42  2 toggle @Test
43    public void getInstantiator_Default() {
44  2 final IClassInstantiator instantiator = ClassInstantiatorFactory.getInstantiator();
45  2 assertTrue(instantiator instanceof ObjenesisClassInstantiator);
46    }
47   
 
48  2 toggle @Test
49    public void getInstantiator_Overriden() {
50  2 ClassInstantiatorFactory.setInstantiator(new DefaultClassInstantiator());
51  2 final IClassInstantiator instantiator = ClassInstantiatorFactory.getInstantiator();
52  2 assertTrue(instantiator instanceof DefaultClassInstantiator);
53    }
54   
 
55  2 toggle @Test
56    public void getInstantiator_BackToDefault() {
57  2 ClassInstantiatorFactory.setInstantiator(new DefaultClassInstantiator());
58  2 ClassInstantiatorFactory.setDefaultInstantiator();
59  2 final IClassInstantiator instantiator = ClassInstantiatorFactory.getInstantiator();
60  2 assertTrue(instantiator instanceof ObjenesisClassInstantiator);
61    }
62   
 
63  2 toggle @Test
64    public void getJVM() {
65  2 assertEquals(System.getProperty("java.vm.vendor"), ClassInstantiatorFactory.getJVM());
66    }
67    }