Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-10951 migration from Junit 3 to 4 phase 2 (follow-up to IGNITE-10173)
  3. IGNITE-10927

Relieve JUnit3TestLegacySupport from inheriting deprecated junit.framework.Assert (follow-up to IGNITE-10177)

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.7
    • 2.8
    • None
    • None

    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 respective 2deprecation notices 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. (as a side note, experimenting has shown that use of @Deprecated annotation is not feasible as it deprives developers an option to use static imports)

      Attachments

        Issue Links

          Activity

            People

              oignatenko Oleg Ignatenko
              oignatenko Oleg Ignatenko
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m