You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Oleg Ignatenko (JIRA)" <ji...@apache.org> on 2019/01/16 15:04:00 UTC

[jira] [Updated] (IGNITE-10927) Relieve JUnit3TestLegacySupport from inheriting deprecated junit.framework.Assert (follow-up to IGNITE-10177)

     [ https://issues.apache.org/jira/browse/IGNITE-10927?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Ignatenko updated IGNITE-10927:
------------------------------------
    Description: 
{{JUnit3TestLegacySupport}} currently inherits deprecated {{junit.framework.Assert}}. This was done only in order to minimize risky code changes when tests were migrating from Junit 3, after {{GridAbstractTest}} has dropped inheriting {{junit.framework.TestCase}}.

Now that migration is over it is less risky to cleanup project from deprecated assert methods and drop the harmful inheritance. In order to make this smoother and minimize amount of test changes, after inheritance is dropped, {{JUnit3TestLegacySupport}} should be extended with a set of "temporary patch" methods that would delegate most popular assertions used by subclasses to respective methods of {{org.junit.Assert}}.

Mentioned temporary patch methods, in turn, should get {{@Deprecated}} annotation and respective {{2deprecation}} noticed in javadocs that would encourage developers to (safely and gradually) change them to direct invocations and static imports of respective Assert methods instead of using those inherited from superclass. These patch methods should be declared {{protected final}} or {{protected static}}, in order to minimize their applicability and prevent them spreading more than intended.

  was:
{{JUnit3TestLegacySupport}} currently inherits deprecated {{junit.framework.Assert}}. This was done only in order to minimize risky code changes when tests were migrating from Junit 3, after {{GridAbstractTest}} has dropped inheriting {{junit.framework.TestCase}}.

Now that migration is over it is less risky to cleanup project from deprecated assert methods and drop the harmful inheritance. In order to make this smoother and minimize amount of test changes, after inheritance is dropped, {{JUnit3TestLegacySupport}} should be extended with a set of "temporary patch" methods that would delegate most popular assertions used by subclasses to respective methods of {{org.junit.Assert}}.

Mentioned temporary patch methods, in turn, should get {{@Deprecated}} annotation and respective {{2deprecation}} noticed in javadocs that would encourage developers to (safely and gradually) change them to direct invocations and static imports of respective Assert methods instead of using those inherited from superclass. These patch methods should be declared protected final or protected static final, to minimize their applicability and prevent them spreading more than intended.


> Relieve JUnit3TestLegacySupport from inheriting deprecated junit.framework.Assert (follow-up to IGNITE-10177)
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-10927
>                 URL: https://issues.apache.org/jira/browse/IGNITE-10927
>             Project: Ignite
>          Issue Type: Sub-task
>    Affects Versions: 2.7
>            Reporter: Oleg Ignatenko
>            Assignee: Oleg Ignatenko
>            Priority: Major
>
> {{JUnit3TestLegacySupport}} currently inherits deprecated {{junit.framework.Assert}}. This was done only in order to minimize risky code changes when tests were migrating from Junit 3, after {{GridAbstractTest}} has dropped inheriting {{junit.framework.TestCase}}.
> Now that migration is over it is less risky to cleanup project from deprecated assert methods and drop the harmful inheritance. In order to make this smoother and minimize amount of test changes, after inheritance is dropped, {{JUnit3TestLegacySupport}} should be extended with a set of "temporary patch" methods that would delegate most popular assertions used by subclasses to respective methods of {{org.junit.Assert}}.
> Mentioned temporary patch methods, in turn, should get {{@Deprecated}} annotation and respective {{2deprecation}} noticed in javadocs that would encourage developers to (safely and gradually) change them to direct invocations and static imports of respective Assert methods instead of using those inherited from superclass. These patch methods should be declared {{protected final}} or {{protected static}}, in order to minimize their applicability and prevent them spreading more than intended.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)