Skip to content

Commit

Permalink
205: getLaunchElementFor with field
Browse files Browse the repository at this point in the history
Task-Url: #205
  • Loading branch information
LorenzoBettini committed Aug 25, 2022
1 parent d82c9f1 commit 624f966
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public SWTBotTreeItem selectClass(String className, String packageName, String p
return selectAndExpand(classItem);
}

public void selectMethod(String methodName, String className, String packageName, String projectName) {
public void selectClassMember(String methodName, String className, String packageName, String projectName) {
SWTBotTreeItem selectClass = selectClass(className, packageName, projectName);
SWTBotTreeItem classNameNode = selectClass.expandNode(className);
classNameNode.select(methodName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ private SelectTestMethod(String testMethodName, String testClassName, String pac

@Override
public void run() {
PAGES.getPackageExplorer().selectMethod(testMethodName, testClassName, packageName, projectName);
PAGES.getPackageExplorer().selectClassMember(testMethodName, testClassName, packageName, projectName);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void runPitAtPackageAndPackageRootAndProjectLevel() throws CoreException
}

@Test
public void runPitOnTwoSelectedElementsShowDialogNoTestsFound() throws CoreException {
public void runPitOnTwoSelectedElementsShowsDialogNoTestsFound() throws CoreException {
PAGES.getPackageExplorer().selectFiles(TEST_PROJECT, FOO_BAR_PACKAGE,
FOO_CLASS + ".java", FOO_TEST_CLASS + ".java");
PAGES.getRunMenu().runPit();
Expand Down Expand Up @@ -166,4 +166,13 @@ public void runSingleTestMethod() throws CoreException {
"KILLED | " + TEST_PROJECT + " | foo.bar | foo.bar.Foo | 6 | replaced int return with 0 for foo/bar/Foo::doFoo ");
coverageReportGenerated(1, 100, 100, 2, 2);
}

@Test
public void runSingleFieldShowsDialogNoTestsFound() throws CoreException {
createMethod(FOO_TEST_CLASS, FOO_BAR_PACKAGE, TEST_PROJECT,
"int aField;\n");
PAGES.getPackageExplorer().selectClassMember("aField", FOO_TEST_CLASS, FOO_BAR_PACKAGE, TEST_PROJECT);
PAGES.getRunMenu().runPit();
new NoTestsFoundDialog(bot).assertAppears();
}
}

0 comments on commit 624f966

Please sign in to comment.