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

FUSETOOLS-2276 - Incorporate 'MarkersRemoverValidatorIT.checkMarkers'… #1366

Merged
merged 1 commit into from May 17, 2018

Conversation

tsedmik
Copy link
Contributor

@tsedmik tsedmik commented May 16, 2018

… into UI tests

https://issues.jboss.org/browse/FUSETOOLS-2276

Signed-off-by: Tomáš Sedmík tsedmik@redhat.com

Pull Request Checklist

After this checklist is all checked or PR provides explanations for possible pass-through, please put the label "Ready for review" on the PR.

General

  • Did you use the Jira Issue number in the commit comments?
  • Did you set meaningful commit comments on each commit?
  • Did you sign off all commits for this PR? (git commit -s -m "jira issue number - your commit comment")

Functional

  • Did the CI job report a successful build?
  • Is the non-happy path working, too?

Maintainability

  • Are all Sonar reported issues fixed or can they be ignored?
  • Is there no duplicated code?
  • Are method-/class-/variable-names meaningful?

Tests

  • Are there unit-tests?
  • Are there integration tests (or at least a jira to tackle these)?
  • Do we need a new UI test?

Legal

  • Have you used the correct file header copyright comment?
  • Have you used the correct year in the headers of new files?

@tsedmik tsedmik requested review from a team as code owners May 16, 2018 09:32
List<Problem> problems = view.getProblems(ProblemType.ALL);
int count = 0;
for (Problem problem : problems) {
if (problem.getType().equals(FUSE_TOOLING_PROBLEM_TYPE)) {
Copy link
Member

Choose a reason for hiding this comment

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

it is best to invert equals to ensure no NPE (in case problem.getType() is returning null)

ProblemsView view = new ProblemsView();
view.open();
List<Problem> problems = view.getProblems(ProblemType.ALL);
int count = 0;
Copy link
Member

Choose a reason for hiding this comment

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

Do you think that you can use streams to simplify it?
something like
problems.stream().filter(problem -> FUSE_TOOLING_PROBLEM_TYPE.equals(problem.getType())).count();

or maybe:
problems.stream().map(Problem::getType).filter(FUSE_TOOLING_PROBLEM_TYPE::equals).count();

editor.activate();
CamelEditor.switchTab(SOURCE_TAB);
EditorManipulator.copyFileContentToCamelXMLEditor(ROUTE_WITHOUT_ERRORS);
CamelEditor.switchTab(DESIGN_TAB);
Copy link
Member

Choose a reason for hiding this comment

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

why do you need to switch tab to design? it should work without switching to design tab

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I buy some time with the switch to ensure that problems have enough time to emerge. If you insist on "do not change to design tab", I can rewrite it.

Copy link
Member

@apupier apupier May 16, 2018

Choose a reason for hiding this comment

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

wouldn't be safer to wait for Problems view job to be finished as it was done previously? or maybe do both?
I just fear that you will have the unstable test moved to your UI test instead of being in "normal" test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have to perform some "user" action, because EditorManipulator.copyFileContentToCamelXMLEditor does not invoke validation. Therefore I switch the tab. Once a user action is performed, validation is triggered and in getFuseToolingProblems is logic which wait until the Problems view job is finished. I believe it will be stable ;-)

Copy link
Member

Choose a reason for hiding this comment

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

strange that the validation is not triggered.
But let's go with that if you think it will be stable

* </ol>
*/
@Test
public void testProblemsOnGlobalElemets() {
Copy link
Member

Choose a reason for hiding this comment

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

typo testProblemsOnGlobalElemets -> testProblemsOnGlobalElements

@tsedmik tsedmik merged commit b8a41f8 into jbosstools:master May 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants