Commons Functor
  1. Commons Functor
  2. FUNCTOR-3

Reduce the use of raw types in the test classes

    Details

    • Type: Task Task
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      The test classes in functor have several raw types, which could lead to runtime errors and make the tests harder to understand.

      It was pointed by sebb in the mailing list during a call for votes to release functor 1.0.

      1. FUNCTOR-3.patch
        108 kB
        Bruno P. Kinoshita

        Activity

        Hide
        Bruno P. Kinoshita added a comment -

        Fixed in r1363514.

        Show
        Bruno P. Kinoshita added a comment - Fixed in r1363514.
        Hide
        Bruno P. Kinoshita added a comment -

        The patch attached was applied manually in r1363514, as parts of the code have changed since this issue was initially created.

        URL: http://svn.apache.org/viewvc?rev=1363514&view=rev
        Log:
        FUNCTOR-3 Reduced the use of raw types in test classes by adding generics
        where needed. In some cases, specially when using arrays with generics, the
        warnings were suppressed.

        This commit also fixed some warnings in Eclipse. In
        TestAbstractLoopProcedure.MockLoopProcedure class, only the serialVersionUID was
        included, removing a warning. And in TestLazyMap#testBaseMapOverrides, instead
        of using a pair <String, String>, the test was updated to use a <String,
        Integer>. Although the data used in the tests is different, the behavior is
        still the same. And in TestIsWithinRange, one unused import was removed.

        All tests passed locally, no CPD, PMD or CheckStyle problems found.

        Modified:
        commons/proper/functor/trunk/src/changes/changes.xml
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/TestAlgorithms.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestFilteredIterator.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsElementOf.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestComparatorFunction.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsWithinRange.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestAbstractLoopProcedure.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestBinaryAnd.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestBinaryCompositeBinaryFunction.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestBinaryOr.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestBinarySequence.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestCompositeUnaryPredicate.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestCompositeUnaryProcedure.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestSequence.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestUnaryAnd.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestUnaryOr.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/FlexiMapExample.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/QuicksortExample.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/kata/two/BaseBinaryChop.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/kata/two/BinaryChop.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/kata/two/EiffelStyleLoop.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/kata/two/TestBinaryChop.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/lines/Lines.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/lines/TestLines.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/map/FixedSizeMap.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/map/FunctoredMap.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/map/LazyMap.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/map/PredicatedMap.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/map/TestFixedSizeMap.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/map/TestLazyMap.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/map/TestPredicatedMap.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/generator/TestBaseGenerator.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/generator/TestIteratorToGeneratorAdapter.java
        commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/generator/util/TestEachElement.java

        Show
        Bruno P. Kinoshita added a comment - The patch attached was applied manually in r1363514, as parts of the code have changed since this issue was initially created. URL: http://svn.apache.org/viewvc?rev=1363514&view=rev Log: FUNCTOR-3 Reduced the use of raw types in test classes by adding generics where needed. In some cases, specially when using arrays with generics, the warnings were suppressed. This commit also fixed some warnings in Eclipse. In TestAbstractLoopProcedure.MockLoopProcedure class, only the serialVersionUID was included, removing a warning. And in TestLazyMap#testBaseMapOverrides, instead of using a pair <String, String>, the test was updated to use a <String, Integer>. Although the data used in the tests is different, the behavior is still the same. And in TestIsWithinRange, one unused import was removed. All tests passed locally, no CPD, PMD or CheckStyle problems found. Modified: commons/proper/functor/trunk/src/changes/changes.xml commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/TestAlgorithms.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestFilteredIterator.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsElementOf.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestComparatorFunction.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsWithinRange.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestAbstractLoopProcedure.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestBinaryAnd.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestBinaryCompositeBinaryFunction.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestBinaryOr.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestBinarySequence.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestCompositeUnaryPredicate.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestCompositeUnaryProcedure.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestSequence.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestUnaryAnd.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestUnaryOr.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/FlexiMapExample.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/QuicksortExample.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/kata/two/BaseBinaryChop.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/kata/two/BinaryChop.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/kata/two/EiffelStyleLoop.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/kata/two/TestBinaryChop.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/lines/Lines.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/lines/TestLines.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/map/FixedSizeMap.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/map/FunctoredMap.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/map/LazyMap.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/map/PredicatedMap.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/map/TestFixedSizeMap.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/map/TestLazyMap.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/map/TestPredicatedMap.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/generator/TestBaseGenerator.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/generator/TestIteratorToGeneratorAdapter.java commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/generator/util/TestEachElement.java
        Hide
        Bruno P. Kinoshita added a comment -

        Attached you will find a patch for this issue.

        There were "rawtypes" suppression annotations in classes (not test classes) that were removed.

        There may have better ways of dealing with generics rather than the way I implemented. Could somebody with karma and more skill than me review it, please? Perhaps it could be used as a base for this issue.

        Thank you!
        Bruno P. Kinoshita

        Show
        Bruno P. Kinoshita added a comment - Attached you will find a patch for this issue. There were "rawtypes" suppression annotations in classes (not test classes) that were removed. There may have better ways of dealing with generics rather than the way I implemented. Could somebody with karma and more skill than me review it, please? Perhaps it could be used as a base for this issue. Thank you! Bruno P. Kinoshita

          People

          • Assignee:
            Bruno P. Kinoshita
            Reporter:
            Bruno P. Kinoshita
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development