[
https://issues.apache.org/jira/browse/IGNITE-10796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16738460#comment-16738460
]
Oleg Ignatenko commented on IGNITE-10796:
-----------------------------------------
(/) After thoroughly stripping unused stuff it turned out that only useful code
(for suites that expect {{ignoredOnly}} to be {{false}}) looks as follows...
{code} public class IgniteTestSuite extends TestSuite {
/**
* Constructor.
*
* @param name Name.
*/
public IgniteTestSuite(String name) {
if (name != null)
setName(name);
}
/** {@inheritDoc} */
@Override public void addTest(Test test) {
// Ignore empty test suites.
if (test instanceof IgniteTestSuite) {
IgniteTestSuite suite = (IgniteTestSuite)test;
if (suite.testCount() == 0)
return;
}
super.addTest(test);
}
}{code}
...which makes its functionality fully covered by plain
{{junit.framework.TestSuite}} and as such, a subject for same rework as was
previously done per IGNITE-10774 and IGNITE-10775. As for the class
{{IgniteTestSuite}}, it should be just removed.
The key parts of above simplification were first, to extract code working with
suites assuming {{ignoredOnly}} to be {{true}} into separate class (along with
replacing this obscure parameter with respective constants) and second,
observing that remaining part invokes constructor with parameter {{Class<?
extends TestCase>}} always being null. After the code expecting non-null value
of this parameter was stripped out from constructor, the rest was only a matter
of following IDE automatically suggesting removal of unused private methods.
> Migrate from JUnit 3 to 4 suites involving IgniteTestSuite
> ----------------------------------------------------------
>
> Key: IGNITE-10796
> URL: https://issues.apache.org/jira/browse/IGNITE-10796
> Project: Ignite
> Issue Type: Sub-task
> Affects Versions: 2.8
> Reporter: Oleg Ignatenko
> Assignee: Oleg Ignatenko
> Priority: Major
>
> This task is to migrate from JUnit 3 to 4 test suites suites involving
> {{IgniteTestSuite}} API that was introduced per IGNITE-3658.
> If needed, refer parent task comments for more details.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)