| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.qedeq.base.utility; |
| 17 |
|
|
| 18 |
|
import org.qedeq.base.test.QedeqTestCase; |
| 19 |
|
|
| 20 |
|
|
| 21 |
|
@link |
| 22 |
|
|
| 23 |
|
@author |
| 24 |
|
|
|
|
|
| 95% |
Uncovered Elements: 1 (20) |
Complexity: 6 |
Complexity Density: 0.4 |
|
| 25 |
|
public class YodaUtilityTest extends QedeqTestCase { |
| 26 |
|
|
| 27 |
|
|
| 28 |
|
private final static int secret = 967123; |
| 29 |
|
|
| 30 |
|
|
| 31 |
|
private int changeMe = 815; |
| 32 |
|
|
| 33 |
|
|
| 34 |
|
@link |
| 35 |
|
|
| 36 |
|
@throws |
| 37 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
| 38 |
1
|
public void testGetFieldValue() throws Exception {... |
| 39 |
1
|
assertEquals(new Integer(secret), YodaUtility.getFieldValue(this, "secret")); |
| 40 |
1
|
assertEquals(getOutdir(), YodaUtility.getFieldValue(this, "outdir")); |
| 41 |
|
} |
| 42 |
|
|
| 43 |
|
|
| 44 |
|
@link |
| 45 |
|
|
| 46 |
|
@throws |
| 47 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 48 |
1
|
public void testGetField() throws Exception {... |
| 49 |
1
|
assertEquals(this.getClass().getDeclaredField("secret"), |
| 50 |
|
YodaUtility.getField(this, "secret")); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
|
| 54 |
|
@link |
| 55 |
|
|
| 56 |
|
@throws |
| 57 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 58 |
1
|
public void testExecuteMethod() throws Exception {... |
| 59 |
1
|
assertEquals(getOutdir(), YodaUtility.executeMethod(this, "getOutdir", |
| 60 |
|
new Class[]{}, new Object[]{})); |
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
|
| 64 |
|
@link |
| 65 |
|
|
| 66 |
|
@throws |
| 67 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1
PASS
|
|
| 68 |
1
|
public void testExistsMethod() throws Exception {... |
| 69 |
1
|
assertTrue(YodaUtility.existsMethod(this.getClass(), "getOutdir", |
| 70 |
|
new Class[]{})); |
| 71 |
1
|
assertFalse(YodaUtility.existsMethod(this.getClass(), "getOutdir", |
| 72 |
|
new Class[]{Integer.TYPE})); |
| 73 |
1
|
assertFalse(YodaUtility.existsMethod(this.getClass(), "getTevqOutdir", |
| 74 |
|
new Class[]{})); |
| 75 |
1
|
assertTrue(YodaUtility.existsMethod(this.getClass(), "testExistsMethod", |
| 76 |
|
new Class[]{})); |
| 77 |
|
} |
| 78 |
|
|
| 79 |
|
|
| 80 |
|
@link |
| 81 |
|
|
| 82 |
|
@throws |
| 83 |
|
|
|
|
|
| 85.7% |
Uncovered Elements: 1 (7) |
Complexity: 2 |
Complexity Density: 0.29 |
1
PASS
|
|
| 84 |
1
|
public void testSetFieldValue() throws Exception {... |
| 85 |
1
|
try { |
| 86 |
1
|
YodaUtility.setFieldContent(this, "secret", new Integer(37846)); |
| 87 |
|
|
| 88 |
0
|
fail("Exception expected"); |
| 89 |
|
} catch (Exception e) { |
| 90 |
|
|
| 91 |
|
} |
| 92 |
1
|
changeMe = 0; |
| 93 |
1
|
YodaUtility.setFieldContent(this, "changeMe", new Integer(37846)); |
| 94 |
1
|
assertEquals(37846, changeMe);; |
| 95 |
|
} |
| 96 |
|
|
| 97 |
|
|
| 98 |
|
} |