1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
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 |
31 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (16) |
Complexity: 6 |
Complexity Density: 0,6 |
|
32 |
|
public class ClassInstantiatorFactoryTest { |
33 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
34 |
8
|
@Before... |
35 |
|
public void setUp() throws Exception { |
36 |
|
} |
37 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
38 |
8
|
@After... |
39 |
|
public void tearDown() throws Exception { |
40 |
|
} |
41 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
1
PASS
|
|
42 |
2
|
@Test... |
43 |
|
public void getInstantiator_Default() { |
44 |
2
|
final IClassInstantiator instantiator = ClassInstantiatorFactory.getInstantiator(); |
45 |
2
|
assertTrue(instantiator instanceof ObjenesisClassInstantiator); |
46 |
|
} |
47 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0,33 |
1
PASS
|
|
48 |
2
|
@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 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0,25 |
1
PASS
|
|
55 |
2
|
@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 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
63 |
2
|
@Test... |
64 |
|
public void getJVM() { |
65 |
2
|
assertEquals(System.getProperty("java.vm.vendor"), ClassInstantiatorFactory.getJVM()); |
66 |
|
} |
67 |
|
} |