private IMarker[] getSortedMarkersFromFile(String fileName) throws JavaModelException { IJavaElement fileToScan = TestingUtils.elementFromProject(testProject, fileName); IMarker[] markers = TestingUtils.getAllMarkersInResource(fileToScan.getCorrespondingResource()); // the markers get sorted first by bug name, then by line number, just like // the QuickFixTestPackages, so we have a reliable way to fix them // so we can assert properties more accurately. TestingUtils.sortMarkersByPatterns(markers); return markers; }
private void assertOutputAndInputFilesMatch(String testResource) throws JavaModelException, IOException { URL expectedFile = getClass().getResource("/fixedClasses/" + testResource); IJavaElement actualFile = TestingUtils.elementFromProject(testProject, testResource); TestingUtils.assertOutputAndInputFilesMatch(expectedFile, actualFile); }
private void showEditorWindowForFile(String testResource) throws JavaModelException, PartInitException { JavaUI.openInEditor(TestingUtils.elementFromProject(testProject, testResource), true, true); }