Lines 155-173
Link Here
|
155 |
} |
155 |
} |
156 |
|
156 |
|
157 |
static void openCallstackFrame(Node node, String frameInfo) { |
157 |
static void openCallstackFrame(Node node, String frameInfo) { |
158 |
JUnitTestMethodNode methodNode = getTestMethodNode(node); |
158 |
// #213935 - copied from org.netbeans.modules.maven.junit.nodes.OutputUtils |
159 |
FileLocator locator = methodNode.getTestcase().getSession().getFileLocator(); |
159 |
JUnitTestMethodNode methodNode = getTestMethodNode(node); |
160 |
if (locator == null){ |
160 |
FileLocator locator = methodNode.getTestcase().getSession().getFileLocator(); |
161 |
return; |
161 |
if (locator == null) { |
|
|
162 |
return; |
163 |
} |
164 |
FileObject testfo = methodNode.getTestcase().getClassFileObject(); |
165 |
final int[] lineNumStorage = new int[1]; |
166 |
FileObject file = getFile(frameInfo, lineNumStorage, locator); |
167 |
//lineNumStorage -1 means no regexp for stacktrace was matched. |
168 |
if ((file == null) && (methodNode.getTestcase().getTrouble() != null) && lineNumStorage[0] == -1) { |
169 |
//213935 we could not recognize the stack trace line and map it to known file |
170 |
//if it's a failure text, grab the testcase's own line from the stack. |
171 |
String[] st = methodNode.getTestcase().getTrouble().getStackTrace(); |
172 |
if ((st != null) && (st.length > 0)) { |
173 |
int index = st.length - 1; |
174 |
//213935 we need to find the testcase linenumber to jump to. |
175 |
// and ignore the infrastructure stack lines in the process |
176 |
while (!testfo.equals(file) && index != -1) { |
177 |
file = getFile(st[index], lineNumStorage, locator); |
178 |
index = index - 1; |
179 |
} |
162 |
} |
180 |
} |
163 |
final int[] lineNumStorage = new int[1]; |
181 |
} |
164 |
FileObject file = getFile(frameInfo, lineNumStorage, locator); |
182 |
Utils.openFile(file, lineNumStorage[0]); |
165 |
if ((file == null) && (methodNode.getTestcase().getTrouble() != null)){ |
|
|
166 |
String[] st = methodNode.getTestcase().getTrouble().getStackTrace(); |
167 |
if ((st != null) && (st.length > 0)) |
168 |
file = getFile(st[st.length - 1], lineNumStorage, locator); |
169 |
} |
170 |
Utils.openFile(file, lineNumStorage[0]); |
171 |
} |
183 |
} |
172 |
|
184 |
|
173 |
/** |
185 |
/** |