/** Initialize the frame. */ public CloudStackFrame( @NotNull Project project, @NotNull StackFrame frame, @NotNull List<Variable> variableTable, @Nullable List<Variable> evaluatedExpressions, @NotNull ServerToIdeFileResolver fileResolver) { this.frame = frame; this.variableTable = variableTable; this.evaluatedExpressions = evaluatedExpressions; String path = frame.getLocation().getPath(); if (!Strings.isNullOrEmpty(path)) { sourcePosition = XDebuggerUtil.getInstance() .createPosition( fileResolver.getFileFromPath(project, path), frame.getLocation().getLine() - 1); } else { sourcePosition = null; } }
public void testGetFileFromPath_fileName() { ServerToIdeFileResolver fileResolver = new ServerToIdeFileResolver(); assertEquals( class1.getContainingFile().getVirtualFile(), fileResolver.getFileFromPath(getProject(), "Class.java")); }
public void testGetFileFromPath_packageClass() { ServerToIdeFileResolver fileResolver = new ServerToIdeFileResolver(); assertEquals( class1.getContainingFile().getVirtualFile(), fileResolver.getFileFromPath(getProject(), "com/java/pkg/Class.java")); }
public void ignore_testGetFileFromPath_fullPath() { // TODO(joaomartins): Find out why project.getBaseDir() is returning a different tempDir to // myFixture. PsiFile file1 = this.myFixture.addFileToProject("path/to/prj/src/main/com/java/package/Class.java", ""); this.myFixture.addFileToProject("path/to/prj/src/test/com/java/package/ClassTest.java", ""); ServerToIdeFileResolver fileResolver = new ServerToIdeFileResolver(); assertEquals( fileResolver.getFileFromPath( getProject(), "path/to/prj/src/main/com/java/package/Class.java"), file1.getVirtualFile()); }
VirtualFile classFile = mock(VirtualFile.class); when(classFile.getUrl()).thenReturn("file:///URL"); when(fileResolver.getFileFromPath( isA(Project.class), eq("app/mod/src/main/java/b/f/pkg/Class.java"))) .thenReturn(classFile);
final VirtualFile file = fileResolver.getFileFromPath(currentProject, path); final int line = serverBreakpoint.getLocation().getLine() - 1; if (file == null) {
final VirtualFile file = fileResolver.getFileFromPath(currentProject, path); final int line = serverBreakpoint.getLocation().getLine() - 1; if (file == null) {