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

Che Java Test Runner Plugin #2157

Closed

Conversation

Mirage20
Copy link

What does this PR do?

This pull request implements Java unit test runner plugin for che, which enables users to easily run Java unit tests within the IDE and view/navigate the test results.

Features

  • Supports common test frameworks : JUnit 3.x, JUnit 4.x, TestNG
  • Supports Maven project types.
  • Main menu and context menu items for running test cases.
  • Able to run per class and per project tests. (Or per suite if TestNG with testng.xml suite)
  • UI notification about the progress and result.
  • UI (Information view) for show the test results.
  • Easy navigation for failing results. (Tree navigation for classes and methods)
  • Able to view stack trace and assertion difference.
  • Able to jump to the failing class and the line from the test result view.
  • Provide extensible framework for adding new test engines.

Tests written?

Yes

Documentation

Plugin Documentration: https://docs.google.com/document/d/1BclPyGRjgExWwgxqBmb-CoHuRMxKsW8yRVVa3gP7pYI/edit?usp=sharing

Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
…ting-ide

Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
…me, method and line numbers to the dto

Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
…GUI, added goto failing class to the GUI

Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
…m navigation pannel

Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
…d user experiance

Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
…rces

Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
…le structure

Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Copy link
Contributor

@skabashnyuk skabashnyuk left a comment

Choose a reason for hiding this comment

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

Please respond to all my comments.

<parent>
<artifactId>che-java-testing-classpath</artifactId>
<groupId>org.eclipse.che.plugin</groupId>
<version>4.7.0-RC2-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

sync with version in master

Copy link
Author

Choose a reason for hiding this comment

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

updated

<parent>
<artifactId>che-plugin-java-test-runner-parent</artifactId>
<groupId>org.eclipse.che.plugin</groupId>
<version>4.7.0-RC2-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

sync with version in master

Copy link
Author

Choose a reason for hiding this comment

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

updated

<parent>
<artifactId>che-java-testing-core</artifactId>
<groupId>org.eclipse.che.plugin</groupId>
<version>4.7.0-RC2-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

sync with version in master

Copy link
Author

Choose a reason for hiding this comment

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

updated

import org.eclipse.che.ide.ext.java.testing.core.client.view.navigation.nodes.TestResultMethodNode;
import org.eclipse.che.ide.ext.java.testing.core.shared.TestResult;
/**
*
Copy link
Contributor

Choose a reason for hiding this comment

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

?

import javax.validation.constraints.NotNull;
import java.util.List;
/**
*
Copy link
Contributor

Choose a reason for hiding this comment

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

javadoc

Copy link
Author

Choose a reason for hiding this comment

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

updated

<parent>
<artifactId>che-plugin-java-test-runner-parent</artifactId>
<groupId>org.eclipse.che.plugin</groupId>
<version>4.7.0-RC2-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

sync with version in master

Copy link
Author

Choose a reason for hiding this comment

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

updated

<parent>
<artifactId>che-java-testing-testng</artifactId>
<groupId>org.eclipse.che.plugin</groupId>
<version>4.7.0-RC2-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

sync with version in master

Copy link
Author

Choose a reason for hiding this comment

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

updated

<parent>
<artifactId>che-java-testing-testng</artifactId>
<groupId>org.eclipse.che.plugin</groupId>
<version>4.7.0-RC2-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

sync with version in master

Copy link
Author

Choose a reason for hiding this comment

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

updated

<parent>
<artifactId>che-plugin-java-test-runner-parent</artifactId>
<groupId>org.eclipse.che.plugin</groupId>
<version>4.7.0-RC2-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

sync with version in master

Copy link
Author

Choose a reason for hiding this comment

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

updated

<parent>
<artifactId>che-plugin-parent</artifactId>
<groupId>org.eclipse.che.plugin</groupId>
<version>4.7.0-RC2-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

sync with version in master

Copy link
Author

Choose a reason for hiding this comment

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

updated

Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
…ner plugin

Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
import java.util.Map;

import static org.eclipse.che.ide.api.notification.StatusNotification.DisplayMode.FLOAT_MODE;
import static org.eclipse.che.ide.api.notification.StatusNotification.Status.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

avoid "*" imports

Copy link
Author

Choose a reason for hiding this comment

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

removed wildcard imports

import java.util.Map;

import static org.eclipse.che.ide.api.notification.StatusNotification.DisplayMode.FLOAT_MODE;
import static org.eclipse.che.ide.api.notification.StatusNotification.Status.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

avoid "*" imports

Copy link
Author

Choose a reason for hiding this comment

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

removed wildcard imports

}

@Override
protected void updateProjectAction(ActionEvent e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need empty method here?

Copy link
Author

Choose a reason for hiding this comment

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

removed

import java.util.Map;

import static org.eclipse.che.ide.api.notification.StatusNotification.DisplayMode.FLOAT_MODE;
import static org.eclipse.che.ide.api.notification.StatusNotification.Status.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

avoid "*" imports

Copy link
Author

Choose a reason for hiding this comment

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

removed wildcard imports

}

@Override
protected void updateProjectAction(ActionEvent e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need empty method here?

Copy link
Author

Choose a reason for hiding this comment

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

removed

@vparfonov
Copy link
Contributor

@Mirage20 please answer on our comments, we want to make QA circle with your branch and merge it

thanks for your work

Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
Copy link
Contributor

@skabashnyuk skabashnyuk left a comment

Choose a reason for hiding this comment

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

Please answer to my comments.


/**
* JUnit implementation for the test runner service.
*
Copy link
Contributor

@skabashnyuk skabashnyuk Oct 31, 2016

Choose a reason for hiding this comment

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

Please declare all parameters that this class can accept in execute method.

Copy link
Author

Choose a reason for hiding this comment

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

Updated the javadoc with parameters.


/**
* TestNG implementation for the test runner service.
*
Copy link
Contributor

@skabashnyuk skabashnyuk Oct 31, 2016

Choose a reason for hiding this comment

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

Please declare all parameters that this class can accept in execute method.

Copy link
Author

Choose a reason for hiding this comment

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

Updated the javadoc with parameters.

Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
@skabashnyuk
Copy link
Contributor

@Mirage20 I think we good to go to the next step.
We will deploy your PR in one of our acceptance server and will run our selenium tests.
If we would not see any regressions we will accept this pr.

@vparfonov
Copy link
Contributor

@Mirage20 Hello again I fix few error in your code and merge with master. Create new one branch in che for merge your Test Plugin to Che. So please review changes here #3095 you can merge my branch to your.
FYI: we started QA circle on your PR

vparfonov pushed a commit that referenced this pull request Nov 22, 2016
* added java test runner plugin to the che project

Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
@vparfonov
Copy link
Contributor

merged here #3095

@kaloyan-raev
Copy link
Contributor

Is this implementation tightly coupled to Java?

Can we use it for PHPUnit - a PHP unit testing framework, which from design point of view is similar to the Java unit testing frameworks?

@vparfonov
Copy link
Contributor

vparfonov commented Nov 23, 2016

For now it coupled to Java and it's pretty new plugin form community not much functionality covered. But your question really good, will be good provide some API for testing framework like we did with debugger

@vparfonov vparfonov added this to the 5.0.0-M8 milestone Nov 23, 2016
@vparfonov vparfonov removed status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. sprint/current labels Nov 25, 2016
JPinkney pushed a commit to JPinkney/che that referenced this pull request Aug 17, 2017
* added java test runner plugin to the che project

Signed-off-by: Mirage Abeysekara <mirage.12@cse.mrt.ac.lk>
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.

8 participants