Skip to content

fix the bug: Cannot run from src/test anymore bug #413 - #232

Merged
Andy Xu(devdiv) (andxu) merged 5 commits into
masterfrom
andy_test_cp
Sep 27, 2018
Merged

Andy Xu(devdiv) (andxu) merged 5 commits into
masterfrom
andy_test_cp

Conversation

@andxu

Copy link
Copy Markdown
Contributor

No description provided.

* @param classpathEntry classpath entry
* @return whether this classpath entry is only used in test
*/
private static boolean forTestOnly(final IClasspathEntry classpathEntry) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forTestOnly -> isTest

}
}
}
} catch (JavaModelException e) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract the logic to a function getTestFolders(IJavaProject project).

if (!testFolders.isEmpty()) {
try {

List<Object> mainClassesInTestFolder = new ArrayList<>();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boolean isFound = false;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot change the value isFound at the callback

public void acceptSearchMatch(SearchMatch match) {
Object element = match.getElement();
if (element instanceof IJavaElement) {
mainClassesInTestFolder.add(element);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isFound = true;

@andxu
Andy Xu(devdiv) (andxu) merged commit 6f990d0 into master Sep 27, 2018
@andxu
Andy Xu(devdiv) (andxu) deleted the andy_test_cp branch September 27, 2018 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants