Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework top test menu items #4980

Merged
merged 1 commit into from
May 31, 2017
Merged

Conversation

davidfestal
Copy link
Contributor

What does this PR do?

This PR reworks the behaviour of the top menu Run -> Test menu items.
Until now, these menus items were based on the Java Editor only. So when no Java Editor had the focus, the menu items were disabled, even with a Java source file selected in File Explorer. This was leading to an inconsistent behaviour between the Project Explorer Test contextual menu and the Run -> Test top menu item.

With this PR, the proposed test menu items are based on the current resource, either from the project explorer or the currently opened editor, according to which one has the focus. This brings back consistency between both menus.

What issues does this PR fix or reference?

https://issues.jboss.org/browse/CHE-227

Changelog

Provide a consistent behaviour between the Run -> Test top menu item and the Run Test project explorer contextual menu.

Release Notes

Provide a consistent behaviour between the Run -> Test top menu item and the Run Test project explorer contextual menu.

Docs PR

https://issues.jboss.org/browse/CHE-227


Signed-off-by: David Festal <dfestal@redhat.com>
@codenvy-ci
Copy link

Can one of the admins verify this patch?

@davidfestal
Copy link
Contributor Author

@l0rd Could you review this one ?

@benoitf
Copy link
Contributor

benoitf commented May 9, 2017

ci-build

@codenvy-ci
Copy link

@davidfestal
Copy link
Contributor Author

@l0rd @benoitf do you think this is ready for merge ?

@benoitf benoitf requested a review from vparfonov May 11, 2017 07:43
@benoitf
Copy link
Contributor

benoitf commented May 11, 2017

@vparfonov ?

@benoitf benoitf requested a review from slemeur May 11, 2017 07:44
@benoitf benoitf added kind/enhancement A feature request - must adhere to the feature request template. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. labels May 11, 2017
@davidfestal davidfestal mentioned this pull request May 11, 2017
@davidfestal
Copy link
Contributor Author

@vparfonov @slemeur is there anything more I should do in order to have this PR merged ?

@vparfonov
Copy link
Contributor

Need QA confirmation

@vparfonov vparfonov requested a review from musienko-maxim May 16, 2017 16:31
e.getPresentation().setVisible(true);

String projectType = project.getType();
boolean enable = "maven".equals(projectType);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we need here checking for "maven" what about "javac" project?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vparfonov : because for the moment the Java (JUnit / TestNG) testing feature is only supported on maven Java projects. that was from the beginning of this feature afaik. But sure as soon as this limitation is dropped, we'll be able to remove this test.

@vparfonov
Copy link
Contributor

Basically ok for me except adding checking on "maven" project type. Why we need it?

@musienko-maxim
Copy link
Contributor

musienko-maxim commented May 18, 2017

@davidfestal
So, after selenium cycle tests we have not found regression. But we have 1 question.
We have a specific test with TestNg xml suite. In previous version we could launch of the 'TestNG XML suite' menu from any selected item of the project. But on this moment we cannot launch from this menu (becouse this one is disabled) if we select a class from /src/main/java or /src/test/javaaa folder. Is it bug or feature? More details in the screencast:
anim

@davidfestal
Copy link
Contributor Author

But on this moment we cannot launch from this menu (becouse this one is disabled) if we select a class from /src/main/java or /src/test/javaaa folder. Is it bug or feature

Well, when reworking the testing menu, I tried to fix inconsistencies in the overall behavior, and thus had to understand / rethink the menu activation rules. And it seemed to me that, when you're explicitly requesting tests on a Java file, the aim is not to start a test whose input is a specific unrelated XML file. So when I disabled the TestNG XML Suite option in this case I just saw this as the expected behavior of the Testing feature. But I may have been wrong.

@davidfestal
Copy link
Contributor Author

davidfestal commented May 29, 2017

@musienko-maxim are you OK with my comment and is it possible to merge now ?

@musienko-maxim
Copy link
Contributor

For me ok.

@benoitf
Copy link
Contributor

benoitf commented May 29, 2017

@vparfonov ? can we merge

@benoitf
Copy link
Contributor

benoitf commented May 30, 2017

ci-build

@codenvy-ci
Copy link

@benoitf benoitf merged commit d082b32 into eclipse-che:master May 31, 2017
@benoitf benoitf added this to the 5.12.0 milestone May 31, 2017
@benoitf benoitf removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label May 31, 2017
@benoitf benoitf assigned benoitf and davidfestal and unassigned benoitf May 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants