}
}
@SuppressWarnings("restriction")
public static DiagramEditor loadTestWorkflow(String fileName, Object test) {
final LoadDispelFileAction loadDispel = new LoadDispelFileAction();
final Action a = new Action() { };
IWorkspaceRoot r = ResourcesPlugin.getWorkspace().getRoot();
loadDispel.setActivePart(a,
PlatformUI.getWorkbench().getActiveWorkbenchWindow(
).getActivePage().getActivePart());
IProject project = r.getProject("testProject");
IFile testFile = null;
try {
project.create(project.getWorkspace().newProjectDescription(
"testProject"), null);
project.open(null);
testFile = addFileToProject(project, new Path(fileName),
test.getClass().getResourceAsStream(fileName), null);
} catch (CoreException e) {
fail("Caught exception when creating project: " + e.getMessage());
}
loadDispel.selectionChanged(a, new StructuredSelection(testFile));
loadDispel.run(a);
DiagramEditorInput di = (DiagramEditorInput) PlatformUI.getWorkbench(
).getActiveWorkbenchWindow().getActivePage().getActiveEditor(
).getEditorInput();
IEditorPart ep = PlatformUI.getWorkbench(
).getActiveWorkbenchWindow().getActivePage().getActiveEditor();