1. 30 10月, 2019 1 次提交
  2. 29 10月, 2019 3 次提交
    • R
      Expose maxInMemorySize via CodecConfigurer · 5abf24e7
      Rossen Stoyanchev 提交于
      Centralized maxInMemorySize exposed via CodecConfigurer along with
      ability to plug in an instance of MultipartHttpMessageWrite.
      
      Closes gh-23884
      5abf24e7
    • B
      Polishing · 69bcdfc1
      Brian Clozel 提交于
      69bcdfc1
    • R
      Limits on input stream in codecs · 89d053d7
      Rossen Stoyanchev 提交于
      - Add maxInMemorySize property to Decoder and HttpMessageReader
        implementations that aggregate input to trigger
        DataBufferLimitException when reached.
      
      - For codecs that call DataBufferUtils#join, there is now an overloaded
        variant with a maxInMemorySize extra argument. Internally, a custom
        LimitedDataBufferList is used to count and enforce the limit.
      
      - Jackson2Tokenizer and XmlEventDecoder support those limits per
        streamed JSON object.
      
      See gh-23884
      89d053d7
  3. 25 10月, 2019 1 次提交
    • P
      Support customer repeatable containers in type map · 013ec6ab
      Phillip Webb 提交于
      Update `AnnotationTypeMappings` so that a custom `RepeatableContainers`
      instances can be used. Prior to this commit, only standard repeatables
      were used when reading the annotations. This works in most situations,
      but causes regressions for some `AnnotationUtils` methods.
      
      Fixed gh-23856
      013ec6ab
  4. 24 10月, 2019 1 次提交
  5. 22 10月, 2019 2 次提交
    • P
      Use mapped annotation values when resolving mirrors · ad543dbe
      Phillip Webb 提交于
      Update `TypeMappedAnnotation` mirror resolution logic so that mapped
      annotation values are also considered. Prior to this commit, mirrors
      in more complex meta-annotation scenarios would not resolve correctly.
      
      Specifically, given the following:
      
       @interface TestAliased {
      
       	@AliasFor(attribute = "qualifier")
       	String value() default "";
      
       	@AliasFor(attribute = "value")
       	String qualifier() default "";
       }
      
       @TestAliased
       @interface TestMetaAliased {
      
       	@AliasFor(annotation = Aliased.class, attribute = "value")
       	String value() default "";
       }
      
       @TestMetaAliased("test")
       @interface TestComposed {
       }
      
      A merged `@TestAliased` annotation obtained from a `@TestComposed`
      root annotation would return a `value` and `qualifier` of "".
      
      This was because the "value" and "qualifier" mirrors needed to be
      resolved against the `@TestMetaAliased` meta-annotation. They cannot be
      resolved against the declared `@TestComposed` annotation because it
      does not have any attributes. Our previous tests only covered a single
      depth scenario where `@TestMetaAliased` was used directly on the
      annotated element.
      
      Closes gh-23767
      Co-authored-by: NSam Brannen <sbrannen@pivotal.io>
      ad543dbe
    • S
      Polishing · b1a938fa
      Sam Brannen 提交于
      b1a938fa
  6. 24 9月, 2019 1 次提交
  7. 16 9月, 2019 2 次提交
  8. 12 9月, 2019 1 次提交
    • S
      Prevent improper use of testing framework APIs · 30cff46e
      Sam Brannen 提交于
      Prior to this commit, a lot of work had been done to prevent improper
      use of testing Framework APIs throughout the codebase; however, there
      were still some loopholes.
      
      This commit addresses these loopholes by introducing additional
      Checkstyle rules (and modifying existing rules) to prevent improper use
      of testing framework APIs in production code as well as in test code.
      
      - Checkstyle rules for banned imports have been refactored into
        multiple rules specific to JUnit 3, JUnit 4, JUnit Jupiter, and
        TestNG.
      - Accidental usage of org.junit.Assume has been switched to
        org.junit.jupiter.api.Assumptions.
      - All test classes now reside under org.springframework packages.
      - All test classes (including abstract test classes) now conform to the
        `*Tests` naming convention.
        - As an added bonus, tests in the renamed
          ScenariosForSpringSecurityExpressionTests are now included in the
          build.
      - Dead JUnit 4 parameterized code has been removed from
        DefaultServerWebExchangeCheckNotModifiedTests.
      
      Closes gh-22962
      30cff46e
  9. 09 9月, 2019 2 次提交
  10. 06 9月, 2019 1 次提交
  11. 05 9月, 2019 1 次提交
  12. 04 9月, 2019 1 次提交
    • R
      Change package used to test path matching · c8f430ee
      Rossen Stoyanchev 提交于
      The org.reactivestreams has 13 instead of 4 classes in 1.0.3 with the
      addition of Java 9 Flow adapters. This commit switches to using a
      different package reactor.util.annotation, also with a small number of
      classes, for this test.
      c8f430ee
  13. 03 9月, 2019 2 次提交
  14. 02 9月, 2019 2 次提交
  15. 28 8月, 2019 2 次提交
  16. 23 8月, 2019 1 次提交
  17. 20 8月, 2019 2 次提交
    • S
      Re-enable shadowed, overridden @test methods · aa6e762d
      Sam Brannen 提交于
      Due to a bug (or "unintentional feature") in JUnit 4, overridden test
      methods not annotated with @test are still executed as test methods;
      however, JUnit Jupiter does not support that. Thus, prior to this
      commit, some overridden test methods in spring-core were no longer
      executed after the migration from JUnit 4 to JUnit Jupiter.
      
      This commit addresses this issue for such known use cases, but there
      are likely other such use cases within Spring's test suite.
      
      See gh-23451
      aa6e762d
    • S
      Use default visibility for test classes and methods in spring-core · fab96cad
      Sam Brannen 提交于
      See gh-23451
      fab96cad
  18. 19 8月, 2019 2 次提交
  19. 17 8月, 2019 4 次提交
    • S
      Introduce @EnabledForTestGroups in Spring's test suite · 288461a5
      Sam Brannen 提交于
      Closes gh-23476
      288461a5
    • S
      Remove JUnit 4 dependency from all modules except spring-test · 979508a7
      Sam Brannen 提交于
      This commit removes the JUnit 4 dependency from all modules except
      spring-test which provides explicit JUnit 4 support.
      
      This commit also includes the following.
      
      - migration from JUnit 4 assertions to JUnit Jupiter assertions in all
        Kotlin tests
      - migration from JUnit 4 assumptions in Spring's TestGroup support to
        JUnit Jupiter assumptions, based on org.opentest4j.TestAbortedException
      - introduction of a new TestGroups utility class than can be used from
        existing JUnit 4 tests in the spring-test module in order to perform
        assumptions using JUnit 4's Assume class
      
      See gh-23451
      979508a7
    • S
      Migrate parameterized tests in spring-core · 3df85c78
      Sam Brannen 提交于
      This commit migrates parameterized tests in spring-core using the
      "composed @ParameterizedTest" approach. This approach is reused in
      follow-up commits for the migration of the remaining modules.
      
      For a concrete example, see AbstractDataBufferAllocatingTests and its
      subclasses (e.g., DataBufferTests).
      
      Specifically, AbstractDataBufferAllocatingTests declares a custom
      @ParameterizedDataBufferAllocatingTest annotation that is
      meta-annotated with @ParameterizedTest and
      @MethodSource("org.springframework.core.io.buffer.AbstractDataBufferAllocatingTests#dataBufferFactories()").
      
      Individual methods in concrete subclasses are then annotated with
      @ParameterizedDataBufferAllocatingTest instead of @ParameterizedTest or
      @test.
      
      The approach makes the migration from JUnit 4 to JUnit Jupiter rather
      straightforward; however, there is one major downside. The arguments
      for a @ParameterizedTest test method can only be accessed by the test
      method itself. It is not possible to access them in an @BeforeEach
      method (see https://github.com/junit-team/junit5/issues/944).
      Consequently, we are forced to declare the parameters in each such
      method and delegate to a custom "setup" method. Although this is a bit
      cumbersome, I feel it is currently the best way to achieve fine grained
      parameterized tests within our test suite without implementing a custom
      TestTemplateInvocationContextProvider for each specific use case.
      
      Once https://github.com/junit-team/junit5/issues/878 is resolved, we
      should consider migrating to parameterized test classes.
      
      See gh-23451
      3df85c78
    • S
      Migrate test suite from JUnit 4 to JUnit Jupiter · 32cc32f9
      Sam Brannen 提交于
      This first commit for this issue:
      
      - allows JUnit Jupiter to be used for all tests
      - adds a dependency on mockito-junit-jupiter
      - migrates tests in spring-core to JUnit Jupiter, except parameterized
        tests
      
      The following script was developed in order to semi-automate the
      migration process.
      
      https://github.com/sbrannen/junit-converters/blob/master/junit4ToJUnitJupiter.zsh
      
      See gh-23451
      32cc32f9
  20. 12 8月, 2019 1 次提交
  21. 09 8月, 2019 1 次提交
  22. 07 8月, 2019 5 次提交
    • S
      Use System.nanoTime() in StopWatch · a532afb1
      Sam Brannen 提交于
      Prior to this commit, StopWatch used System.currentTimeMillis() to
      track and report running time in milliseconds.
      
      This commit updates the internals of StopWatch to use System.nanoTime()
      instead of System.currentTimeMillis(). Consequently, running time is
      now tracked and reported in nanoseconds; however, users still have the
      option to retrieve running time in milliseconds or seconds.
      
      Closes gh-23235
      a532afb1
    • S
      Remove unnecessary loop in SerializableTypeWrapper · a43ba052
      Sam Brannen 提交于
      Since arbitrary levels of proxies do not occur, this commit replaces
      the `while` loop in SerializableTypeWrapper.unwrap() with a simple
      `if` statement.
      
      Closes gh-23415
      a43ba052
    • S
      Overhaul StopWatchTests · 83956f8e
      Sam Brannen 提交于
      83956f8e
    • S
      Use AssertJ in AnnotationAttributesTests · 03dd45fb
      Sam Brannen 提交于
      03dd45fb
    • S
      Check for instanceof Throwable in AnnotationAttributes#assertNotException · a092dc05
      Sam Brannen 提交于
      Prior to this commit, AnnotationAttributes#assertNotException checked if
      the attribute value was an instance of Exception. Although this was
      typically sufficient, the scope was not always broad enough -- for
      example, if AnnotationReadingVisitorUtils#convertClassValues stored a
      Throwable in the map (such as a LinkageError).
      
      This commit fixes this by checking for an instance of Throwable in
      AnnotationAttributes#assertNotException.
      
      Closes gh-23424
      a092dc05
  23. 01 8月, 2019 1 次提交
    • P
      Deprecate mutable methods of MethodParameter · 62a3e414
      Phillip Webb 提交于
      Deprecate all mutation methods in `MethodParameter` in favor of factory
      methods that return a new instance. Existing code that previously relied
      on mutation has been updated to use the replacement methods.
      
      Closes gh-23385
      62a3e414