/** * Determines the most interesting frame for the user. When user * double-clicks on a failed test method, the editor will jump to the * location corresponding to that frame. * * @param trouble description of the test failure * @return string describing the chosen call-stack frame, or {@code null} if * no frame has been chosen */ public static String determineStackFrame(Trouble trouble) { String[] frames = trouble.getStackTrace(); return ((frames != null) && (frames.length != 0)) ? frames[frames.length - 1] : null; }
/** * Determines the most interesting frame for the user. * When user double-clicks on a failed test method, the editor will jump * to the location corresponding to that frame. * * @param trouble description of the test failure * @return string describing the chosen call-stack frame, * or {@code null} if no frame has been chosen */ static String determineStackFrame(Trouble trouble) { String[] frames = trouble.getStackTrace(); return ((frames != null) && (frames.length != 0)) ? frames[frames.length - 1] : null; }
/** */ @Override protected void addNotify() { Trouble trouble = testcase.getTrouble(); int stackTraceLength = trouble.getStackTrace() != null ? trouble.getStackTrace().length : 0; Node[] children = new Node[stackTraceLength]; TestRunnerNodeFactory nodeFactory = Manager.getInstance().getNodeFactory(); for (int i = 0; i < stackTraceLength; i++) { if (i == 0 && stackTraceLength >= 2) { children[i] = nodeFactory.createCallstackFrameNode(trouble.getStackTrace()[1], trouble.getStackTrace()[0]); } else { children[i] = nodeFactory.createCallstackFrameNode(trouble.getStackTrace()[i], null); } } add(children); } }
String[] stArray = tr.getStackTrace(); if (stArray == null){ tr.setStackTrace(new String[]{line}); setComparisonFailure(tr, line); } else { List<String> stList = new ArrayList(Arrays.asList(trouble.getStackTrace())); if (!line.startsWith(stList.get(stList.size()-1))){ stList.add(line);
@Override @NbBundle.Messages("LBL_CopyStackTrace=&Copy Stack Trace") public Action[] getActions(boolean context) { List<Action> actions = new ArrayList<Action>(); if ((testcase.getTrouble() != null) && (testcase.getTrouble().getComparisonFailure() != null)){ actions.add(new DiffViewAction(testcase)); } if (testcase.getTrouble() != null && testcase.getTrouble().getStackTrace() != null) { StringBuilder callStack = new StringBuilder(); for(String stack : testcase.getTrouble().getStackTrace()) { if(stack != null) { callStack.append(stack.concat("\n")); } } if (callStack.length() > 0) { final String trace = callStack.toString(); actions.add(new AbstractAction(Bundle.LBL_CopyStackTrace()) { @Override public void actionPerformed(ActionEvent e) { Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(trace), null); } }); } } return actions.toArray(new Action[actions.size()]); }
String[] stArray = trouble.getStackTrace(); if (stArray == null){ trouble.setStackTrace(new String[]{line}); List<String> stList = new ArrayList(Arrays.asList(testcase.getTrouble().getStackTrace())); if (!line.startsWith(stList.get(stList.size()-1))){ stList.add(line);
if (INLINE_RESULTS && testcase.getTrouble() != null && testcase.getTrouble().getStackTrace() != null && testcase.getTrouble().getStackTrace().length > 0) { try { cause = XMLUtil.toElementContent(testcase.getTrouble().getStackTrace()[0]).replace("\n", " "); // NOI18N } catch (CharConversionException ex) {
String[] st = methodNode.getTestcase().getTrouble().getStackTrace(); if (st != null) { stack.append("\n"); String[] st = methodNode.getTestcase().getTrouble().getStackTrace(); if ((st != null) && (st.length > 0)) { int index = st.length - 1;
String[] st = methodNode.getTestcase().getTrouble().getStackTrace(); if (st != null) { stack.append("\n"); String[] st = methodNode.getTestcase().getTrouble().getStackTrace(); if ((st != null) && (st.length > 0)) { int index = st.length - 1;
String[] st = methodNode.getTestcase().getTrouble().getStackTrace(); if ((st != null) && (st.length > 0)) { int index = st.length - 1;
public void openCallstackFrame(Node node, String frameInfo) { if(!(node instanceof TestNGMethodNode)) { return; } TestNGMethodNode methodNode = (TestNGMethodNode) UIJavaUtils.getTestMethodNode(node); FileLocator locator = methodNode.getTestcase().getSession().getFileLocator(); if (locator == null) { return; } final int[] lineNumStorage = new int[1]; FileObject file = UIJavaUtils.getFile(frameInfo, lineNumStorage, locator); if ((file == null) && (methodNode.getTestcase().getTrouble() != null)) { String[] st = methodNode.getTestcase().getTrouble().getStackTrace(); if ((st != null) && (st.length > 0)) { file = UIJavaUtils.getFile(st[st.length - 1], lineNumStorage, locator); } } UIJavaUtils.openFile(file, lineNumStorage[0]); } }