| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
package org.fest.swing.annotation; |
| 16 |
|
|
| 17 |
|
import java.lang.reflect.AnnotatedElement; |
| 18 |
|
import java.lang.reflect.Method; |
| 19 |
|
|
| 20 |
|
|
| 21 |
|
|
| 22 |
|
@link |
| 23 |
|
|
| 24 |
|
@author |
| 25 |
|
|
|
|
|
| 84.6% |
Uncovered Elements: 4 (26) |
Complexity: 11 |
Complexity Density: 0.69 |
|
| 26 |
|
public final class GUITestFinder { |
| 27 |
|
|
| 28 |
|
|
| 29 |
|
@link |
| 30 |
|
|
| 31 |
|
@param |
| 32 |
|
@param |
| 33 |
|
@return@link |
| 34 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 35 |
5
|
public static boolean isGUITest(Class<?> type, Method method) {... |
| 36 |
5
|
return isGUITest(type) || isGUITest(method) || isSuperClassGUITest(type, method); |
| 37 |
|
} |
| 38 |
|
|
|
|
|
| 86.7% |
Uncovered Elements: 2 (15) |
Complexity: 5 |
Complexity Density: 0.56 |
|
| 39 |
2
|
private static boolean isSuperClassGUITest(Class<?> type, Method method) {... |
| 40 |
2
|
Class<?> superclass = type.getSuperclass(); |
| 41 |
3
|
while (superclass != null) { |
| 42 |
2
|
if (isGUITest(superclass)) return true; |
| 43 |
2
|
Method overriden = method(superclass, method.getName(), method.getParameterTypes()); |
| 44 |
1
|
if (overriden != null && isGUITest(overriden)) return true; |
| 45 |
1
|
superclass = superclass.getSuperclass(); |
| 46 |
|
} |
| 47 |
1
|
return false; |
| 48 |
|
} |
| 49 |
|
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 4 |
Complexity Density: 0.8 |
|
| 50 |
2
|
private static Method method(Class<?> type, String methodName, Class<?>[] parameterTypes) {... |
| 51 |
2
|
try { |
| 52 |
2
|
return type.getDeclaredMethod(methodName, parameterTypes); |
| 53 |
|
} catch (SecurityException e) { |
| 54 |
0
|
return null; |
| 55 |
|
} catch (NoSuchMethodException e) { |
| 56 |
1
|
return null; |
| 57 |
|
} catch (RuntimeException e) { |
| 58 |
0
|
return null; |
| 59 |
|
} |
| 60 |
|
} |
| 61 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 62 |
11
|
private static boolean isGUITest(AnnotatedElement annotatedElement) {... |
| 63 |
11
|
return annotatedElement.isAnnotationPresent(GUITest.class); |
| 64 |
|
} |
| 65 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 66 |
|
private GUITestFinder() {}... |
| 67 |
|
} |