Lines 29-34
Link Here
|
29 |
* The Original Software is NetBeans. The Initial Developer of the Original |
29 |
* The Original Software is NetBeans. The Initial Developer of the Original |
30 |
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2008 Sun |
30 |
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2008 Sun |
31 |
* Microsystems, Inc. All Rights Reserved. |
31 |
* Microsystems, Inc. All Rights Reserved. |
|
|
32 |
* |
33 |
* markiewb@netbeans.org |
32 |
* |
34 |
* |
33 |
* If you wish your version of this file to be governed by only the CDDL |
35 |
* If you wish your version of this file to be governed by only the CDDL |
34 |
* or only the GPL Version 2, indicate your decision by adding |
36 |
* or only the GPL Version 2, indicate your decision by adding |
Lines 58-73
Link Here
|
58 |
*/ |
60 |
*/ |
59 |
final class JumpAction extends AbstractAction { |
61 |
final class JumpAction extends AbstractAction { |
60 |
|
62 |
|
|
|
63 |
public static JumpAction createForMethod (JUnitTestMethodNode node, boolean isFailingMethod) { |
64 |
return new JumpAction(node, isFailingMethod); |
65 |
} |
66 |
|
61 |
/** */ |
67 |
/** */ |
62 |
private final Node node; |
68 |
private final Node node; |
63 |
/** */ |
69 |
/** */ |
64 |
private final String callstackFrameInfo; |
70 |
private final String callstackFrameInfo; |
|
|
71 |
private boolean isFailingMethod = false; |
65 |
|
72 |
|
66 |
/** Creates a new instance of JumpAction */ |
73 |
/** Creates a new instance of JumpAction */ |
67 |
public JumpAction(Node node, String callstackFrameInfo) { |
74 |
public JumpAction(Node node, String callstackFrameInfo) { |
68 |
this.node = node; |
75 |
this.node = node; |
69 |
this.callstackFrameInfo = callstackFrameInfo; |
76 |
this.callstackFrameInfo = callstackFrameInfo; |
70 |
} |
77 |
} |
|
|
78 |
/** |
79 |
* |
80 |
* @param node |
81 |
* @param isFailingMethod |
82 |
*/ |
83 |
private JumpAction(JUnitTestMethodNode node, boolean isFailingMethod) { |
84 |
this(node, null); |
85 |
this.isFailingMethod = isFailingMethod; |
86 |
} |
71 |
|
87 |
|
72 |
/** |
88 |
/** |
73 |
* If the <code>callstackFrameInfo</code> is not <code>null</code>, |
89 |
* If the <code>callstackFrameInfo</code> is not <code>null</code>, |
Lines 78-85
Link Here
|
78 |
OutputUtils.openTestsuite((TestsuiteNode)node); |
94 |
OutputUtils.openTestsuite((TestsuiteNode)node); |
79 |
} else if (node instanceof CallstackFrameNode){ |
95 |
} else if (node instanceof CallstackFrameNode){ |
80 |
OutputUtils.openCallstackFrame(node, callstackFrameInfo); |
96 |
OutputUtils.openCallstackFrame(node, callstackFrameInfo); |
81 |
} else if (node instanceof JUnitTestMethodNode){ |
97 |
} else if (node instanceof JUnitTestMethodNode) { |
82 |
OutputUtils.openTestMethod((JUnitTestMethodNode)node); |
98 |
if (isFailingMethod) { |
|
|
99 |
// if method failed, then find the failing line |
100 |
// within the testMethod using the stacktrace |
101 |
OutputUtils.openCallstackFrame(node, ""); |
102 |
} else { |
103 |
OutputUtils.openTestMethod((JUnitTestMethodNode) node); |
104 |
} |
83 |
} |
105 |
} |
84 |
} |
106 |
} |
85 |
|
107 |
|