mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Compare commits
467 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c08e31b7d6 | |||
| d97eabba2f | |||
| 1cd0e720f7 | |||
| 60dca027e7 | |||
| 2209e7cb92 | |||
| fdc60311ed | |||
| 1c6dda3ca4 | |||
| ac0363c94e | |||
| a90716522c | |||
| b2fa574879 | |||
| 910d2788e9 | |||
| 2e23cf32ce | |||
| bb1699a9d3 | |||
| 10d47d4d21 | |||
| 1800b10717 | |||
| 7ebd850b85 | |||
| fd1ca46ca1 | |||
| b7b36891fb | |||
| cf7daa36c8 | |||
| 821a8eebdd | |||
| 0463d7fcb9 | |||
| 0e5f27c94e | |||
| e11373fe69 | |||
| 623a019ef8 | |||
| b069efade4 | |||
| 107f88a7e4 | |||
| 831a95154e | |||
| 713a112812 | |||
| 7e7e54b75e | |||
| 5be0db9259 | |||
| b52136dfa5 | |||
| 1f72ab4816 | |||
| 45a629e20a | |||
| 9685380334 | |||
| 09b36380cd | |||
| 331b14bb0b | |||
| 90268de9c0 | |||
| 2ca93cbe1c | |||
| 116a256e81 | |||
| 2c5781473c | |||
| 7efb62091d | |||
| 0d42a1bd7f | |||
| a7fe6b8f5c | |||
| b121c0e2ea | |||
| 5b27df772a | |||
| c2149e38fc | |||
| e7329271fa | |||
| 7b94112ec6 | |||
| e6814f6609 | |||
| 678b6edad2 | |||
| 4bd0ad5d2e | |||
| eaabe21c7b | |||
| edb5e73d48 | |||
| d4b2860cc9 | |||
| 14f5032e97 | |||
| 17140c8d4b | |||
| 2fb13d410d | |||
| 5e1e689739 | |||
| 7dea2686b8 | |||
| 9b827283f1 | |||
| a8feb792da | |||
| e500456f1c | |||
| 35d0b3dba9 | |||
| 5f2e298c08 | |||
| 193a76fe2a | |||
| 70581d1ea2 | |||
| d85a6c0bea | |||
| 7411b2e025 | |||
| fac1b94623 | |||
| d91fc8c672 | |||
| 6599383dac | |||
| 33642345a4 | |||
| 7c4f0318bb | |||
| 54e2df2e0e | |||
| f4ce22f6ba | |||
| fa6ccc066d | |||
| 1a8caf9e2b | |||
| 7b7dfcaaed | |||
| c11dd4a839 | |||
| c5b8406def | |||
| 6013591fac | |||
| c8c1e61c0a | |||
| 201827cb0b | |||
| a599859595 | |||
| 4aedf2ea13 | |||
| 0dc1c7eb8b | |||
| 73e39726cd | |||
| bcee6b9da4 | |||
| 7f26e8cfc6 | |||
| bee63e38c1 | |||
| 193f419520 | |||
| 6df80a8f70 | |||
| 988aae4f2e | |||
| 61569003b5 | |||
| 1fd447f395 | |||
| 3cbea86335 | |||
| c03cdbac21 | |||
| fc12891006 | |||
| b92515bdee | |||
| 018ba92214 | |||
| f5195887c9 | |||
| 7ce22e2f3a | |||
| 2fb90cb16b | |||
| c237338d8f | |||
| 7e03728b2c | |||
| cc1f57823b | |||
| b2fe494b9c | |||
| a98bf30ee6 | |||
| c7e037da39 | |||
| d3da7a50ec | |||
| e7df445e37 | |||
| 2093e35f27 | |||
| 87230c4f1f | |||
| e1b0296f9e | |||
| 771fbde951 | |||
| 2afae430eb | |||
| e706fcba1f | |||
| 8285666ee8 | |||
| 60fd95a354 | |||
| 7f5395a216 | |||
| 8a7bb49436 | |||
| 5f1e4ffc4f | |||
| 89560777e4 | |||
| b30f9a1308 | |||
| d4de3396f7 | |||
| 5c2d65b8ef | |||
| 787b09b202 | |||
| c3bc28762e | |||
| c5fb7b9fb7 | |||
| 0ad942f337 | |||
| d72c90cd7a | |||
| 6db20eb773 | |||
| 2f12351292 | |||
| b6f502db4e | |||
| 8cf70fe509 | |||
| 7e402ba4fe | |||
| c0fbf6fca1 | |||
| 399b846458 | |||
| 0e95282153 | |||
| 2afe5802c0 | |||
| 2ae91404d1 | |||
| f048f27d80 | |||
| f1680e5cee | |||
| 96de4b3cee | |||
| 7778508e69 | |||
| 1de2e0a4a7 | |||
| ede2a1d4b2 | |||
| d1a6e49475 | |||
| 809ed9d469 | |||
| f78c21e40b | |||
| 8219d06ae1 | |||
| adc13f2030 | |||
| a09f02f64e | |||
| 97ba00eff2 | |||
| 96e77d417b | |||
| ca6241a093 | |||
| de608a08ed | |||
| ae9268004d | |||
| a134e92e7f | |||
| 4882eb278d | |||
| 7528b9487d | |||
| e029dbf607 | |||
| 8ff1ac59e0 | |||
| acae174f8f | |||
| 2ad4602ca0 | |||
| 68b980f849 | |||
| 87f866b688 | |||
| 37ba57a921 | |||
| fb6ee01281 | |||
| df1145b797 | |||
| 9036cc6899 | |||
| 6add7b4dec | |||
| 9e7ab4d308 | |||
| 13f23dc32b | |||
| 4cbc61abfc | |||
| 05301d24c1 | |||
| d481b81b7e | |||
| a4179b4795 | |||
| d0d8c6e749 | |||
| 9f6572a095 | |||
| d1c7083e77 | |||
| e0319b1f79 | |||
| b889700548 | |||
| a9d9b76d09 | |||
| de7bed2ab2 | |||
| 9dbd411f81 | |||
| 5d4f1d9e09 | |||
| 974cacac31 | |||
| 9277b47040 | |||
| d552105516 | |||
| e35d3b8bb5 | |||
| 0a974511bd | |||
| 28a95e89f3 | |||
| 7d1d989535 | |||
| e4a530efac | |||
| d521d37f14 | |||
| 009dfbfafc | |||
| df706f4c7c | |||
| a03a116f6b | |||
| 02e90a8645 | |||
| c640d28a82 | |||
| 51fa98a1b2 | |||
| 45555f77a6 | |||
| c648425822 | |||
| 711fafc924 | |||
| ce2c0e4c79 | |||
| 8f02e1088d | |||
| b23049bd27 | |||
| 669a689a50 | |||
| 10d008e3db | |||
| ba5fc21ab4 | |||
| 9aea10179b | |||
| 65c8a10fb0 | |||
| 82adb09490 | |||
| d93303c008 | |||
| c2367b3ad2 | |||
| 1acf5a7424 | |||
| 7575616d26 | |||
| b4cf88499c | |||
| 5aa37ea07b | |||
| 2b6117c0c2 | |||
| 72685b1d81 | |||
| d624dc084f | |||
| 550f13e8ed | |||
| a36168c972 | |||
| d8cd46121a | |||
| e7d40f930f | |||
| bac5cd866e | |||
| adbc55e72a | |||
| f5df422de9 | |||
| 273812f9c5 | |||
| cf9a052e3a | |||
| 1b39f138eb | |||
| 14a32d13d0 | |||
| d77a28aac3 | |||
| 8dfacbc210 | |||
| cbb037bc68 | |||
| daebbf1960 | |||
| f01de79fe2 | |||
| 3a90d8a64d | |||
| 15b651cdfe | |||
| 547342b27d | |||
| cc4261c30b | |||
| 688167a7df | |||
| b4a9758d9b | |||
| 8cced42fb2 | |||
| d93403a257 | |||
| c86e164b03 | |||
| 64440a5f04 | |||
| 2c86d6ded2 | |||
| eeaae16b17 | |||
| f9a73503f4 | |||
| 75abd9fc7e | |||
| c1218615df | |||
| e66e41029c | |||
| 2fcee5ae58 | |||
| d499e14b78 | |||
| b142f8e660 | |||
| ab70acb325 | |||
| 75a1395226 | |||
| 754a8ca05a | |||
| 7c47e3ba2e | |||
| 60c7af3625 | |||
| d085577e0a | |||
| a2af5a90dc | |||
| 5a0b768a3d | |||
| 992e75303d | |||
| 77517d6cff | |||
| c69703ffdb | |||
| 542e187831 | |||
| 214ba63127 | |||
| 7453c0d0cb | |||
| 54669c51c9 | |||
| 5e9d29d813 | |||
| a234b90abb | |||
| 5d8c5b0d9b | |||
| c20a7b4636 | |||
| b34404916a | |||
| 3adc7c3059 | |||
| 59bef22235 | |||
| daa30a9f0b | |||
| 984f9de191 | |||
| 2a2efbe611 | |||
| 19180e04d2 | |||
| b1d93bb307 | |||
| 8e67b7b2cf | |||
| 3d33cf3764 | |||
| ac8eaca475 | |||
| 3c0c0c0597 | |||
| 16e49bf0c9 | |||
| 61d9787b98 | |||
| e864409c5f | |||
| 3b983e2165 | |||
| 734db23f4e | |||
| f527ca7515 | |||
| 89b8449999 | |||
| 152254ab0a | |||
| 6c2cb8ecf5 | |||
| f1827cb1f9 | |||
| 0f5103de45 | |||
| 8740c2dc18 | |||
| 5debd866d4 | |||
| 1c270d8d06 | |||
| 29fe65d23c | |||
| 8a6086774f | |||
| 33ffdd865d | |||
| c84dd55863 | |||
| cbc57460b7 | |||
| a741ae422b | |||
| 850cbf032b | |||
| a566083a07 | |||
| 798744838c | |||
| 3f1882c4eb | |||
| 0801a7d7e4 | |||
| 6747cc1353 | |||
| bc7d010485 | |||
| 8396e6bdd1 | |||
| cb8db1e6df | |||
| a31a4f8148 | |||
| bdb9f9570e | |||
| f6ca21f6a4 | |||
| 4936a637fe | |||
| e8ef93c508 | |||
| 047eefd2e2 | |||
| b0e4b7e29c | |||
| 08e9372ded | |||
| 34d32402d3 | |||
| 1ec15ba9c2 | |||
| 2ac5744323 | |||
| c39ed52f97 | |||
| 8e5cad2af3 | |||
| c562c3a0b3 | |||
| 259ffe9b3b | |||
| 9d6e40fb1e | |||
| d509d5ae6f | |||
| 53b39eb753 | |||
| 1dd5db42ab | |||
| 01827389ef | |||
| e96b71acf3 | |||
| e3e7d90415 | |||
| b4c91e7dac | |||
| e1fb4a1966 | |||
| ef6b1ba034 | |||
| 9d963abb7d | |||
| c480a99a77 | |||
| 55e0ff11ca | |||
| 12a78d1af2 | |||
| 4692f20aac | |||
| 141dae6437 | |||
| 132805133d | |||
| ffc1f960f9 | |||
| ea6d2ea1ce | |||
| f9c1565f4e | |||
| 59ade91694 | |||
| c1d0060a6f | |||
| 3299793c8a | |||
| d0c2812dad | |||
| 328e88d204 | |||
| 22a888b53d | |||
| 081b3d304d | |||
| 92a28392db | |||
| 510ef1ab2e | |||
| f585eb0b79 | |||
| 03ea92df99 | |||
| 68f9f8116c | |||
| 3aa2605fda | |||
| d5f0bb23ae | |||
| c91dd02905 | |||
| 7b6d83a106 | |||
| 8a371c7669 | |||
| 5581f3b77b | |||
| 57b771ba92 | |||
| 94f8ef08e2 | |||
| 726b1bb1d0 | |||
| 7cd4ddf5fc | |||
| 4260c34b47 | |||
| 0335db23c9 | |||
| 61d4ee594d | |||
| 5718bf424b | |||
| 75fd391fc7 | |||
| 8082b338e2 | |||
| 956ffe6858 | |||
| 3cf806a668 | |||
| e7d489667c | |||
| 9c17eb59a4 | |||
| 2d779857aa | |||
| 9c2d146a51 | |||
| b6b7162d61 | |||
| 0b5ad09394 | |||
| 1b4fd1cba1 | |||
| 261956fd08 | |||
| a1b8b18282 | |||
| 7456fb9c65 | |||
| ea4f1ca5d5 | |||
| 15321a3163 | |||
| 41f40c6c22 | |||
| 44da775134 | |||
| 0eacb443b0 | |||
| 7474ee7041 | |||
| 0711e58a5f | |||
| f353bc0c25 | |||
| 5836680490 | |||
| 5f9178034c | |||
| 542297b30d | |||
| f4509d6e3a | |||
| f8d6896e40 | |||
| 6fdf5ef6ee | |||
| d9cae339d6 | |||
| 17edbec035 | |||
| 47b18e5ea9 | |||
| bee2b7cd73 | |||
| 49ddf798e0 | |||
| 09b6730f3d | |||
| 63844c6d74 | |||
| 1dd0a0f009 | |||
| b23617637d | |||
| dd9b6287b4 | |||
| 11e321b8e7 | |||
| 9d65830133 | |||
| fa8f08391f | |||
| b679c3b6ec | |||
| 02b40223e5 | |||
| dafe57fc6e | |||
| d757f73902 | |||
| 9af8dc0980 | |||
| 8ac222467b | |||
| 6e21b19999 | |||
| 16ed7e2a19 | |||
| 76bc581528 | |||
| 9b30d46ff4 | |||
| 70a0c93d69 | |||
| c8bce9686f | |||
| f180bf7652 | |||
| 1b172c1d20 | |||
| 2bd821c909 | |||
| 4466114cfa | |||
| 8d846500ef | |||
| 1e83e889aa | |||
| 0a2046e81c | |||
| 2c03246f00 | |||
| 2d2993dffb | |||
| a4f75e9c6a | |||
| 119dd04ae5 | |||
| ebbb562cb9 | |||
| 0f41536820 | |||
| b1e59961fb | |||
| e15ccdb35d | |||
| 2108bdf876 | |||
| fc42ca2866 | |||
| d7d474f658 | |||
| 55ae3c5e87 | |||
| de8a6c8c57 | |||
| d4d940e6e3 | |||
| 484006ce90 | |||
| 7c84695333 | |||
| a4fa6a7a31 | |||
| 3b9d1a00b0 | |||
| c2141e2e93 | |||
| d503bc2804 | |||
| 14ce84cebb | |||
| 828fe39523 | |||
| 3a48682226 | |||
| b866d4209c | |||
| 797f618f2b | |||
| fb13f6f0bc | |||
| 6f15f32be3 | |||
| 1bff7ce141 |
+50
-67
@@ -1,33 +1,18 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16'
|
||||
classpath 'io.spring.asciidoctor:spring-asciidoctor-extensions:0.1.3.RELEASE'
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'io.spring.dependency-management' version '1.0.8.RELEASE' apply false
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.3.61' apply false
|
||||
id 'org.jetbrains.dokka' version '0.9.18' apply false
|
||||
id 'org.asciidoctor.convert' version '1.5.8'
|
||||
id 'io.spring.nohttp' version '0.0.3.RELEASE'
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.3.71' apply false
|
||||
id 'org.jetbrains.dokka' version '0.10.1' apply false
|
||||
id 'org.asciidoctor.jvm.convert' version '2.4.0'
|
||||
id 'io.spring.gradle-enterprise-conventions' version '0.0.2'
|
||||
id 'io.spring.nohttp' version '0.0.4.RELEASE'
|
||||
id 'de.undercouch.download' version '4.0.0'
|
||||
id 'com.gradle.build-scan' version '2.4.2'
|
||||
id "com.jfrog.artifactory" version '4.11.0' apply false
|
||||
id 'com.gradle.build-scan' version '3.1.1'
|
||||
id "com.jfrog.artifactory" version '4.12.0' apply false
|
||||
id "io.freefair.aspectj" version "4.1.1" apply false
|
||||
id "com.github.ben-manes.versions" version "0.24.0"
|
||||
}
|
||||
|
||||
apply from: "$rootDir/gradle/build-scan-user-data.gradle"
|
||||
buildScan {
|
||||
captureTaskInputFiles = true
|
||||
obfuscation {
|
||||
ipAddresses { addresses -> addresses.collect { address -> '0.0.0.0'} }
|
||||
}
|
||||
publishAlwaysIf(System.getenv('GRADLE_ENTERPRISE_URL') != null)
|
||||
server = 'https://ge.spring.io'
|
||||
}
|
||||
|
||||
ext {
|
||||
moduleProjects = subprojects.findAll { it.name.startsWith("spring-") }
|
||||
javaProjects = subprojects - project(":framework-bom")
|
||||
@@ -41,24 +26,23 @@ configure(allprojects) { project ->
|
||||
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom "com.fasterxml.jackson:jackson-bom:2.10.1"
|
||||
mavenBom "io.netty:netty-bom:4.1.43.Final"
|
||||
mavenBom "io.projectreactor:reactor-bom:Dysprosium-SR2"
|
||||
mavenBom "io.rsocket:rsocket-bom:1.0.0-RC5"
|
||||
mavenBom "org.eclipse.jetty:jetty-bom:9.4.24.v20191120"
|
||||
mavenBom "org.jetbrains.kotlin:kotlin-bom:1.3.61"
|
||||
mavenBom "org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.2"
|
||||
mavenBom "org.junit:junit-bom:5.5.2"
|
||||
mavenBom "com.fasterxml.jackson:jackson-bom:2.10.3"
|
||||
mavenBom "io.netty:netty-bom:4.1.48.Final"
|
||||
mavenBom "io.projectreactor:reactor-bom:Dysprosium-SR6"
|
||||
mavenBom "io.rsocket:rsocket-bom:1.0.0-RC6"
|
||||
mavenBom "org.eclipse.jetty:jetty-bom:9.4.27.v20200227"
|
||||
mavenBom "org.jetbrains.kotlin:kotlin-bom:1.3.71"
|
||||
mavenBom "org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.5"
|
||||
mavenBom "org.junit:junit-bom:5.6.1"
|
||||
}
|
||||
dependencies {
|
||||
dependencySet(group: 'org.apache.logging.log4j', version: '2.12.1') {
|
||||
dependencySet(group: 'org.apache.logging.log4j', version: '2.13.1') {
|
||||
entry 'log4j-api'
|
||||
entry 'log4j-core'
|
||||
entry 'log4j-slf4j-impl'
|
||||
entry 'log4j-jul'
|
||||
}
|
||||
dependency "org.slf4j:slf4j-api:1.7.29"
|
||||
|
||||
dependency "org.slf4j:slf4j-api:1.7.30"
|
||||
dependency "com.google.code.findbugs:jsr305:3.0.2"
|
||||
|
||||
dependencySet(group: 'org.aspectj', version: '1.9.5') {
|
||||
@@ -66,7 +50,7 @@ configure(allprojects) { project ->
|
||||
entry 'aspectjtools'
|
||||
entry 'aspectjweaver'
|
||||
}
|
||||
dependencySet(group: 'org.codehaus.groovy', version: '2.5.8') {
|
||||
dependencySet(group: 'org.codehaus.groovy', version: '2.5.10') {
|
||||
entry 'groovy'
|
||||
entry 'groovy-jsr223'
|
||||
entry 'groovy-templates'
|
||||
@@ -76,37 +60,38 @@ configure(allprojects) { project ->
|
||||
|
||||
dependency "io.reactivex:rxjava:1.3.8"
|
||||
dependency "io.reactivex:rxjava-reactive-streams:1.2.1"
|
||||
dependency "io.reactivex.rxjava2:rxjava:2.2.15"
|
||||
dependency "io.reactivex.rxjava2:rxjava:2.2.19"
|
||||
dependency "io.projectreactor.tools:blockhound:1.0.2.RELEASE"
|
||||
|
||||
dependency "com.caucho:hessian:4.0.62"
|
||||
dependency "com.fasterxml:aalto-xml:1.2.2"
|
||||
dependency("com.fasterxml.woodstox:woodstox-core:6.0.2") {
|
||||
dependency("com.fasterxml.woodstox:woodstox-core:6.0.3") {
|
||||
exclude group: "stax", name: "stax-api"
|
||||
}
|
||||
dependency "com.google.code.gson:gson:2.8.6"
|
||||
dependency "com.google.protobuf:protobuf-java-util:3.11.0"
|
||||
dependency "com.google.protobuf:protobuf-java-util:3.11.4"
|
||||
dependency "com.googlecode.protobuf-java-format:protobuf-java-format:1.4"
|
||||
dependency("com.thoughtworks.xstream:xstream:1.4.11.1") {
|
||||
exclude group: "xpp3", name: "xpp3_min"
|
||||
exclude group: "xmlpull", name: "xmlpull"
|
||||
}
|
||||
dependency "org.apache.johnzon:johnzon-jsonb:1.2.2"
|
||||
dependency "org.apache.johnzon:johnzon-jsonb:1.2.3"
|
||||
dependency("org.codehaus.jettison:jettison:1.3.8") {
|
||||
exclude group: "stax", name: "stax-api"
|
||||
}
|
||||
dependencySet(group: 'org.jibx', version: '1.3.1') {
|
||||
dependencySet(group: 'org.jibx', version: '1.3.3') {
|
||||
entry 'jibx-bind'
|
||||
entry 'jibx-run'
|
||||
}
|
||||
dependency "org.ogce:xpp3:1.1.6"
|
||||
dependency "org.yaml:snakeyaml:1.25"
|
||||
dependency "org.yaml:snakeyaml:1.26"
|
||||
|
||||
dependency "com.h2database:h2:1.4.200"
|
||||
dependency "com.github.ben-manes.caffeine:caffeine:2.8.0"
|
||||
dependency "com.github.librepdf:openpdf:1.3.11"
|
||||
dependency "com.github.ben-manes.caffeine:caffeine:2.8.1"
|
||||
dependency "com.github.librepdf:openpdf:1.3.13"
|
||||
dependency "com.rometools:rome:1.12.2"
|
||||
dependency "commons-io:commons-io:2.5"
|
||||
dependency "io.vavr:vavr:0.10.0"
|
||||
dependency "io.vavr:vavr:0.10.2"
|
||||
dependency "net.sf.jopt-simple:jopt-simple:5.0.4"
|
||||
dependencySet(group: 'org.apache.activemq', version: '5.8.0') {
|
||||
entry 'activemq-broker'
|
||||
@@ -116,12 +101,12 @@ configure(allprojects) { project ->
|
||||
entry 'activemq-stomp'
|
||||
}
|
||||
dependency "org.apache.bcel:bcel:6.0"
|
||||
dependency "org.apache.commons:commons-pool2:2.6.0"
|
||||
dependency "org.apache.commons:commons-pool2:2.8.0"
|
||||
dependencySet(group: 'org.apache.derby', version: '10.14.2.0') {
|
||||
entry 'derby'
|
||||
entry 'derbyclient'
|
||||
}
|
||||
dependency "org.apache.poi:poi-ooxml:4.1.1"
|
||||
dependency "org.apache.poi:poi-ooxml:4.1.2"
|
||||
dependency "org.beanshell:bsh:2.0b5"
|
||||
dependency "org.freemarker:freemarker:2.3.29"
|
||||
dependency "org.hsqldb:hsqldb:2.5.0"
|
||||
@@ -130,23 +115,23 @@ configure(allprojects) { project ->
|
||||
dependency "net.sf.ehcache:ehcache:2.10.6"
|
||||
dependency "org.ehcache:jcache:1.0.1"
|
||||
dependency "org.ehcache:ehcache:3.4.0"
|
||||
dependency "org.hibernate:hibernate-core:5.4.9.Final"
|
||||
dependency "org.hibernate:hibernate-validator:6.1.0.Final"
|
||||
dependency "org.hibernate:hibernate-core:5.4.12.Final"
|
||||
dependency "org.hibernate:hibernate-validator:6.1.2.Final"
|
||||
dependency "org.webjars:webjars-locator-core:0.43"
|
||||
dependency "org.webjars:underscorejs:1.8.3"
|
||||
|
||||
dependencySet(group: 'org.apache.tomcat', version: '9.0.29') {
|
||||
dependencySet(group: 'org.apache.tomcat', version: '9.0.31') {
|
||||
entry 'tomcat-util'
|
||||
entry('tomcat-websocket') {
|
||||
exclude group: "org.apache.tomcat", name: "tomcat-websocket-api"
|
||||
exclude group: "org.apache.tomcat", name: "tomcat-servlet-api"
|
||||
}
|
||||
}
|
||||
dependencySet(group: 'org.apache.tomcat.embed', version: '9.0.29') {
|
||||
dependencySet(group: 'org.apache.tomcat.embed', version: '9.0.31') {
|
||||
entry 'tomcat-embed-core'
|
||||
entry 'tomcat-embed-websocket'
|
||||
}
|
||||
dependencySet(group: 'io.undertow', version: '2.0.28.Final') {
|
||||
dependencySet(group: 'io.undertow', version: '2.0.30.Final') {
|
||||
entry 'undertow-core'
|
||||
entry('undertow-websockets-jsr') {
|
||||
exclude group: "org.jboss.spec.javax.websocket", name: "jboss-websocket-api_1.1_spec"
|
||||
@@ -157,19 +142,19 @@ configure(allprojects) { project ->
|
||||
}
|
||||
}
|
||||
|
||||
dependencySet(group: 'com.squareup.okhttp3', version: '3.14.4') {
|
||||
dependencySet(group: 'com.squareup.okhttp3', version: '3.14.7') {
|
||||
entry 'okhttp'
|
||||
entry 'mockwebserver'
|
||||
}
|
||||
dependency("org.apache.httpcomponents:httpclient:4.5.10") {
|
||||
dependency("org.apache.httpcomponents:httpclient:4.5.11") {
|
||||
exclude group: "commons-logging", name: "commons-logging"
|
||||
}
|
||||
dependency("org.apache.httpcomponents:httpasyncclient:4.1.4") {
|
||||
exclude group: "commons-logging", name: "commons-logging"
|
||||
}
|
||||
dependency "org.eclipse.jetty:jetty-reactive-httpclient:1.0.3"
|
||||
dependency "org.eclipse.jetty:jetty-reactive-httpclient:1.1.2"
|
||||
|
||||
dependency "org.jruby:jruby:9.2.9.0"
|
||||
dependency "org.jruby:jruby:9.2.11.0"
|
||||
dependency "org.python:jython-standalone:2.7.1"
|
||||
dependency "org.mozilla:rhino:1.7.11"
|
||||
|
||||
@@ -194,14 +179,14 @@ configure(allprojects) { project ->
|
||||
dependency "org.testng:testng:6.14.3"
|
||||
dependency "org.hamcrest:hamcrest:2.1"
|
||||
dependency "org.awaitility:awaitility:3.1.6"
|
||||
dependency "org.assertj:assertj-core:3.14.0"
|
||||
dependency "org.assertj:assertj-core:3.15.0"
|
||||
dependencySet(group: 'org.xmlunit', version: '2.6.2') {
|
||||
entry 'xmlunit-assertj'
|
||||
entry('xmlunit-matchers') {
|
||||
exclude group: "org.hamcrest", name: "hamcrest-core"
|
||||
}
|
||||
}
|
||||
dependencySet(group: 'org.mockito', version: '3.2.0') {
|
||||
dependencySet(group: 'org.mockito', version: '3.2.4') {
|
||||
entry('mockito-core') {
|
||||
exclude group: "org.hamcrest", name: "hamcrest-core"
|
||||
}
|
||||
@@ -209,10 +194,10 @@ configure(allprojects) { project ->
|
||||
}
|
||||
dependency "io.mockk:mockk:1.9.3"
|
||||
|
||||
dependency("net.sourceforge.htmlunit:htmlunit:2.36.0") {
|
||||
dependency("net.sourceforge.htmlunit:htmlunit:2.38.0") {
|
||||
exclude group: "commons-logging", name: "commons-logging"
|
||||
}
|
||||
dependency("org.seleniumhq.selenium:htmlunit-driver:2.36.0") {
|
||||
dependency("org.seleniumhq.selenium:htmlunit-driver:2.38.0") {
|
||||
exclude group: "commons-logging", name: "commons-logging"
|
||||
}
|
||||
dependency("org.seleniumhq.selenium:selenium-java:3.141.59") {
|
||||
@@ -239,8 +224,8 @@ configure(allprojects) { project ->
|
||||
|
||||
dependency "com.ibm.websphere:uow:6.0.2.17"
|
||||
dependency "com.jamonapi:jamon:2.81"
|
||||
dependency "joda-time:joda-time:2.10.4"
|
||||
dependency "org.eclipse.persistence:org.eclipse.persistence.jpa:2.7.5"
|
||||
dependency "joda-time:joda-time:2.10.5"
|
||||
dependency "org.eclipse.persistence:org.eclipse.persistence.jpa:2.7.6"
|
||||
dependency "org.javamoney:moneta:1.3"
|
||||
|
||||
dependency "com.sun.activation:javax.activation:1.2.0"
|
||||
@@ -308,8 +293,10 @@ configure([rootProject] + javaProjects) { project ->
|
||||
group = "org.springframework"
|
||||
|
||||
apply plugin: "java"
|
||||
apply plugin: "java-test-fixtures"
|
||||
apply plugin: "checkstyle"
|
||||
apply plugin: 'org.springframework.build.compile'
|
||||
apply from: "${rootDir}/gradle/custom-java-home.gradle"
|
||||
apply from: "${rootDir}/gradle/ide.gradle"
|
||||
|
||||
pluginManager.withPlugin("kotlin") {
|
||||
@@ -338,7 +325,7 @@ configure([rootProject] + javaProjects) { project ->
|
||||
}
|
||||
|
||||
checkstyle {
|
||||
toolVersion = "8.27"
|
||||
toolVersion = "8.30"
|
||||
configDir = rootProject.file("src/checkstyle")
|
||||
}
|
||||
|
||||
@@ -372,14 +359,14 @@ configure([rootProject] + javaProjects) { project ->
|
||||
"https://tiles.apache.org/tiles-request/apidocs/",
|
||||
"https://tiles.apache.org/framework/apidocs/",
|
||||
"https://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
|
||||
"https://www.ehcache.org/apidocs/2.10.4",
|
||||
"https://www.ehcache.org/apidocs/2.10.4/",
|
||||
"https://www.quartz-scheduler.org/api/2.3.0/",
|
||||
"https://fasterxml.github.io/jackson-core/javadoc/2.10/",
|
||||
"https://fasterxml.github.io/jackson-databind/javadoc/2.10/",
|
||||
"https://fasterxml.github.io/jackson-dataformat-xml/javadoc/2.10/",
|
||||
"https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/",
|
||||
"https://junit.org/junit4/javadoc/4.12/",
|
||||
"https://junit.org/junit5/docs/5.5.2/api/"
|
||||
"https://junit.org/junit5/docs/5.6.1/api/"
|
||||
] as String[]
|
||||
}
|
||||
|
||||
@@ -412,10 +399,6 @@ configure(rootProject) {
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
asciidoctor("io.spring.asciidoctor:spring-asciidoctor-extensions:0.1.3.RELEASE")
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
|
||||
+5
-11
@@ -1,4 +1,4 @@
|
||||
# Spring Framework build
|
||||
# Spring Framework Build
|
||||
|
||||
This folder contains the custom plugins and conventions for the Spring Framework build.
|
||||
They are declared in the `build.gradle` file in this folder.
|
||||
@@ -7,8 +7,8 @@ They are declared in the `build.gradle` file in this folder.
|
||||
|
||||
### Compiler conventions
|
||||
|
||||
The `org.springframework.build.compile` applies the Java compiler conventions to the build.
|
||||
By default, the build is compiling sources with the `1.8` source and target compatibility.
|
||||
The `org.springframework.build.compile` plugin applies the Java compiler conventions to the build.
|
||||
By default, the build compiles sources with Java `1.8` source and target compatibility.
|
||||
You can test a different source compatibility version on the CLI with a project property like:
|
||||
|
||||
```
|
||||
@@ -25,17 +25,11 @@ but doesn't affect the classpath of dependent projects.
|
||||
This plugin does not provide a `provided` configuration, as the native `compileOnly` and `testCompileOnly`
|
||||
configurations are preferred.
|
||||
|
||||
## Test sources
|
||||
|
||||
The `org.springframework.build.test-sources` updates `testCompile` dependencies to include
|
||||
the test source sets of `project()` dependencies. This plugin is used in the Spring Framework build
|
||||
to share test utilities and fixtures amongst modules.
|
||||
|
||||
## API Diff
|
||||
|
||||
This plugin uses the [Gradle JApiCmp](https://github.com/melix/japicmp-gradle-plugin) plugin
|
||||
to generate API Diff reports for each Spring Framework module. This plugin is applied once on the root
|
||||
project and create tasks in each framework module. Unlike previous versions of this part of the build,
|
||||
project and creates tasks in each framework module. Unlike previous versions of this part of the build,
|
||||
there is no need for checking out a specific tag. The plugin will fetch the JARs we want to compare the
|
||||
current working version with. You can generate the reports for all modules or a single module:
|
||||
|
||||
@@ -44,4 +38,4 @@ current working version with. You can generate the reports for all modules or a
|
||||
./gradlew :spring-core:apiDiff -PbaselineVersion=5.1.0.RELEASE
|
||||
```
|
||||
|
||||
The reports are located under `build/reports/api-diff/$OLDVERSION_to_$NEWVERSION/`.
|
||||
The reports are located under `build/reports/api-diff/$OLDVERSION_to_$NEWVERSION/`.
|
||||
|
||||
@@ -9,7 +9,7 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
implementation "me.champeau.gradle:japicmp-gradle-plugin:0.2.8"
|
||||
implementation "com.google.guava:guava:18.0" // required by japicmp-gradle-plugin
|
||||
implementation "com.google.guava:guava:28.2-jre" // required by japicmp-gradle-plugin
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
@@ -26,9 +26,5 @@ gradlePlugin {
|
||||
id = "org.springframework.build.optional-dependencies"
|
||||
implementationClass = "org.springframework.build.optional.OptionalDependenciesPlugin"
|
||||
}
|
||||
testSourcesPlugin {
|
||||
id = "org.springframework.build.test-sources"
|
||||
implementationClass = "org.springframework.build.testsources.TestSourcesPlugin"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
-9
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -33,6 +33,7 @@ import org.gradle.api.tasks.compile.JavaCompile;
|
||||
* with a dedicated property on the CLI: {@code "./gradlew test -PjavaSourceVersion=11"}.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
* @author Sam Brannen
|
||||
*/
|
||||
public class CompilerConventionsPlugin implements Plugin<Project> {
|
||||
|
||||
@@ -40,13 +41,13 @@ public class CompilerConventionsPlugin implements Plugin<Project> {
|
||||
* The project property that can be used to switch the Java source
|
||||
* compatibility version for building source and test classes.
|
||||
*/
|
||||
public static String JAVA_SOURCE_VERSION_PROPERTY = "javaSourceVersion";
|
||||
public static final String JAVA_SOURCE_VERSION_PROPERTY = "javaSourceVersion";
|
||||
|
||||
public static JavaVersion DEFAULT_COMPILER_VERSION = JavaVersion.VERSION_1_8;
|
||||
public static final JavaVersion DEFAULT_COMPILER_VERSION = JavaVersion.VERSION_1_8;
|
||||
|
||||
private static List<String> COMPILER_ARGS;
|
||||
private static final List<String> COMPILER_ARGS;
|
||||
|
||||
private static List<String> TEST_COMPILER_ARGS;
|
||||
private static final List<String> TEST_COMPILER_ARGS;
|
||||
|
||||
static {
|
||||
List<String> commonCompilerArgs = Arrays.asList(
|
||||
@@ -72,7 +73,8 @@ public class CompilerConventionsPlugin implements Plugin<Project> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies the common Java compiler options for sources and test sources.
|
||||
* Applies the common Java compiler options for main sources, test fixture sources, and
|
||||
* test sources.
|
||||
* @param project the current project
|
||||
*/
|
||||
private void applyJavaCompileConventions(Project project) {
|
||||
@@ -87,16 +89,18 @@ public class CompilerConventionsPlugin implements Plugin<Project> {
|
||||
java.setTargetCompatibility(DEFAULT_COMPILER_VERSION);
|
||||
|
||||
project.getTasks().withType(JavaCompile.class)
|
||||
.matching(javaCompile -> javaCompile.getName().equals(JavaPlugin.COMPILE_JAVA_TASK_NAME))
|
||||
.matching(compileTask -> compileTask.getName().equals(JavaPlugin.COMPILE_JAVA_TASK_NAME))
|
||||
.forEach(compileTask -> {
|
||||
compileTask.getOptions().setCompilerArgs(COMPILER_ARGS);
|
||||
compileTask.getOptions().setEncoding("UTF-8");
|
||||
});
|
||||
project.getTasks().withType(JavaCompile.class)
|
||||
.matching(javaCompile -> javaCompile.getName().equals(JavaPlugin.COMPILE_TEST_JAVA_TASK_NAME))
|
||||
.matching(compileTask -> compileTask.getName().equals(JavaPlugin.COMPILE_TEST_JAVA_TASK_NAME)
|
||||
|| compileTask.getName().equals("compileTestFixturesJava"))
|
||||
.forEach(compileTask -> {
|
||||
compileTask.getOptions().setCompilerArgs(TEST_COMPILER_ARGS);
|
||||
compileTask.getOptions().setEncoding("UTF-8");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.build.testsources;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.gradle.api.Plugin;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.artifacts.Configuration;
|
||||
import org.gradle.api.artifacts.ProjectDependency;
|
||||
import org.gradle.api.plugins.JavaPlugin;
|
||||
import org.gradle.api.plugins.JavaPluginConvention;
|
||||
import org.gradle.api.tasks.SourceSet;
|
||||
import org.gradle.api.tasks.SourceSetOutput;
|
||||
|
||||
import org.springframework.build.optional.OptionalDependenciesPlugin;
|
||||
|
||||
/**
|
||||
* {@link Plugin} that automatically updates testCompile dependencies to include
|
||||
* the test source sets of {@code project()} dependencies.
|
||||
*
|
||||
* <p>This plugin is used in the Spring Framework build to share test utilities and fixtures
|
||||
* between projects.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Brian Clozel
|
||||
*/
|
||||
public class TestSourcesPlugin implements Plugin<Project> {
|
||||
|
||||
/**
|
||||
* List of configurations this plugin should look for project dependencies in.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
private static final List<String> CONFIGURATIONS = Arrays.asList(
|
||||
JavaPlugin.COMPILE_CONFIGURATION_NAME,
|
||||
JavaPlugin.API_CONFIGURATION_NAME,
|
||||
JavaPlugin.IMPLEMENTATION_CONFIGURATION_NAME,
|
||||
OptionalDependenciesPlugin.OPTIONAL_CONFIGURATION_NAME,
|
||||
JavaPlugin.TEST_COMPILE_CONFIGURATION_NAME);
|
||||
|
||||
@Override
|
||||
public void apply(Project project) {
|
||||
project.getPlugins().withType(JavaPlugin.class, (plugin) -> addTestSourcesToProject(project));
|
||||
}
|
||||
|
||||
private void addTestSourcesToProject(Project project) {
|
||||
project.afterEvaluate(currentProject -> {
|
||||
Set<ProjectDependency> projectDependencies = new LinkedHashSet<>();
|
||||
collectProjectDependencies(projectDependencies, project);
|
||||
projectDependencies.forEach(dep -> addTestSourcesFromDependency(currentProject, dep));
|
||||
});
|
||||
}
|
||||
|
||||
private void collectProjectDependencies(Set<ProjectDependency> projectDependencies, Project project) {
|
||||
for (String configurationName : CONFIGURATIONS) {
|
||||
Configuration configuration = project.getConfigurations().findByName(configurationName);
|
||||
if (configuration != null) {
|
||||
configuration.getDependencies().forEach(dependency -> {
|
||||
if (dependency instanceof ProjectDependency) {
|
||||
ProjectDependency projectDependency = (ProjectDependency) dependency;
|
||||
projectDependencies.add(projectDependency);
|
||||
collectProjectDependencies(projectDependencies, projectDependency.getDependencyProject());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addTestSourcesFromDependency(final Project currentProject, ProjectDependency dependency) {
|
||||
Project dependencyProject = dependency.getDependencyProject();
|
||||
dependencyProject.getPlugins().withType(JavaPlugin.class, plugin -> {
|
||||
final JavaPluginConvention javaPlugin = dependencyProject.getConvention()
|
||||
.getPlugin(JavaPluginConvention.class);
|
||||
SourceSetOutput test = javaPlugin.getSourceSets().findByName(SourceSet.TEST_SOURCE_SET_NAME).getOutput();
|
||||
currentProject.getDependencies().add(JavaPlugin.TEST_COMPILE_CONFIGURATION_NAME, test);
|
||||
});
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
version=5.2.2.BUILD-SNAPSHOT
|
||||
version=5.2.5.RELEASE
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
|
||||
@@ -1,90 +1,16 @@
|
||||
tagOs()
|
||||
tagIde()
|
||||
tagCiOrLocal()
|
||||
addCiMetadata()
|
||||
addGitMetadata()
|
||||
addTestTaskMetadata()
|
||||
addCustomJavaHomeMetadata()
|
||||
addCustomJavaSourceVersionMetadata()
|
||||
|
||||
void tagOs() {
|
||||
buildScan.tag System.getProperty('os.name')
|
||||
}
|
||||
|
||||
void tagIde() {
|
||||
if (System.getProperty('idea.version')) {
|
||||
buildScan.tag 'IntelliJ IDEA'
|
||||
} else if (System.getProperty('eclipse.buildId')) {
|
||||
buildScan.tag 'Eclipse'
|
||||
void addCustomJavaHomeMetadata() {
|
||||
def customJavaHome = System.getProperty("customJavaHome")
|
||||
if (customJavaHome) {
|
||||
buildScan.value "Custom JAVA_HOME", customJavaHome
|
||||
}
|
||||
}
|
||||
|
||||
void tagCiOrLocal() {
|
||||
buildScan.tag(isCi() ? 'CI' : 'LOCAL')
|
||||
}
|
||||
|
||||
void addGitMetadata() {
|
||||
buildScan.background {
|
||||
def gitCommitId = execAndGetStdout('git', 'rev-parse', '--short=8', '--verify', 'HEAD')
|
||||
def gitBranchName = execAndGetStdout('git', 'rev-parse', '--abbrev-ref', 'HEAD')
|
||||
def gitStatus = execAndGetStdout('git', 'status', '--porcelain')
|
||||
|
||||
if(gitCommitId) {
|
||||
def commitIdLabel = 'Git Commit ID'
|
||||
value commitIdLabel, gitCommitId
|
||||
link 'Git commit build scans', customValueSearchUrl([(commitIdLabel): gitCommitId])
|
||||
}
|
||||
if (gitBranchName) {
|
||||
tag gitBranchName
|
||||
value 'Git branch', gitBranchName
|
||||
}
|
||||
if (gitStatus) {
|
||||
tag 'dirty'
|
||||
value 'Git status', gitStatus
|
||||
}
|
||||
void addCustomJavaSourceVersionMetadata() {
|
||||
def customJavaSourceVersion = System.getProperty("customJavaSourceVersion")
|
||||
if (customJavaSourceVersion) {
|
||||
buildScan.value "Custom Java Source Version", customJavaSourceVersion
|
||||
}
|
||||
}
|
||||
|
||||
void addCiMetadata() {
|
||||
def ciBuild = 'CI BUILD'
|
||||
if (isBamboo()) {
|
||||
buildScan.link ciBuild, System.getenv('bamboo_resultsUrl')
|
||||
}
|
||||
}
|
||||
|
||||
void addTestTaskMetadata() {
|
||||
allprojects {
|
||||
tasks.withType(Test) { test ->
|
||||
doFirst {
|
||||
buildScan.value "Test#maxParallelForks[${test.path}]", test.maxParallelForks.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean isCi() {
|
||||
isBamboo()
|
||||
}
|
||||
|
||||
boolean isBamboo() {
|
||||
System.getenv('bamboo_resultsUrl')
|
||||
}
|
||||
|
||||
String execAndGetStdout(String... args) {
|
||||
def stdout = new ByteArrayOutputStream()
|
||||
exec {
|
||||
commandLine(args)
|
||||
standardOutput = stdout
|
||||
}
|
||||
return stdout.toString().trim()
|
||||
}
|
||||
|
||||
String customValueSearchUrl(Map<String, String> search) {
|
||||
def query = search.collect { name, value ->
|
||||
"search.names=${encodeURL(name)}&search.values=${encodeURL(value)}"
|
||||
}.join('&')
|
||||
|
||||
"$buildScan.server/scans?$query"
|
||||
}
|
||||
|
||||
String encodeURL(String url) {
|
||||
URLEncoder.encode(url, 'UTF-8')
|
||||
}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
//
|
||||
// This script adds support for the following two JVM system properties
|
||||
// that control the build for alternative JDKs (i.e., a JDK other than
|
||||
// the one used to launch the Gradle process).
|
||||
//
|
||||
// - customJavaHome: absolute path to the alternate JDK installation to
|
||||
// use to compile Java code and execute tests. This system property
|
||||
// is also used in spring-oxm.gradle to determine whether JiBX is
|
||||
// supported.
|
||||
//
|
||||
// - customJavaSourceVersion: Java version supplied to the `--release`
|
||||
// command line flag to control the Java source and target
|
||||
// compatibility version. Supported versions include 9 or higher.
|
||||
// Do not set this system property if Java 8 should be used.
|
||||
//
|
||||
// Examples:
|
||||
//
|
||||
// ./gradlew -DcustomJavaHome=/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home test
|
||||
//
|
||||
// ./gradlew --no-build-cache -DcustomJavaHome=/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home test
|
||||
//
|
||||
// ./gradlew -DcustomJavaHome=/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home -DcustomJavaSourceVersion=14 test
|
||||
//
|
||||
//
|
||||
// Credits: inspired by work from Marc Philipp and Stephane Nicoll
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
import org.gradle.internal.os.OperatingSystem
|
||||
// import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile
|
||||
|
||||
def customJavaHome = System.getProperty("customJavaHome")
|
||||
|
||||
if (customJavaHome) {
|
||||
def customJavaHomeDir = new File(customJavaHome)
|
||||
def customJavaSourceVersion = System.getProperty("customJavaSourceVersion")
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
logger.info("Java home for " + it.name + " task in " + project.name + ": " + customJavaHomeDir)
|
||||
options.forkOptions.javaHome = customJavaHomeDir
|
||||
inputs.property("customJavaHome", customJavaHome)
|
||||
if (customJavaSourceVersion) {
|
||||
options.compilerArgs += [ "--release", customJavaSourceVersion]
|
||||
inputs.property("customJavaSourceVersion", customJavaSourceVersion)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(GroovyCompile) {
|
||||
logger.info("Java home for " + it.name + " task in " + project.name + ": " + customJavaHomeDir)
|
||||
options.forkOptions.javaHome = customJavaHomeDir
|
||||
inputs.property("customJavaHome", customJavaHome)
|
||||
if (customJavaSourceVersion) {
|
||||
options.compilerArgs += [ "--release", customJavaSourceVersion]
|
||||
inputs.property("customJavaSourceVersion", customJavaSourceVersion)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
tasks.withType(KotlinJvmCompile) {
|
||||
logger.info("Java home for " + it.name + " task in " + project.name + ": " + customJavaHome)
|
||||
kotlinOptions.jdkHome = customJavaHomeDir
|
||||
inputs.property("customJavaHome", customJavaHome)
|
||||
}
|
||||
*/
|
||||
|
||||
tasks.withType(Test) {
|
||||
def javaExecutable = customJavaHome + "/bin/java"
|
||||
if (OperatingSystem.current().isWindows()) {
|
||||
javaExecutable += ".exe"
|
||||
}
|
||||
logger.info("Java executable for " + it.name + " task in " + project.name + ": " + javaExecutable)
|
||||
executable = javaExecutable
|
||||
inputs.property("customJavaHome", customJavaHome)
|
||||
if (customJavaSourceVersion) {
|
||||
inputs.property("customJavaSourceVersion", customJavaSourceVersion)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+66
-29
@@ -1,3 +1,20 @@
|
||||
configurations {
|
||||
asciidoctorExt
|
||||
}
|
||||
|
||||
dependencies {
|
||||
asciidoctorExt("io.spring.asciidoctor:spring-asciidoctor-extensions-block-switch:0.4.0.RELEASE")
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url "https://repo.spring.io/release"
|
||||
mavenContent {
|
||||
includeGroup "io.spring.asciidoctor"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce Javadoc for all Spring Framework modules in "build/docs/javadoc"
|
||||
*/
|
||||
@@ -48,34 +65,47 @@ dokka {
|
||||
dependsOn {
|
||||
tasks.getByName("api")
|
||||
}
|
||||
|
||||
doFirst {
|
||||
classpath = moduleProjects.collect { project -> project.jar.outputs.files.getFiles() }.flatten()
|
||||
classpath += files(moduleProjects.collect { it.sourceSets.main.compileClasspath })
|
||||
sourceDirs = files(moduleProjects
|
||||
.findAll {
|
||||
it.pluginManager.hasPlugin("kotlin")
|
||||
configuration {
|
||||
classpath = moduleProjects.collect { project -> project.jar.outputs.files.getFiles() }.flatten()
|
||||
classpath += files(moduleProjects.collect { it.sourceSets.main.compileClasspath })
|
||||
|
||||
moduleProjects.findAll {
|
||||
it.pluginManager.hasPlugin("kotlin")
|
||||
}.each { project ->
|
||||
def kotlinDirs = project.sourceSets.main.kotlin.srcDirs.collect()
|
||||
kotlinDirs -= project.sourceSets.main.java.srcDirs
|
||||
kotlinDirs.each { dir ->
|
||||
if (dir.exists()) {
|
||||
sourceRoot {
|
||||
path = dir.path
|
||||
}
|
||||
}
|
||||
}
|
||||
.collect { project ->
|
||||
def kotlinDirs = project.sourceSets.main.kotlin.srcDirs.collect()
|
||||
kotlinDirs -= project.sourceSets.main.java.srcDirs
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
moduleName = "spring-framework"
|
||||
|
||||
outputFormat = "html"
|
||||
outputDirectory = "$buildDir/docs/kdoc"
|
||||
|
||||
externalDocumentationLink {
|
||||
url = new URL("https://docs.spring.io/spring-framework/docs/$version/javadoc-api/")
|
||||
packageListUrl = new File(buildDir, "docs/javadoc/package-list").toURI().toURL()
|
||||
}
|
||||
externalDocumentationLink {
|
||||
url = new URL("https://projectreactor.io/docs/core/release/api/")
|
||||
}
|
||||
externalDocumentationLink {
|
||||
url = new URL("https://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/")
|
||||
}
|
||||
externalDocumentationLink {
|
||||
url = new URL("https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/")
|
||||
configuration {
|
||||
moduleName = "spring-framework"
|
||||
|
||||
externalDocumentationLink {
|
||||
url = new URL("https://docs.spring.io/spring-framework/docs/$version/javadoc-api/")
|
||||
packageListUrl = new File(buildDir, "docs/javadoc/package-list").toURI().toURL()
|
||||
}
|
||||
externalDocumentationLink {
|
||||
url = new URL("https://projectreactor.io/docs/core/release/api/")
|
||||
}
|
||||
externalDocumentationLink {
|
||||
url = new URL("https://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/")
|
||||
}
|
||||
externalDocumentationLink {
|
||||
url = new URL("https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,11 +123,22 @@ task extractDocResources(type: Copy, dependsOn: downloadResources) {
|
||||
into "$buildDir/docs/spring-docs-resources/"
|
||||
}
|
||||
|
||||
asciidoctorj {
|
||||
modules {
|
||||
pdf {
|
||||
version '1.5.0-beta.8'
|
||||
}
|
||||
}
|
||||
fatalWarnings ".*"
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce the Spring Framework Reference documentation
|
||||
* from "src/docs/asciidoc" into "build/asciidoc/html5"
|
||||
*/
|
||||
asciidoctor {
|
||||
baseDirFollowsSourceDir()
|
||||
configurations 'asciidoctorExt'
|
||||
sources {
|
||||
include '*.adoc'
|
||||
}
|
||||
@@ -106,13 +147,11 @@ asciidoctor {
|
||||
from(sourceDir) {
|
||||
include 'images/*', 'css/**', 'js/**'
|
||||
}
|
||||
from "$buildDir/docs/spring-docs-resources/"
|
||||
from extractDocResources
|
||||
}
|
||||
logDocuments = true
|
||||
backends = ["html5"]
|
||||
// only ouput PDF documentation for non-SNAPSHOT builds
|
||||
if (!project.getVersion().toString().contains("BUILD-SNAPSHOT")) {
|
||||
backends += "pdf"
|
||||
outputOptions {
|
||||
backends = ["html5", "pdf"]
|
||||
}
|
||||
options doctype: 'book', eruby: 'erubis'
|
||||
attributes([
|
||||
@@ -132,8 +171,6 @@ asciidoctor {
|
||||
])
|
||||
}
|
||||
|
||||
asciidoctor.dependsOn extractDocResources
|
||||
|
||||
/**
|
||||
* Zip all docs (API and reference) into a single archive
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
apply plugin: 'org.springframework.build.compile'
|
||||
apply plugin: 'org.springframework.build.optional-dependencies'
|
||||
apply plugin: 'org.springframework.build.test-sources'
|
||||
apply from: "$rootDir/gradle/publications.gradle"
|
||||
|
||||
jar {
|
||||
@@ -62,3 +61,11 @@ publishing {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Disable publication of test fixture artifacts.
|
||||
//
|
||||
// Once we upgrade to Gradle 6.x, we will need to delete the following line ...
|
||||
components.java.variants.removeAll { it.outgoingConfiguration.name.startsWith("testFixtures") }
|
||||
// ... and uncomment the following two lines.
|
||||
// components.java.withVariantsFromConfiguration(configurations.testFixturesApiElements) { skip() }
|
||||
// components.java.withVariantsFromConfiguration(configurations.testFixturesRuntimeElements) { skip() }
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
This document will guide you through the process of importing the Spring Framework
|
||||
projects into Eclipse or the Spring Tool Suite (_STS_). It is recommended that you
|
||||
have a recent version of Eclipse. As a bare minimum you will need Eclipse with full Java
|
||||
8 support, the Kotlin plugin, and the Groovy plugin.
|
||||
8 support, Eclipse Buildship, the Kotlin plugin, and the Groovy plugin.
|
||||
|
||||
The following instructions have been tested against [STS](https://spring.io/tools) 4.3.2
|
||||
([download](https://github.com/spring-projects/sts4/wiki/Previous-Versions#spring-tools-432-changelog))
|
||||
with [Eclipse Buildship](https://projects.eclipse.org/projects/tools.buildship). The
|
||||
instructions should work with the latest Eclipse distribution as long as you install
|
||||
(based on Eclipse 4.12) with [Eclipse Buildship](https://projects.eclipse.org/projects/tools.buildship).
|
||||
The instructions should work with the latest Eclipse distribution as long as you install
|
||||
[Buildship](https://marketplace.eclipse.org/content/buildship-gradle-integration). Note
|
||||
that STS 4 comes with Buildship preinstalled.
|
||||
|
||||
@@ -23,7 +23,7 @@ _When instructed to execute `./gradlew` from the command line, be sure to execut
|
||||
1. Switch to Groovy 2.5 (Preferences -> Groovy -> Compiler -> Switch to 2.5...) in Eclipse.
|
||||
1. Change the _Forbidden reference (access rule)_ in Eclipse from Error to Warning
|
||||
(Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and restricted API -> Forbidden reference (access rule)).
|
||||
1. Optionally install the [AspectJ Development Tools](https://www.eclipse.org/ajdt/downloads/) (_AJDT_) if you need to work with the `spring-aspects` project.
|
||||
1. Optionally install the [AspectJ Development Tools](https://marketplace.eclipse.org/content/aspectj-development-tools) (_AJDT_) if you need to work with the `spring-aspects` project. The AspectJ Development Tools available in the Eclipse Marketplace have been tested with these instructions using STS 4.5 (Eclipse 4.14).
|
||||
1. Optionally install the [TestNG plugin](https://testng.org/doc/eclipse.html) in Eclipse if you need to execute TestNG tests in the `spring-test` module.
|
||||
1. Build `spring-oxm` from the command line with `./gradlew :spring-oxm:check`.
|
||||
1. To apply project specific settings, run `./gradlew eclipseBuildship` from the command line.
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
description = "Spring Integration Tests"
|
||||
|
||||
apply plugin: "org.springframework.build.test-sources"
|
||||
|
||||
dependencies {
|
||||
testCompile(project(":spring-aop"))
|
||||
testCompile(project(":spring-beans"))
|
||||
testCompile(project(":spring-context"))
|
||||
testCompile(project(":spring-core"))
|
||||
testCompile(testFixtures(project(":spring-aop")))
|
||||
testCompile(testFixtures(project(":spring-beans")))
|
||||
testCompile(testFixtures(project(":spring-core")))
|
||||
testCompile(testFixtures(project(":spring-tx")))
|
||||
testCompile(project(":spring-expression"))
|
||||
testCompile(project(":spring-jdbc"))
|
||||
testCompile(project(":spring-orm"))
|
||||
|
||||
+3
-3
@@ -21,12 +21,12 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.core.testfixture.io.SerializationTestUtils;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.MockHttpSession;
|
||||
import org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
|
||||
+5
-5
@@ -26,17 +26,17 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor;
|
||||
import org.springframework.aop.testfixture.advice.CountingBeforeAdvice;
|
||||
import org.springframework.aop.testfixture.advice.MethodCounter;
|
||||
import org.springframework.aop.testfixture.interceptor.NopInterceptor;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.tests.aop.advice.CountingBeforeAdvice;
|
||||
import org.springframework.tests.aop.advice.MethodCounter;
|
||||
import org.springframework.tests.aop.interceptor.NopInterceptor;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.transaction.CallCountingTransactionManager;
|
||||
import org.springframework.transaction.NoTransactionException;
|
||||
import org.springframework.transaction.interceptor.TransactionInterceptor;
|
||||
import org.springframework.transaction.testfixture.CallCountingTransactionManager;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
+3
-3
@@ -28,19 +28,19 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.testfixture.EnabledForTestGroups;
|
||||
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
|
||||
import org.springframework.dao.support.PersistenceExceptionTranslator;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.tests.EnabledForTestGroups;
|
||||
import org.springframework.tests.transaction.CallCountingTransactionManager;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.testfixture.CallCountingTransactionManager;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.springframework.tests.TestGroup.PERFORMANCE;
|
||||
import static org.springframework.core.testfixture.TestGroup.PERFORMANCE;
|
||||
|
||||
/**
|
||||
* Integration tests cornering bug SPR-8651, which revealed that @Scheduled methods may
|
||||
|
||||
+1
-1
@@ -40,9 +40,9 @@ import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
|
||||
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.tests.transaction.CallCountingTransactionManager;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor;
|
||||
import org.springframework.transaction.testfixture.CallCountingTransactionManager;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
+4
-4
@@ -11,19 +11,19 @@
|
||||
|
||||
<bean id="advice" class="org.springframework.aop.interceptor.DebugInterceptor"/>
|
||||
|
||||
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
|
||||
<bean id="testBean" class="org.springframework.beans.testfixture.beans.TestBean"/>
|
||||
|
||||
<bean id="singletonScoped" class="org.springframework.tests.sample.beans.TestBean">
|
||||
<bean id="singletonScoped" class="org.springframework.beans.testfixture.beans.TestBean">
|
||||
<aop:scoped-proxy/>
|
||||
<property name="name" value="Rob Harrop"/>
|
||||
</bean>
|
||||
|
||||
<bean id="requestScoped" class="org.springframework.tests.sample.beans.TestBean" scope="request">
|
||||
<bean id="requestScoped" class="org.springframework.beans.testfixture.beans.TestBean" scope="request">
|
||||
<aop:scoped-proxy/>
|
||||
<property name="name" value="Rob Harrop"/>
|
||||
</bean>
|
||||
|
||||
<bean id="sessionScoped" name="sessionScopedAlias" class="org.springframework.tests.sample.beans.TestBean" scope="session">
|
||||
<bean id="sessionScoped" name="sessionScopedAlias" class="org.springframework.beans.testfixture.beans.TestBean" scope="session">
|
||||
<aop:scoped-proxy proxy-target-class="false"/>
|
||||
<property name="name" value="Rob Harrop"/>
|
||||
</bean>
|
||||
|
||||
+7
-7
@@ -34,7 +34,7 @@
|
||||
</bean>
|
||||
|
||||
<!-- Often we can leave the definition of such infrastructural beans to child factories -->
|
||||
<bean id="txManager" class="org.springframework.tests.transaction.CallCountingTransactionManager"/>
|
||||
<bean id="txManager" class="org.springframework.transaction.testfixture.CallCountingTransactionManager"/>
|
||||
|
||||
<bean id="tas" class="org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource">
|
||||
<property name="properties">
|
||||
@@ -74,20 +74,20 @@
|
||||
|
||||
<!-- These two beans would otherwise be eligible for autoproxying -->
|
||||
|
||||
<bean id="singletonDependency" class="org.springframework.tests.sample.beans.TestBean" scope="singleton"/>
|
||||
<bean id="singletonDependency" class="org.springframework.beans.testfixture.beans.TestBean" scope="singleton"/>
|
||||
|
||||
<bean id="prototypeDependency" class="org.springframework.tests.sample.beans.TestBean" scope="prototype"/>
|
||||
<bean id="prototypeDependency" class="org.springframework.beans.testfixture.beans.TestBean" scope="prototype"/>
|
||||
|
||||
<!-- ====== End test for prototype definitions to try to provoke circular references ========================= -->
|
||||
|
||||
<bean class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
|
||||
<property name="advice"><ref bean="countingAdvice"/></property>
|
||||
<property name="pattern"><value>org.springframework.tests.sample.beans.ITestBean.getName</value></property>
|
||||
<property name="pattern"><value>org.springframework.beans.testfixture.beans.ITestBean.getName</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="countingAdvice" class="org.springframework.tests.aop.advice.CountingAfterReturningAdvice"/>
|
||||
<bean id="countingAdvice" class="org.springframework.aop.testfixture.advice.CountingAfterReturningAdvice"/>
|
||||
|
||||
<bean id="test" class="org.springframework.tests.sample.beans.TestBean">
|
||||
<bean id="test" class="org.springframework.beans.testfixture.beans.TestBean">
|
||||
<property name="age"><value>4</value></property>
|
||||
</bean>
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
|
||||
<!-- The following beans test whether auto-proxying falls over for a null value -->
|
||||
|
||||
<bean id="tb" class="org.springframework.tests.sample.beans.TestBean"/>
|
||||
<bean id="tb" class="org.springframework.beans.testfixture.beans.TestBean"/>
|
||||
|
||||
<bean id="nullValueReturned" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
|
||||
<property name="targetObject" ref="tb"/>
|
||||
|
||||
@@ -6,4 +6,7 @@ dependencies {
|
||||
optional("org.aspectj:aspectjweaver")
|
||||
optional("org.apache.commons:commons-pool2")
|
||||
optional("com.jamonapi:jamon")
|
||||
testCompile(testFixtures(project(":spring-beans")))
|
||||
testCompile(testFixtures(project(":spring-core")))
|
||||
testFixturesImplementation(testFixtures(project(":spring-core")))
|
||||
}
|
||||
|
||||
+4
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -154,7 +154,9 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
|
||||
methods.add(method);
|
||||
}
|
||||
}, ReflectionUtils.USER_DECLARED_METHODS);
|
||||
methods.sort(METHOD_COMPARATOR);
|
||||
if (methods.size() > 1) {
|
||||
methods.sort(METHOD_COMPARATOR);
|
||||
}
|
||||
return methods;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -283,16 +283,15 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
||||
"This configuration only has " + this.advisors.size() + " advisors.");
|
||||
}
|
||||
|
||||
Advisor advisor = this.advisors.get(index);
|
||||
Advisor advisor = this.advisors.remove(index);
|
||||
if (advisor instanceof IntroductionAdvisor) {
|
||||
IntroductionAdvisor ia = (IntroductionAdvisor) advisor;
|
||||
// We need to remove introduction interfaces.
|
||||
for (int j = 0; j < ia.getInterfaces().length; j++) {
|
||||
removeInterface(ia.getInterfaces()[j]);
|
||||
for (Class<?> ifc : ia.getInterfaces()) {
|
||||
removeInterface(ifc);
|
||||
}
|
||||
}
|
||||
|
||||
this.advisors.remove(index);
|
||||
updateAdvisorArray();
|
||||
adviceChanged();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -67,7 +67,8 @@ public final class AopContext {
|
||||
Object proxy = currentProxy.get();
|
||||
if (proxy == null) {
|
||||
throw new IllegalStateException(
|
||||
"Cannot find current proxy: Set 'exposeProxy' property on Advised to 'true' to make it available.");
|
||||
"Cannot find current proxy: Set 'exposeProxy' property on Advised to 'true' to make it available, and " +
|
||||
"ensure that AopContext.currentProxy() is invoked in the same thread as the AOP invocation context.");
|
||||
}
|
||||
return proxy;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -258,15 +258,17 @@ class CglibAopProxy implements AopProxy, Serializable {
|
||||
int mod = method.getModifiers();
|
||||
if (!Modifier.isStatic(mod) && !Modifier.isPrivate(mod)) {
|
||||
if (Modifier.isFinal(mod)) {
|
||||
if (implementsInterface(method, ifcs)) {
|
||||
if (logger.isInfoEnabled() && implementsInterface(method, ifcs)) {
|
||||
logger.info("Unable to proxy interface-implementing method [" + method + "] because " +
|
||||
"it is marked as final: Consider using interface-based JDK proxies instead!");
|
||||
}
|
||||
logger.debug("Final method [" + method + "] cannot get proxied via CGLIB: " +
|
||||
"Calls to this method will NOT be routed to the target instance and " +
|
||||
"might lead to NPEs against uninitialized fields in the proxy instance.");
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Final method [" + method + "] cannot get proxied via CGLIB: " +
|
||||
"Calls to this method will NOT be routed to the target instance and " +
|
||||
"might lead to NPEs against uninitialized fields in the proxy instance.");
|
||||
}
|
||||
}
|
||||
else if (!Modifier.isPublic(mod) && !Modifier.isProtected(mod) &&
|
||||
else if (logger.isDebugEnabled() && !Modifier.isPublic(mod) && !Modifier.isProtected(mod) &&
|
||||
proxyClassLoader != null && proxySuperClass.getClassLoader() != proxyClassLoader) {
|
||||
logger.debug("Method [" + method + "] is package-visible across different ClassLoaders " +
|
||||
"and cannot get proxied via CGLIB: Declare this method as public or protected " +
|
||||
@@ -365,7 +367,7 @@ class CglibAopProxy implements AopProxy, Serializable {
|
||||
*/
|
||||
private static boolean implementsInterface(Method method, Set<Class<?>> ifcs) {
|
||||
for (Class<?> ifc : ifcs) {
|
||||
if (ClassUtils.hasMethod(ifc, method.getName(), method.getParameterTypes())) {
|
||||
if (ClassUtils.hasMethod(ifc, method)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -526,7 +528,7 @@ class CglibAopProxy implements AopProxy, Serializable {
|
||||
private static class StaticDispatcher implements Dispatcher, Serializable {
|
||||
|
||||
@Nullable
|
||||
private Object target;
|
||||
private final Object target;
|
||||
|
||||
public StaticDispatcher(@Nullable Object target) {
|
||||
this.target = target;
|
||||
@@ -552,7 +554,7 @@ class CglibAopProxy implements AopProxy, Serializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object loadObject() throws Exception {
|
||||
public Object loadObject() {
|
||||
return this.advised;
|
||||
}
|
||||
}
|
||||
@@ -872,15 +874,14 @@ class CglibAopProxy implements AopProxy, Serializable {
|
||||
}
|
||||
return AOP_PROXY;
|
||||
}
|
||||
Method key = method;
|
||||
// Check to see if we have fixed interceptor to serve this method.
|
||||
// Else use the AOP_PROXY.
|
||||
if (isStatic && isFrozen && this.fixedInterceptorMap.containsKey(key)) {
|
||||
if (isStatic && isFrozen && this.fixedInterceptorMap.containsKey(method)) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Method has advice and optimizations are enabled: " + method);
|
||||
}
|
||||
// We know that we are optimizing so we can use the FixedStaticChainInterceptors.
|
||||
int index = this.fixedInterceptorMap.get(key);
|
||||
int index = this.fixedInterceptorMap.get(method);
|
||||
return (index + this.fixedInterceptorOffset);
|
||||
}
|
||||
else {
|
||||
@@ -959,11 +960,11 @@ class CglibAopProxy implements AopProxy, Serializable {
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean equalsAdviceClasses(Advisor a, Advisor b) {
|
||||
private static boolean equalsAdviceClasses(Advisor a, Advisor b) {
|
||||
return (a.getAdvice().getClass() == b.getAdvice().getClass());
|
||||
}
|
||||
|
||||
private boolean equalsPointcuts(Advisor a, Advisor b) {
|
||||
private static boolean equalsPointcuts(Advisor a, Advisor b) {
|
||||
// If only one of the advisor (but not both) is PointcutAdvisor, then it is a mismatch.
|
||||
// Takes care of the situations where an IntroductionAdvisor is used (see SPR-3959).
|
||||
return (!(a instanceof PointcutAdvisor) ||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,9 +21,7 @@ import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.aopalliance.aop.Advice;
|
||||
import org.aopalliance.intercept.Interceptor;
|
||||
@@ -342,11 +340,8 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
||||
// an independent instance of the configuration.
|
||||
// In this case, no proxy will have an instance of this object's configuration,
|
||||
// but will have an independent copy.
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Creating copy of prototype ProxyFactoryBean config: " + this);
|
||||
}
|
||||
|
||||
ProxyCreatorSupport copy = new ProxyCreatorSupport(getAopProxyFactory());
|
||||
|
||||
// The copy needs a fresh advisor chain, and a fresh TargetSource.
|
||||
TargetSource targetSource = freshTargetSource();
|
||||
copy.copyConfigurationFrom(this, targetSource, freshAdvisorChain());
|
||||
@@ -359,9 +354,6 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
||||
}
|
||||
copy.setFrozen(this.freezeProxy);
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Using ProxyCreatorSupport copy: " + copy);
|
||||
}
|
||||
return getProxy(copy.createAopProxy());
|
||||
}
|
||||
|
||||
@@ -447,16 +439,12 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
||||
|
||||
// Materialize interceptor chain from bean names.
|
||||
for (String name : this.interceptorNames) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Configuring advisor or advice '" + name + "'");
|
||||
}
|
||||
|
||||
if (name.endsWith(GLOBAL_SUFFIX)) {
|
||||
if (!(this.beanFactory instanceof ListableBeanFactory)) {
|
||||
throw new AopConfigException(
|
||||
"Can only use global advisors or interceptors with a ListableBeanFactory");
|
||||
}
|
||||
addGlobalAdvisor((ListableBeanFactory) this.beanFactory,
|
||||
addGlobalAdvisors((ListableBeanFactory) this.beanFactory,
|
||||
name.substring(0, name.length() - GLOBAL_SUFFIX.length()));
|
||||
}
|
||||
|
||||
@@ -473,7 +461,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
||||
// Avoid unnecessary creation of prototype bean just for advisor chain initialization.
|
||||
advice = new PrototypePlaceholderAdvisor(name);
|
||||
}
|
||||
addAdvisorOnChainCreation(advice, name);
|
||||
addAdvisorOnChainCreation(advice);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -496,11 +484,10 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Refreshing bean named '" + pa.getBeanName() + "'");
|
||||
}
|
||||
// Replace the placeholder with a fresh prototype instance resulting
|
||||
// from a getBean() lookup
|
||||
// Replace the placeholder with a fresh prototype instance resulting from a getBean lookup
|
||||
if (this.beanFactory == null) {
|
||||
throw new IllegalStateException("No BeanFactory available anymore (probably due to serialization) " +
|
||||
"- cannot resolve prototype advisor '" + pa.getBeanName() + "'");
|
||||
throw new IllegalStateException("No BeanFactory available anymore (probably due to " +
|
||||
"serialization) - cannot resolve prototype advisor '" + pa.getBeanName() + "'");
|
||||
}
|
||||
Object bean = this.beanFactory.getBean(pa.getBeanName());
|
||||
Advisor refreshedAdvisor = namedBeanToAdvisor(bean);
|
||||
@@ -517,28 +504,26 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
||||
/**
|
||||
* Add all global interceptors and pointcuts.
|
||||
*/
|
||||
private void addGlobalAdvisor(ListableBeanFactory beanFactory, String prefix) {
|
||||
private void addGlobalAdvisors(ListableBeanFactory beanFactory, String prefix) {
|
||||
String[] globalAdvisorNames =
|
||||
BeanFactoryUtils.beanNamesForTypeIncludingAncestors(beanFactory, Advisor.class);
|
||||
String[] globalInterceptorNames =
|
||||
BeanFactoryUtils.beanNamesForTypeIncludingAncestors(beanFactory, Interceptor.class);
|
||||
List<Object> beans = new ArrayList<>(globalAdvisorNames.length + globalInterceptorNames.length);
|
||||
Map<Object, String> names = new HashMap<>(beans.size());
|
||||
for (String name : globalAdvisorNames) {
|
||||
Object bean = beanFactory.getBean(name);
|
||||
beans.add(bean);
|
||||
names.put(bean, name);
|
||||
}
|
||||
for (String name : globalInterceptorNames) {
|
||||
Object bean = beanFactory.getBean(name);
|
||||
beans.add(bean);
|
||||
names.put(bean, name);
|
||||
}
|
||||
AnnotationAwareOrderComparator.sort(beans);
|
||||
for (Object bean : beans) {
|
||||
String name = names.get(bean);
|
||||
if (name.startsWith(prefix)) {
|
||||
addAdvisorOnChainCreation(bean, name);
|
||||
if (globalAdvisorNames.length > 0 || globalInterceptorNames.length > 0) {
|
||||
List<Object> beans = new ArrayList<>(globalAdvisorNames.length + globalInterceptorNames.length);
|
||||
for (String name : globalAdvisorNames) {
|
||||
if (name.startsWith(prefix)) {
|
||||
beans.add(beanFactory.getBean(name));
|
||||
}
|
||||
}
|
||||
for (String name : globalInterceptorNames) {
|
||||
if (name.startsWith(prefix)) {
|
||||
beans.add(beanFactory.getBean(name));
|
||||
}
|
||||
}
|
||||
AnnotationAwareOrderComparator.sort(beans);
|
||||
for (Object bean : beans) {
|
||||
addAdvisorOnChainCreation(bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -549,17 +534,11 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
||||
* Because of these three possibilities, we can't type the signature
|
||||
* more strongly.
|
||||
* @param next advice, advisor or target object
|
||||
* @param name bean name from which we obtained this object in our owning
|
||||
* bean factory
|
||||
*/
|
||||
private void addAdvisorOnChainCreation(Object next, String name) {
|
||||
private void addAdvisorOnChainCreation(Object next) {
|
||||
// We need to convert to an Advisor if necessary so that our source reference
|
||||
// matches what we find from superclass interceptors.
|
||||
Advisor advisor = namedBeanToAdvisor(next);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Adding advisor with name '" + name + "'");
|
||||
}
|
||||
addAdvisor(advisor);
|
||||
addAdvisor(namedBeanToAdvisor(next));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -570,9 +549,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
||||
*/
|
||||
private TargetSource freshTargetSource() {
|
||||
if (this.targetName == null) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Not refreshing target: Bean name not specified in 'interceptorNames'.");
|
||||
}
|
||||
// Not refreshing target: bean name not specified in 'interceptorNames'
|
||||
return this.targetSource;
|
||||
}
|
||||
else {
|
||||
@@ -600,8 +577,8 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
||||
// We expected this to be an Advisor or Advice,
|
||||
// but it wasn't. This is a configuration error.
|
||||
throw new AopConfigException("Unknown advisor type " + next.getClass() +
|
||||
"; Can only include Advisor or Advice type beans in interceptorNames chain except for last entry," +
|
||||
"which may also be target or TargetSource", ex);
|
||||
"; can only include Advisor or Advice type beans in interceptorNames chain " +
|
||||
"except for last entry which may also be target instance or TargetSource", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -612,7 +589,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
||||
protected void adviceChanged() {
|
||||
super.adviceChanged();
|
||||
if (this.singleton) {
|
||||
logger.debug("Advice has changed; recaching singleton instance");
|
||||
logger.debug("Advice has changed; re-caching singleton instance");
|
||||
synchronized (this) {
|
||||
this.singletonInstance = null;
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -147,7 +147,7 @@ public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
|
||||
/**
|
||||
* The {@code Pattern} used to match placeholders.
|
||||
*/
|
||||
private static final Pattern PATTERN = Pattern.compile("\\$\\[\\p{Alpha}+\\]");
|
||||
private static final Pattern PATTERN = Pattern.compile("\\$\\[\\p{Alpha}+]");
|
||||
|
||||
/**
|
||||
* The {@code Set} of allowed placeholders.
|
||||
|
||||
+5
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -71,9 +71,11 @@ public final class ExposeInvocationInterceptor implements MethodInterceptor, Pri
|
||||
MethodInvocation mi = invocation.get();
|
||||
if (mi == null) {
|
||||
throw new IllegalStateException(
|
||||
"No MethodInvocation found: Check that an AOP invocation is in progress, and that the " +
|
||||
"No MethodInvocation found: Check that an AOP invocation is in progress and that the " +
|
||||
"ExposeInvocationInterceptor is upfront in the interceptor chain. Specifically, note that " +
|
||||
"advices with order HIGHEST_PRECEDENCE will execute before ExposeInvocationInterceptor!");
|
||||
"advices with order HIGHEST_PRECEDENCE will execute before ExposeInvocationInterceptor! " +
|
||||
"In addition, ExposeInvocationInterceptor and ExposeInvocationInterceptor.currentInvocation() " +
|
||||
"must be invoked from the same thread.");
|
||||
}
|
||||
return mi;
|
||||
}
|
||||
|
||||
+2
-2
@@ -73,8 +73,8 @@ public class SimpleTraceInterceptor extends AbstractTraceInterceptor {
|
||||
* @return the description
|
||||
*/
|
||||
protected String getInvocationDescription(MethodInvocation invocation) {
|
||||
return "method '" + invocation.getMethod().getName() + "' of class [" +
|
||||
invocation.getThis().getClass().getName() + "]";
|
||||
String className = invocation.getThis().getClass().getName();
|
||||
return "method '" + invocation.getMethod().getName() + "' of class [" + className + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+13
-13
@@ -31,10 +31,10 @@ import org.springframework.aop.MethodMatcher;
|
||||
import org.springframework.aop.Pointcut;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.aop.support.DefaultPointcutAdvisor;
|
||||
import org.springframework.tests.sample.beans.IOther;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.tests.sample.beans.subpkg.DeepBean;
|
||||
import org.springframework.beans.testfixture.beans.IOther;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.beans.testfixture.beans.subpkg.DeepBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
@@ -67,7 +67,7 @@ public class AspectJExpressionPointcutTests {
|
||||
|
||||
@Test
|
||||
public void testMatchExplicit() {
|
||||
String expression = "execution(int org.springframework.tests.sample.beans.TestBean.getAge())";
|
||||
String expression = "execution(int org.springframework.beans.testfixture.beans.TestBean.getAge())";
|
||||
|
||||
Pointcut pointcut = getPointcut(expression);
|
||||
ClassFilter classFilter = pointcut.getClassFilter();
|
||||
@@ -117,8 +117,8 @@ public class AspectJExpressionPointcutTests {
|
||||
* @param which this or target
|
||||
*/
|
||||
private void testThisOrTarget(String which) throws SecurityException, NoSuchMethodException {
|
||||
String matchesTestBean = which + "(org.springframework.tests.sample.beans.TestBean)";
|
||||
String matchesIOther = which + "(org.springframework.tests.sample.beans.IOther)";
|
||||
String matchesTestBean = which + "(org.springframework.beans.testfixture.beans.TestBean)";
|
||||
String matchesIOther = which + "(org.springframework.beans.testfixture.beans.IOther)";
|
||||
AspectJExpressionPointcut testBeanPc = new AspectJExpressionPointcut();
|
||||
testBeanPc.setExpression(matchesTestBean);
|
||||
|
||||
@@ -142,7 +142,7 @@ public class AspectJExpressionPointcutTests {
|
||||
}
|
||||
|
||||
private void testWithinPackage(boolean matchSubpackages) throws SecurityException, NoSuchMethodException {
|
||||
String withinBeansPackage = "within(org.springframework.tests.sample.beans.";
|
||||
String withinBeansPackage = "within(org.springframework.beans.testfixture.beans.";
|
||||
// Subpackages are matched by **
|
||||
if (matchSubpackages) {
|
||||
withinBeansPackage += ".";
|
||||
@@ -187,7 +187,7 @@ public class AspectJExpressionPointcutTests {
|
||||
|
||||
@Test
|
||||
public void testMatchWithArgs() throws Exception {
|
||||
String expression = "execution(void org.springframework.tests.sample.beans.TestBean.setSomeNumber(Number)) && args(Double)";
|
||||
String expression = "execution(void org.springframework.beans.testfixture.beans.TestBean.setSomeNumber(Number)) && args(Double)";
|
||||
|
||||
Pointcut pointcut = getPointcut(expression);
|
||||
ClassFilter classFilter = pointcut.getClassFilter();
|
||||
@@ -206,7 +206,7 @@ public class AspectJExpressionPointcutTests {
|
||||
|
||||
@Test
|
||||
public void testSimpleAdvice() {
|
||||
String expression = "execution(int org.springframework.tests.sample.beans.TestBean.getAge())";
|
||||
String expression = "execution(int org.springframework.beans.testfixture.beans.TestBean.getAge())";
|
||||
CallCountingInterceptor interceptor = new CallCountingInterceptor();
|
||||
TestBean testBean = getAdvisedProxy(expression, interceptor);
|
||||
|
||||
@@ -219,7 +219,7 @@ public class AspectJExpressionPointcutTests {
|
||||
|
||||
@Test
|
||||
public void testDynamicMatchingProxy() {
|
||||
String expression = "execution(void org.springframework.tests.sample.beans.TestBean.setSomeNumber(Number)) && args(Double)";
|
||||
String expression = "execution(void org.springframework.beans.testfixture.beans.TestBean.setSomeNumber(Number)) && args(Double)";
|
||||
CallCountingInterceptor interceptor = new CallCountingInterceptor();
|
||||
TestBean testBean = getAdvisedProxy(expression, interceptor);
|
||||
|
||||
@@ -233,7 +233,7 @@ public class AspectJExpressionPointcutTests {
|
||||
|
||||
@Test
|
||||
public void testInvalidExpression() {
|
||||
String expression = "execution(void org.springframework.tests.sample.beans.TestBean.setSomeNumber(Number) && args(Double)";
|
||||
String expression = "execution(void org.springframework.beans.testfixture.beans.TestBean.setSomeNumber(Number) && args(Double)";
|
||||
assertThatIllegalArgumentException().isThrownBy(
|
||||
getPointcut(expression)::getClassFilter); // call to getClassFilter forces resolution
|
||||
}
|
||||
@@ -264,7 +264,7 @@ public class AspectJExpressionPointcutTests {
|
||||
|
||||
@Test
|
||||
public void testWithUnsupportedPointcutPrimitive() {
|
||||
String expression = "call(int org.springframework.tests.sample.beans.TestBean.getAge())";
|
||||
String expression = "call(int org.springframework.beans.testfixture.beans.TestBean.getAge())";
|
||||
assertThatExceptionOfType(UnsupportedPointcutPrimitiveException.class).isThrownBy(() ->
|
||||
getPointcut(expression).getClassFilter()) // call to getClassFilter forces resolution...
|
||||
.satisfies(ex -> assertThat(ex.getUnsupportedPrimitive()).isEqualTo(PointcutPrimitive.CALL));
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ package org.springframework.aop.aspectj;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
+2
-2
@@ -33,8 +33,8 @@ import org.springframework.aop.framework.AopContext;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.aop.interceptor.ExposeInvocationInterceptor;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ import test.annotation.EmptySpringAnnotation;
|
||||
import test.annotation.transaction.Tx;
|
||||
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -56,7 +56,7 @@ public class TigerAspectJExpressionPointcutTests {
|
||||
|
||||
@Test
|
||||
public void testMatchGenericArgument() {
|
||||
String expression = "execution(* set*(java.util.List<org.springframework.tests.sample.beans.TestBean>) )";
|
||||
String expression = "execution(* set*(java.util.List<org.springframework.beans.testfixture.beans.TestBean>) )";
|
||||
AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut();
|
||||
ajexp.setExpression(expression);
|
||||
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ public class TrickyAspectJPointcutExpressionTests {
|
||||
testAdvice(new DefaultPointcutAdvisor(pointcut, logAdvice), logAdvice, new TestServiceImpl(), "TestServiceImpl");
|
||||
|
||||
// Then try again with a different class loader on the target...
|
||||
SimpleThrowawayClassLoader loader = new SimpleThrowawayClassLoader(new TestServiceImpl().getClass().getClassLoader());
|
||||
SimpleThrowawayClassLoader loader = new SimpleThrowawayClassLoader(TestServiceImpl.class.getClassLoader());
|
||||
// Make sure the interface is loaded from the parent class loader
|
||||
loader.excludeClass(TestService.class.getName());
|
||||
loader.excludeClass(TestException.class.getName());
|
||||
|
||||
+14
-14
@@ -20,11 +20,11 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.tests.sample.beans.CountingTestBean;
|
||||
import org.springframework.tests.sample.beans.IOther;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.tests.sample.beans.subpkg.DeepBean;
|
||||
import org.springframework.beans.testfixture.beans.CountingTestBean;
|
||||
import org.springframework.beans.testfixture.beans.IOther;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.beans.testfixture.beans.subpkg.DeepBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||
@@ -57,7 +57,7 @@ class TypePatternClassFilterTests {
|
||||
|
||||
@Test
|
||||
void validPatternMatching() {
|
||||
TypePatternClassFilter tpcf = new TypePatternClassFilter("org.springframework.tests.sample.beans.*");
|
||||
TypePatternClassFilter tpcf = new TypePatternClassFilter("org.springframework.beans.testfixture.beans.*");
|
||||
|
||||
assertThat(tpcf.matches(TestBean.class)).as("Must match: in package").isTrue();
|
||||
assertThat(tpcf.matches(ITestBean.class)).as("Must match: in package").isTrue();
|
||||
@@ -70,7 +70,7 @@ class TypePatternClassFilterTests {
|
||||
|
||||
@Test
|
||||
void subclassMatching() {
|
||||
TypePatternClassFilter tpcf = new TypePatternClassFilter("org.springframework.tests.sample.beans.ITestBean+");
|
||||
TypePatternClassFilter tpcf = new TypePatternClassFilter("org.springframework.beans.testfixture.beans.ITestBean+");
|
||||
|
||||
assertThat(tpcf.matches(TestBean.class)).as("Must match: in package").isTrue();
|
||||
assertThat(tpcf.matches(ITestBean.class)).as("Must match: in package").isTrue();
|
||||
@@ -98,8 +98,8 @@ class TypePatternClassFilterTests {
|
||||
|
||||
@Test
|
||||
void testEquals() {
|
||||
TypePatternClassFilter filter1 = new TypePatternClassFilter("org.springframework.tests.sample.beans.*");
|
||||
TypePatternClassFilter filter2 = new TypePatternClassFilter("org.springframework.tests.sample.beans.*");
|
||||
TypePatternClassFilter filter1 = new TypePatternClassFilter("org.springframework.beans.testfixture.beans.*");
|
||||
TypePatternClassFilter filter2 = new TypePatternClassFilter("org.springframework.beans.testfixture.beans.*");
|
||||
TypePatternClassFilter filter3 = new TypePatternClassFilter("org.springframework.tests.*");
|
||||
|
||||
assertThat(filter1).isEqualTo(filter2);
|
||||
@@ -108,8 +108,8 @@ class TypePatternClassFilterTests {
|
||||
|
||||
@Test
|
||||
void testHashCode() {
|
||||
TypePatternClassFilter filter1 = new TypePatternClassFilter("org.springframework.tests.sample.beans.*");
|
||||
TypePatternClassFilter filter2 = new TypePatternClassFilter("org.springframework.tests.sample.beans.*");
|
||||
TypePatternClassFilter filter1 = new TypePatternClassFilter("org.springframework.beans.testfixture.beans.*");
|
||||
TypePatternClassFilter filter2 = new TypePatternClassFilter("org.springframework.beans.testfixture.beans.*");
|
||||
TypePatternClassFilter filter3 = new TypePatternClassFilter("org.springframework.tests.*");
|
||||
|
||||
assertThat(filter1.hashCode()).isEqualTo(filter2.hashCode());
|
||||
@@ -118,11 +118,11 @@ class TypePatternClassFilterTests {
|
||||
|
||||
@Test
|
||||
void testToString() {
|
||||
TypePatternClassFilter filter1 = new TypePatternClassFilter("org.springframework.tests.sample.beans.*");
|
||||
TypePatternClassFilter filter2 = new TypePatternClassFilter("org.springframework.tests.sample.beans.*");
|
||||
TypePatternClassFilter filter1 = new TypePatternClassFilter("org.springframework.beans.testfixture.beans.*");
|
||||
TypePatternClassFilter filter2 = new TypePatternClassFilter("org.springframework.beans.testfixture.beans.*");
|
||||
|
||||
assertThat(filter1.toString())
|
||||
.isEqualTo("org.springframework.aop.aspectj.TypePatternClassFilter: org.springframework.tests.sample.beans.*");
|
||||
.isEqualTo("org.springframework.aop.aspectj.TypePatternClassFilter: org.springframework.beans.testfixture.beans.*");
|
||||
assertThat(filter1.toString()).isEqualTo(filter2.toString());
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -50,11 +50,11 @@ import org.springframework.aop.framework.AopConfigException;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.aop.interceptor.ExposeInvocationInterceptor;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.core.OrderComparator;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -590,7 +590,7 @@ public abstract class AbstractAspectJAdvisorFactoryTests {
|
||||
}
|
||||
|
||||
|
||||
@Aspect("pertypewithin(org.springframework.tests.sample.beans.IOther+)")
|
||||
@Aspect("pertypewithin(org.springframework.beans.testfixture.beans.IOther+)")
|
||||
public static class PerTypeWithinAspect {
|
||||
|
||||
public int count;
|
||||
@@ -931,7 +931,7 @@ abstract class AbstractMakeModifiable {
|
||||
@Aspect
|
||||
class MakeITestBeanModifiable extends AbstractMakeModifiable {
|
||||
|
||||
@DeclareParents(value = "org.springframework.tests.sample.beans.ITestBean+",
|
||||
@DeclareParents(value = "org.springframework.beans.testfixture.beans.ITestBean+",
|
||||
defaultImpl=ModifiableImpl.class)
|
||||
public static MutableModifiable mixin;
|
||||
|
||||
|
||||
+2
-2
@@ -27,8 +27,8 @@ import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import org.springframework.aop.Pointcut;
|
||||
import org.springframework.aop.aspectj.AspectJExpressionPointcut;
|
||||
import org.springframework.aop.aspectj.AspectJExpressionPointcutTests;
|
||||
import org.springframework.aop.framework.AopConfigException;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import org.aspectj.lang.annotation.Aspect;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import test.aop.PerThisAspect;
|
||||
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
import org.springframework.core.testfixture.io.SerializationTestUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.beans.factory.xml.XmlReaderContext;
|
||||
import org.springframework.tests.beans.CollectingReaderEventListener;
|
||||
import org.springframework.beans.testfixture.beans.CollectingReaderEventListener;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
+2
-2
@@ -29,11 +29,11 @@ import org.springframework.beans.factory.parsing.ComponentDefinition;
|
||||
import org.springframework.beans.factory.parsing.CompositeComponentDefinition;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.beans.testfixture.beans.CollectingReaderEventListener;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.tests.beans.CollectingReaderEventListener;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
import static org.springframework.core.testfixture.io.ResourceTestUtils.qualifiedResource;
|
||||
|
||||
/**
|
||||
* @author Rob Harrop
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
import static org.springframework.core.testfixture.io.ResourceTestUtils.qualifiedResource;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
import static org.springframework.core.testfixture.io.ResourceTestUtils.qualifiedResource;
|
||||
|
||||
/**
|
||||
* Tests that the <aop:config/> element can be used as a top level element.
|
||||
|
||||
@@ -23,8 +23,8 @@ import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.SpringProxy;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||
|
||||
+2
-2
@@ -19,8 +19,8 @@ package org.springframework.aop.framework;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.support.DelegatingIntroductionInterceptor;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.util.StopWatch;
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import java.util.List;
|
||||
import org.aopalliance.intercept.MethodInterceptor;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
import static org.springframework.core.testfixture.io.ResourceTestUtils.qualifiedResource;
|
||||
|
||||
/**
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -33,15 +33,15 @@ import org.springframework.aop.interceptor.DebugInterceptor;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.aop.support.DefaultIntroductionAdvisor;
|
||||
import org.springframework.aop.support.DefaultPointcutAdvisor;
|
||||
import org.springframework.aop.support.DelegatingIntroductionInterceptor;
|
||||
import org.springframework.aop.testfixture.advice.CountingBeforeAdvice;
|
||||
import org.springframework.aop.testfixture.interceptor.NopInterceptor;
|
||||
import org.springframework.aop.testfixture.interceptor.TimestampIntroductionInterceptor;
|
||||
import org.springframework.beans.testfixture.beans.IOther;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.tests.TimeStamped;
|
||||
import org.springframework.tests.aop.advice.CountingBeforeAdvice;
|
||||
import org.springframework.tests.aop.interceptor.NopInterceptor;
|
||||
import org.springframework.tests.sample.beans.IOther;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.core.testfixture.TimeStamped;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
@@ -371,30 +371,6 @@ public class ProxyFactoryTests {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private static class TimestampIntroductionInterceptor extends DelegatingIntroductionInterceptor
|
||||
implements TimeStamped {
|
||||
|
||||
private long ts;
|
||||
|
||||
public TimestampIntroductionInterceptor() {
|
||||
}
|
||||
|
||||
public TimestampIntroductionInterceptor(long ts) {
|
||||
this.ts = ts;
|
||||
}
|
||||
|
||||
public void setTime(long ts) {
|
||||
this.ts = ts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTimeStamp() {
|
||||
return ts;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Order(2)
|
||||
public static class A implements Runnable {
|
||||
|
||||
|
||||
+1
-23
@@ -17,16 +17,13 @@
|
||||
package org.springframework.aop.framework.adapter;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.rmi.ConnectException;
|
||||
import java.rmi.RemoteException;
|
||||
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.ThrowsAdvice;
|
||||
import org.springframework.tests.aop.advice.MethodCounter;
|
||||
import org.springframework.aop.testfixture.advice.MyThrowsHandler;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
@@ -128,23 +125,4 @@ public class ThrowsAdviceInterceptorTests {
|
||||
assertThat(th.getCalls("remoteException")).isEqualTo(1);
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
static class MyThrowsHandler extends MethodCounter implements ThrowsAdvice {
|
||||
|
||||
// Full method signature
|
||||
public void afterThrowing(Method m, Object[] args, Object target, IOException ex) {
|
||||
count("ioException");
|
||||
}
|
||||
|
||||
public void afterThrowing(RemoteException ex) throws Throwable {
|
||||
count("remoteException");
|
||||
}
|
||||
|
||||
/** Not valid, wrong number of arguments */
|
||||
public void afterThrowing(Method m, Exception ex) throws Throwable {
|
||||
throw new UnsupportedOperationException("Shouldn't be called");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-4
@@ -22,10 +22,10 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.tests.sample.beans.DerivedTestBean;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
import org.springframework.beans.testfixture.beans.DerivedTestBean;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.core.testfixture.io.SerializationTestUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
+2
-2
@@ -20,8 +20,8 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.beans.factory.NamedBean;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
+3
-3
@@ -21,11 +21,11 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
import static org.springframework.core.testfixture.io.ResourceTestUtils.qualifiedResource;
|
||||
|
||||
/**
|
||||
* Non-XML tests are in AbstractAopProxyTests
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
import static org.springframework.core.testfixture.io.ResourceTestUtils.qualifiedResource;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
|
||||
+2
-2
@@ -21,8 +21,8 @@ import java.io.IOException;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.core.testfixture.io.SerializationTestUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ import org.springframework.aop.MethodMatcher;
|
||||
import org.springframework.aop.Pointcut;
|
||||
import org.springframework.aop.interceptor.ExposeInvocationInterceptor;
|
||||
import org.springframework.aop.target.EmptyTargetSource;
|
||||
import org.springframework.aop.testfixture.interceptor.NopInterceptor;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.core.testfixture.io.SerializationTestUtils;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.tests.aop.interceptor.NopInterceptor;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@ package org.springframework.aop.support;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.ClassFilter;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.core.NestedRuntimeException;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.springframework.aop.support;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
+1
-1
@@ -23,9 +23,9 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.aop.ClassFilter;
|
||||
import org.springframework.aop.MethodMatcher;
|
||||
import org.springframework.aop.Pointcut;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.core.NestedRuntimeException;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
+3
-3
@@ -20,9 +20,9 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.Pointcut;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.tests.aop.interceptor.NopInterceptor;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.aop.testfixture.interceptor.NopInterceptor;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
+9
-9
@@ -24,15 +24,15 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.aop.IntroductionAdvisor;
|
||||
import org.springframework.aop.IntroductionInterceptor;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.tests.TimeStamped;
|
||||
import org.springframework.tests.aop.interceptor.SerializableNopInterceptor;
|
||||
import org.springframework.tests.sample.beans.INestedTestBean;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.NestedTestBean;
|
||||
import org.springframework.tests.sample.beans.Person;
|
||||
import org.springframework.tests.sample.beans.SerializablePerson;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
import org.springframework.aop.testfixture.interceptor.SerializableNopInterceptor;
|
||||
import org.springframework.beans.testfixture.beans.INestedTestBean;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.NestedTestBean;
|
||||
import org.springframework.beans.testfixture.beans.Person;
|
||||
import org.springframework.beans.testfixture.beans.SerializablePerson;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.core.testfixture.TimeStamped;
|
||||
import org.springframework.core.testfixture.io.SerializationTestUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||
|
||||
@@ -21,11 +21,11 @@ import java.lang.reflect.Method;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.MethodMatcher;
|
||||
import org.springframework.beans.testfixture.beans.IOther;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.core.testfixture.io.SerializationTestUtils;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.tests.sample.beans.IOther;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
+5
-5
@@ -21,11 +21,11 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.tests.aop.interceptor.NopInterceptor;
|
||||
import org.springframework.tests.aop.interceptor.SerializableNopInterceptor;
|
||||
import org.springframework.tests.sample.beans.Person;
|
||||
import org.springframework.tests.sample.beans.SerializablePerson;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
import org.springframework.aop.testfixture.interceptor.NopInterceptor;
|
||||
import org.springframework.aop.testfixture.interceptor.SerializableNopInterceptor;
|
||||
import org.springframework.beans.testfixture.beans.Person;
|
||||
import org.springframework.beans.testfixture.beans.SerializablePerson;
|
||||
import org.springframework.core.testfixture.io.SerializationTestUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.ClassFilter;
|
||||
import org.springframework.aop.Pointcut;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
+7
-7
@@ -19,18 +19,18 @@ package org.springframework.aop.support;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.aop.testfixture.interceptor.NopInterceptor;
|
||||
import org.springframework.aop.testfixture.interceptor.SerializableNopInterceptor;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.Person;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.tests.aop.interceptor.NopInterceptor;
|
||||
import org.springframework.tests.aop.interceptor.SerializableNopInterceptor;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.Person;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
import org.springframework.core.testfixture.io.SerializationTestUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
import static org.springframework.core.testfixture.io.ResourceTestUtils.qualifiedResource;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
|
||||
@@ -19,7 +19,7 @@ package org.springframework.aop.support;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.ClassFilter;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
+2
-2
@@ -21,11 +21,11 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
import static org.springframework.core.testfixture.io.ResourceTestUtils.qualifiedResource;
|
||||
|
||||
/**
|
||||
* @author Stephane Nicoll
|
||||
|
||||
+6
-6
@@ -23,17 +23,17 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.aop.support.DefaultPointcutAdvisor;
|
||||
import org.springframework.aop.testfixture.interceptor.SerializableNopInterceptor;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.tests.aop.interceptor.SerializableNopInterceptor;
|
||||
import org.springframework.tests.sample.beans.Person;
|
||||
import org.springframework.tests.sample.beans.SerializablePerson;
|
||||
import org.springframework.tests.sample.beans.SideEffectBean;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
import org.springframework.beans.testfixture.beans.Person;
|
||||
import org.springframework.beans.testfixture.beans.SerializablePerson;
|
||||
import org.springframework.beans.testfixture.beans.SideEffectBean;
|
||||
import org.springframework.core.testfixture.io.SerializationTestUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
import static org.springframework.core.testfixture.io.ResourceTestUtils.qualifiedResource;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
|
||||
+2
-2
@@ -22,11 +22,11 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
import static org.springframework.core.testfixture.io.ResourceTestUtils.qualifiedResource;
|
||||
|
||||
/**
|
||||
* @author Juergen Hoeller
|
||||
|
||||
+3
-3
@@ -23,9 +23,9 @@ import org.springframework.beans.MutablePropertyValues;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.support.RootBeanDefinition;
|
||||
import org.springframework.tests.sample.beans.SerializablePerson;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
import org.springframework.beans.testfixture.beans.SerializablePerson;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.core.testfixture.io.SerializationTestUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
+2
-2
@@ -21,10 +21,10 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.tests.sample.beans.SideEffectBean;
|
||||
import org.springframework.beans.testfixture.beans.SideEffectBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
import static org.springframework.core.testfixture.io.ResourceTestUtils.qualifiedResource;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
|
||||
+3
-3
@@ -21,11 +21,11 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.SideEffectBean;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.SideEffectBean;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
import static org.springframework.core.testfixture.io.ResourceTestUtils.qualifiedResource;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
|
||||
+2
-2
@@ -18,10 +18,10 @@ package org.springframework.aop.target.dynamic;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.tests.EnabledForTestGroups;
|
||||
import org.springframework.core.testfixture.EnabledForTestGroups;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.tests.TestGroup.PERFORMANCE;
|
||||
import static org.springframework.core.testfixture.TestGroup.PERFORMANCE;
|
||||
|
||||
/**
|
||||
* @author Rob Harrop
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
|
||||
<bean id="getAgeCounter" class="org.springframework.aop.framework.CountingBeforeAdvice"/>
|
||||
|
||||
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
|
||||
<bean id="testBean" class="org.springframework.beans.testfixture.beans.TestBean"/>
|
||||
|
||||
<bean id="countingAdvice" class="org.springframework.aop.config.CountingAspectJAdvice"/>
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
|
||||
<bean id="getAgeCounter" class="org.springframework.aop.framework.CountingBeforeAdvice"/>
|
||||
|
||||
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
|
||||
<bean id="testBean" class="org.springframework.beans.testfixture.beans.TestBean"/>
|
||||
|
||||
<bean id="countingAdvice" class="org.springframework.aop.config.CountingAspectJAdvice"/>
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
|
||||
<bean id="getAgeCounter" class="org.springframework.aop.framework.CountingBeforeAdvice"/>
|
||||
|
||||
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
|
||||
<bean id="testBean" class="org.springframework.beans.testfixture.beans.TestBean"/>
|
||||
|
||||
<bean id="countingAdvice" class="org.springframework.aop.config.CountingAspectJAdvice"/>
|
||||
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
-->
|
||||
<beans>
|
||||
|
||||
<bean id="nopInterceptor" class="org.springframework.tests.aop.interceptor.NopInterceptor"/>
|
||||
<bean id="nopInterceptor" class="org.springframework.aop.testfixture.interceptor.NopInterceptor"/>
|
||||
|
||||
<bean id="exposeInvocation" class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean">
|
||||
<property name="targetClass">
|
||||
@@ -15,7 +15,7 @@
|
||||
<property name="targetField"><value>INSTANCE</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="countingBeforeAdvice" class="org.springframework.tests.aop.advice.CountingBeforeAdvice"/>
|
||||
<bean id="countingBeforeAdvice" class="org.springframework.aop.testfixture.advice.CountingBeforeAdvice"/>
|
||||
|
||||
<bean id="proxy" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||
<property name="target">
|
||||
|
||||
+6
-6
@@ -4,12 +4,12 @@
|
||||
<beans>
|
||||
|
||||
<!-- Simple target -->
|
||||
<bean id="test" class="org.springframework.tests.sample.beans.TestBean">
|
||||
<bean id="test" class="org.springframework.beans.testfixture.beans.TestBean">
|
||||
<property name="name"><value>custom</value></property>
|
||||
<property name="age"><value>666</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="nopInterceptor" class="org.springframework.tests.aop.interceptor.SerializableNopInterceptor"/>
|
||||
<bean id="nopInterceptor" class="org.springframework.aop.testfixture.interceptor.SerializableNopInterceptor"/>
|
||||
|
||||
<bean id="settersAdvisor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
|
||||
<property name="advice"><ref bean="nopInterceptor"/></property>
|
||||
@@ -21,15 +21,15 @@
|
||||
</bean>
|
||||
|
||||
<bean id="settersAdvised" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||
<property name="proxyInterfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
|
||||
<property name="proxyInterfaces"><value>org.springframework.beans.testfixture.beans.ITestBean</value></property>
|
||||
<property name="target"><ref bean="test"/></property>
|
||||
<property name="interceptorNames"><value>settersAdvisor</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="serializableSettersAdvised" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||
<property name="proxyInterfaces"><value>org.springframework.tests.sample.beans.Person</value></property>
|
||||
<property name="proxyInterfaces"><value>org.springframework.beans.testfixture.beans.Person</value></property>
|
||||
<property name="target">
|
||||
<bean class="org.springframework.tests.sample.beans.SerializablePerson">
|
||||
<bean class="org.springframework.beans.testfixture.beans.SerializablePerson">
|
||||
<property name="name"><value>serializableSettersAdvised</value></property>
|
||||
</bean>
|
||||
</property>
|
||||
@@ -48,7 +48,7 @@
|
||||
</bean>
|
||||
|
||||
<bean id="settersAndAbsquatulateAdvised" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||
<property name="proxyInterfaces"><value>org.springframework.tests.sample.beans.ITestBean</value></property>
|
||||
<property name="proxyInterfaces"><value>org.springframework.beans.testfixture.beans.ITestBean</value></property>
|
||||
<!-- Force CGLIB so we can cast to TestBean -->
|
||||
<property name="proxyTargetClass"><value>true</value></property>
|
||||
<property name="target"><ref bean="test"/></property>
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
<beans>
|
||||
|
||||
<bean id="testBeanTarget" class="org.springframework.tests.sample.beans.TestBean" scope="prototype"/>
|
||||
<bean id="testBeanTarget" class="org.springframework.beans.testfixture.beans.TestBean" scope="prototype"/>
|
||||
|
||||
<bean id="targetSource" class="org.springframework.aop.target.CommonsPool2TargetSource">
|
||||
<property name="targetBeanName" value="testBeanTarget"/>
|
||||
|
||||
+2
-2
@@ -4,11 +4,11 @@
|
||||
<beans>
|
||||
|
||||
<!-- Simple target -->
|
||||
<bean id="target1" class="org.springframework.tests.sample.beans.SideEffectBean">
|
||||
<bean id="target1" class="org.springframework.beans.testfixture.beans.SideEffectBean">
|
||||
<property name="count"><value>10</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="target2" class="org.springframework.tests.sample.beans.SideEffectBean" scope="singleton">
|
||||
<bean id="target2" class="org.springframework.beans.testfixture.beans.SideEffectBean" scope="singleton">
|
||||
<property name="count"><value>20</value></property>
|
||||
</bean>
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
<beans>
|
||||
|
||||
<bean id="target" class="org.springframework.tests.sample.beans.TestBean" lazy-init="true">
|
||||
<bean id="target" class="org.springframework.beans.testfixture.beans.TestBean" lazy-init="true">
|
||||
<property name="age"><value>10</value></property>
|
||||
</bean>
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
<beans>
|
||||
|
||||
<bean id="target" class="org.springframework.tests.sample.beans.TestBean" lazy-init="true">
|
||||
<bean id="target" class="org.springframework.beans.testfixture.beans.TestBean" lazy-init="true">
|
||||
<property name="age"><value>10</value></property>
|
||||
</bean>
|
||||
|
||||
|
||||
+3
-3
@@ -4,11 +4,11 @@
|
||||
<beans>
|
||||
|
||||
<!-- Simple target -->
|
||||
<bean id="test" class="org.springframework.tests.sample.beans.SideEffectBean">
|
||||
<bean id="test" class="org.springframework.beans.testfixture.beans.SideEffectBean">
|
||||
<property name="count"><value>10</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="prototypeTest" class="org.springframework.tests.sample.beans.SideEffectBean" scope="prototype">
|
||||
<bean id="prototypeTest" class="org.springframework.beans.testfixture.beans.SideEffectBean" scope="prototype">
|
||||
<property name="count"><value>10</value></property>
|
||||
</bean>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<property name="targetBeanName"><value>prototypeTest</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="debugInterceptor" class="org.springframework.tests.aop.interceptor.NopInterceptor" />
|
||||
<bean id="debugInterceptor" class="org.springframework.aop.testfixture.interceptor.NopInterceptor" />
|
||||
|
||||
<bean id="singleton" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||
<property name="interceptorNames"><value>debugInterceptor,test</value></property>
|
||||
|
||||
+4
-4
@@ -3,7 +3,7 @@
|
||||
|
||||
<beans>
|
||||
|
||||
<bean id="prototypeTest" class="org.springframework.tests.sample.beans.SideEffectBean" scope="prototype">
|
||||
<bean id="prototypeTest" class="org.springframework.beans.testfixture.beans.SideEffectBean" scope="prototype">
|
||||
<property name="count"><value>10</value></property>
|
||||
</bean>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<property name="targetBeanName"><value>prototypeTest</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="debugInterceptor" class="org.springframework.tests.aop.interceptor.NopInterceptor" />
|
||||
<bean id="debugInterceptor" class="org.springframework.aop.testfixture.interceptor.NopInterceptor" />
|
||||
|
||||
<!--
|
||||
We want to invoke the getStatsMixin method on our ThreadLocal invoker
|
||||
@@ -34,12 +34,12 @@
|
||||
|
||||
<!-- ================ Definitions for second ThreadLocalTargetSource ====== -->
|
||||
|
||||
<bean id="test" class="org.springframework.tests.sample.beans.TestBean" scope="prototype">
|
||||
<bean id="test" class="org.springframework.beans.testfixture.beans.TestBean" scope="prototype">
|
||||
<property name="name"><value>Rod</value></property>
|
||||
<property name="spouse"><ref bean="wife"/></property>
|
||||
</bean>
|
||||
|
||||
<bean id="wife" class="org.springframework.tests.sample.beans.TestBean">
|
||||
<bean id="wife" class="org.springframework.beans.testfixture.beans.TestBean">
|
||||
<property name="name"><value>Kerry</value></property>
|
||||
</bean>
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.tests.aop.advice;
|
||||
package org.springframework.aop.testfixture.advice;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.tests.aop.advice;
|
||||
package org.springframework.aop.testfixture.advice;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
+5
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.tests.aop.advice;
|
||||
package org.springframework.aop.testfixture.advice;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -25,6 +25,7 @@ import java.util.HashMap;
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @author Chris Beams
|
||||
* @author Sam Brannen
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class MethodCounter implements Serializable {
|
||||
@@ -39,15 +40,12 @@ public class MethodCounter implements Serializable {
|
||||
}
|
||||
|
||||
protected void count(String methodName) {
|
||||
Integer i = map.get(methodName);
|
||||
i = (i != null) ? new Integer(i.intValue() + 1) : new Integer(1);
|
||||
map.put(methodName, i);
|
||||
map.merge(methodName, 1, (n, m) -> n + 1);
|
||||
++allCount;
|
||||
}
|
||||
|
||||
public int getCalls(String methodName) {
|
||||
Integer i = map.get(methodName);
|
||||
return (i != null ? i.intValue() : 0);
|
||||
return map.getOrDefault(methodName, 0);
|
||||
}
|
||||
|
||||
public int getCalls() {
|
||||
+4
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.tests.aop.advice;
|
||||
package org.springframework.aop.testfixture.advice;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -24,10 +24,12 @@ import org.springframework.aop.ThrowsAdvice;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class MyThrowsHandler extends MethodCounter implements ThrowsAdvice {
|
||||
|
||||
// Full method signature
|
||||
public void afterThrowing(Method m, Object[] args, Object target, IOException ex) {
|
||||
count("ioException");
|
||||
}
|
||||
|
||||
public void afterThrowing(RemoteException ex) throws Throwable {
|
||||
count("remoteException");
|
||||
}
|
||||
@@ -36,4 +38,5 @@ public class MyThrowsHandler extends MethodCounter implements ThrowsAdvice {
|
||||
public void afterThrowing(Method m, Exception ex) throws Throwable {
|
||||
throw new UnsupportedOperationException("Shouldn't be called");
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -14,11 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.tests.aop.advice;
|
||||
package org.springframework.aop.testfixture.advice;
|
||||
|
||||
import org.springframework.aop.support.DefaultIntroductionAdvisor;
|
||||
import org.springframework.aop.support.DelegatingIntroductionInterceptor;
|
||||
import org.springframework.tests.aop.interceptor.TimestampIntroductionInterceptor;
|
||||
import org.springframework.aop.testfixture.interceptor.TimestampIntroductionInterceptor;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.tests.aop.interceptor;
|
||||
package org.springframework.aop.testfixture.interceptor;
|
||||
|
||||
import org.aopalliance.intercept.MethodInterceptor;
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.tests.aop.interceptor;
|
||||
package org.springframework.aop.testfixture.interceptor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
+2
-2
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.tests.aop.interceptor;
|
||||
package org.springframework.aop.testfixture.interceptor;
|
||||
|
||||
import org.springframework.aop.support.DelegatingIntroductionInterceptor;
|
||||
import org.springframework.tests.TimeStamped;
|
||||
import org.springframework.core.testfixture.TimeStamped;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class TimestampIntroductionInterceptor extends DelegatingIntroductionInterceptor
|
||||
@@ -11,7 +11,6 @@ sourceSets.test.java.srcDirs = files()
|
||||
aspectj.version = dependencyManagement.managedVersions['org.aspectj:aspectjweaver']
|
||||
|
||||
dependencies {
|
||||
aspect(project(":spring-orm"))
|
||||
compile("org.aspectj:aspectjweaver")
|
||||
compileOnly("org.aspectj:aspectjrt")
|
||||
optional(project(":spring-aop")) // for @Async support
|
||||
@@ -24,6 +23,10 @@ dependencies {
|
||||
optional("javax.transaction:javax.transaction-api") // for @javax.transaction.Transactional support
|
||||
testCompile(project(":spring-core")) // for CodeStyleAspect
|
||||
testCompile(project(":spring-test"))
|
||||
testCompile(testFixtures(project(":spring-context")))
|
||||
testCompile(testFixtures(project(":spring-context-support")))
|
||||
testCompile(testFixtures(project(":spring-core")))
|
||||
testCompile(testFixtures(project(":spring-tx")))
|
||||
testCompile("javax.mail:javax.mail-api")
|
||||
testCompileOnly("org.aspectj:aspectjrt")
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -37,6 +37,7 @@ import org.springframework.scheduling.config.TaskManagementConfigUtils;
|
||||
* @see org.springframework.scheduling.annotation.ProxyAsyncConfiguration
|
||||
*/
|
||||
@Configuration
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
public class AspectJAsyncConfiguration extends AbstractAsyncConfiguration {
|
||||
|
||||
@Bean(name = TaskManagementConfigUtils.ASYNC_EXECUTION_ASPECT_BEAN_NAME)
|
||||
|
||||
+2
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,6 +36,7 @@ import org.springframework.transaction.config.TransactionManagementConfigUtils;
|
||||
* @see TransactionManagementConfigurationSelector
|
||||
*/
|
||||
@Configuration
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
public class AspectJJtaTransactionManagementConfiguration extends AspectJTransactionManagementConfiguration {
|
||||
|
||||
@Bean(name = TransactionManagementConfigUtils.JTA_TRANSACTION_ASPECT_BEAN_NAME)
|
||||
|
||||
+2
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -38,6 +38,7 @@ import org.springframework.transaction.config.TransactionManagementConfigUtils;
|
||||
* @see AspectJJtaTransactionManagementConfiguration
|
||||
*/
|
||||
@Configuration
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
public class AspectJTransactionManagementConfiguration extends AbstractTransactionManagementConfiguration {
|
||||
|
||||
@Bean(name = TransactionManagementConfigUtils.TRANSACTION_ASPECT_BEAN_NAME)
|
||||
|
||||
Vendored
+882
@@ -0,0 +1,882 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cache.aspectj;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.framework.AopProxyUtils;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.cache.Cache;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.config.AnnotatedClassCacheableService;
|
||||
import org.springframework.cache.config.CacheableService;
|
||||
import org.springframework.cache.config.TestEntity;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.testfixture.cache.SomeCustomKeyGenerator;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.assertj.core.api.Assertions.assertThatIOException;
|
||||
|
||||
/**
|
||||
* Copy of the shared {@code AbstractCacheAnnotationTests}: necessary
|
||||
* due to issues with Gradle test fixtures and AspectJ configuration
|
||||
* in the Gradle build.
|
||||
*
|
||||
* <p>Abstract cache annotation tests (containing several reusable methods).
|
||||
*
|
||||
* @author Costin Leau
|
||||
* @author Chris Beams
|
||||
* @author Phillip Webb
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
public abstract class AbstractCacheAnnotationTests {
|
||||
|
||||
protected ConfigurableApplicationContext ctx;
|
||||
|
||||
protected CacheableService<?> cs;
|
||||
|
||||
protected CacheableService<?> ccs;
|
||||
|
||||
protected CacheManager cm;
|
||||
|
||||
|
||||
/**
|
||||
* @return a refreshed application context
|
||||
*/
|
||||
protected abstract ConfigurableApplicationContext getApplicationContext();
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
this.ctx = getApplicationContext();
|
||||
this.cs = ctx.getBean("service", CacheableService.class);
|
||||
this.ccs = ctx.getBean("classService", CacheableService.class);
|
||||
this.cm = ctx.getBean("cacheManager", CacheManager.class);
|
||||
|
||||
Collection<String> cn = this.cm.getCacheNames();
|
||||
assertThat(cn).containsOnly("testCache", "secondary", "primary");
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void close() {
|
||||
if (this.ctx != null) {
|
||||
this.ctx.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void testCacheable(CacheableService<?> service) {
|
||||
Object o1 = new Object();
|
||||
|
||||
Object r1 = service.cache(o1);
|
||||
Object r2 = service.cache(o1);
|
||||
Object r3 = service.cache(o1);
|
||||
|
||||
assertThat(r2).isSameAs(r1);
|
||||
assertThat(r3).isSameAs(r1);
|
||||
}
|
||||
|
||||
protected void testCacheableNull(CacheableService<?> service) {
|
||||
Object o1 = new Object();
|
||||
assertThat(this.cm.getCache("testCache").get(o1)).isNull();
|
||||
|
||||
Object r1 = service.cacheNull(o1);
|
||||
Object r2 = service.cacheNull(o1);
|
||||
Object r3 = service.cacheNull(o1);
|
||||
|
||||
assertThat(r2).isSameAs(r1);
|
||||
assertThat(r3).isSameAs(r1);
|
||||
|
||||
assertThat(this.cm.getCache("testCache")).as("testCache").isNotNull();
|
||||
assertThat(this.cm.getCache("testCache").get(o1)).as("cached object").isNotNull();
|
||||
assertThat(this.cm.getCache("testCache").get(o1).get()).isEqualTo(r3);
|
||||
assertThat(r3).as("Cached value should be null").isNull();
|
||||
}
|
||||
|
||||
protected void testCacheableSync(CacheableService<?> service) {
|
||||
Object o1 = new Object();
|
||||
|
||||
Object r1 = service.cacheSync(o1);
|
||||
Object r2 = service.cacheSync(o1);
|
||||
Object r3 = service.cacheSync(o1);
|
||||
|
||||
assertThat(r2).isSameAs(r1);
|
||||
assertThat(r3).isSameAs(r1);
|
||||
}
|
||||
|
||||
protected void testCacheableSyncNull(CacheableService<?> service) {
|
||||
Object o1 = new Object();
|
||||
assertThat(this.cm.getCache("testCache").get(o1)).isNull();
|
||||
|
||||
Object r1 = service.cacheSyncNull(o1);
|
||||
Object r2 = service.cacheSyncNull(o1);
|
||||
Object r3 = service.cacheSyncNull(o1);
|
||||
|
||||
assertThat(r2).isSameAs(r1);
|
||||
assertThat(r3).isSameAs(r1);
|
||||
|
||||
assertThat(this.cm.getCache("testCache").get(o1).get()).isEqualTo(r3);
|
||||
assertThat(r3).as("Cached value should be null").isNull();
|
||||
}
|
||||
|
||||
protected void testEvict(CacheableService<?> service, boolean successExpected) {
|
||||
Cache cache = this.cm.getCache("testCache");
|
||||
|
||||
Object o1 = new Object();
|
||||
cache.putIfAbsent(o1, -1L);
|
||||
Object r1 = service.cache(o1);
|
||||
|
||||
service.evict(o1, null);
|
||||
if (successExpected) {
|
||||
assertThat(cache.get(o1)).isNull();
|
||||
}
|
||||
else {
|
||||
assertThat(cache.get(o1)).isNotNull();
|
||||
}
|
||||
|
||||
Object r2 = service.cache(o1);
|
||||
if (successExpected) {
|
||||
assertThat(r2).isNotSameAs(r1);
|
||||
}
|
||||
else {
|
||||
assertThat(r2).isSameAs(r1);
|
||||
}
|
||||
}
|
||||
|
||||
protected void testEvictEarly(CacheableService<?> service) {
|
||||
Cache cache = this.cm.getCache("testCache");
|
||||
|
||||
Object o1 = new Object();
|
||||
cache.putIfAbsent(o1, -1L);
|
||||
Object r1 = service.cache(o1);
|
||||
|
||||
try {
|
||||
service.evictEarly(o1);
|
||||
}
|
||||
catch (RuntimeException ex) {
|
||||
// expected
|
||||
}
|
||||
assertThat(cache.get(o1)).isNull();
|
||||
|
||||
Object r2 = service.cache(o1);
|
||||
assertThat(r2).isNotSameAs(r1);
|
||||
}
|
||||
|
||||
protected void testEvictException(CacheableService<?> service) {
|
||||
Object o1 = new Object();
|
||||
Object r1 = service.cache(o1);
|
||||
|
||||
try {
|
||||
service.evictWithException(o1);
|
||||
}
|
||||
catch (RuntimeException ex) {
|
||||
// expected
|
||||
}
|
||||
// exception occurred, eviction skipped, data should still be in the cache
|
||||
Object r2 = service.cache(o1);
|
||||
assertThat(r2).isSameAs(r1);
|
||||
}
|
||||
|
||||
protected void testEvictWithKey(CacheableService<?> service) {
|
||||
Object o1 = new Object();
|
||||
Object r1 = service.cache(o1);
|
||||
|
||||
service.evict(o1, null);
|
||||
Object r2 = service.cache(o1);
|
||||
assertThat(r2).isNotSameAs(r1);
|
||||
}
|
||||
|
||||
protected void testEvictWithKeyEarly(CacheableService<?> service) {
|
||||
Object o1 = new Object();
|
||||
Object r1 = service.cache(o1);
|
||||
|
||||
try {
|
||||
service.evictEarly(o1);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
// expected
|
||||
}
|
||||
Object r2 = service.cache(o1);
|
||||
assertThat(r2).isNotSameAs(r1);
|
||||
}
|
||||
|
||||
protected void testEvictAll(CacheableService<?> service, boolean successExpected) {
|
||||
Cache cache = this.cm.getCache("testCache");
|
||||
|
||||
Object o1 = new Object();
|
||||
Object o2 = new Object();
|
||||
cache.putIfAbsent(o1, -1L);
|
||||
cache.putIfAbsent(o2, -2L);
|
||||
|
||||
Object r1 = service.cache(o1);
|
||||
Object r2 = service.cache(o2);
|
||||
assertThat(r2).isNotSameAs(r1);
|
||||
|
||||
service.evictAll(new Object());
|
||||
if (successExpected) {
|
||||
assertThat(cache.get(o1)).isNull();
|
||||
assertThat(cache.get(o2)).isNull();
|
||||
}
|
||||
else {
|
||||
assertThat(cache.get(o1)).isNotNull();
|
||||
assertThat(cache.get(o2)).isNotNull();
|
||||
}
|
||||
|
||||
Object r3 = service.cache(o1);
|
||||
Object r4 = service.cache(o2);
|
||||
if (successExpected) {
|
||||
assertThat(r3).isNotSameAs(r1);
|
||||
assertThat(r4).isNotSameAs(r2);
|
||||
}
|
||||
else {
|
||||
assertThat(r3).isSameAs(r1);
|
||||
assertThat(r4).isSameAs(r2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void testEvictAllEarly(CacheableService<?> service) {
|
||||
Cache cache = this.cm.getCache("testCache");
|
||||
|
||||
Object o1 = new Object();
|
||||
Object o2 = new Object();
|
||||
cache.putIfAbsent(o1, -1L);
|
||||
cache.putIfAbsent(o2, -2L);
|
||||
|
||||
Object r1 = service.cache(o1);
|
||||
Object r2 = service.cache(o2);
|
||||
assertThat(r2).isNotSameAs(r1);
|
||||
|
||||
try {
|
||||
service.evictAllEarly(new Object());
|
||||
}
|
||||
catch (Exception ex) {
|
||||
// expected
|
||||
}
|
||||
assertThat(cache.get(o1)).isNull();
|
||||
assertThat(cache.get(o2)).isNull();
|
||||
|
||||
Object r3 = service.cache(o1);
|
||||
Object r4 = service.cache(o2);
|
||||
assertThat(r3).isNotSameAs(r1);
|
||||
assertThat(r4).isNotSameAs(r2);
|
||||
}
|
||||
|
||||
protected void testConditionalExpression(CacheableService<?> service) {
|
||||
Object r1 = service.conditional(4);
|
||||
Object r2 = service.conditional(4);
|
||||
|
||||
assertThat(r2).isNotSameAs(r1);
|
||||
|
||||
Object r3 = service.conditional(3);
|
||||
Object r4 = service.conditional(3);
|
||||
|
||||
assertThat(r4).isSameAs(r3);
|
||||
}
|
||||
|
||||
protected void testConditionalExpressionSync(CacheableService<?> service) {
|
||||
Object r1 = service.conditionalSync(4);
|
||||
Object r2 = service.conditionalSync(4);
|
||||
|
||||
assertThat(r2).isNotSameAs(r1);
|
||||
|
||||
Object r3 = service.conditionalSync(3);
|
||||
Object r4 = service.conditionalSync(3);
|
||||
|
||||
assertThat(r4).isSameAs(r3);
|
||||
}
|
||||
|
||||
protected void testUnlessExpression(CacheableService<?> service) {
|
||||
Cache cache = this.cm.getCache("testCache");
|
||||
cache.clear();
|
||||
service.unless(10);
|
||||
service.unless(11);
|
||||
assertThat(cache.get(10).get()).isEqualTo(10L);
|
||||
assertThat(cache.get(11)).isNull();
|
||||
}
|
||||
|
||||
protected void testKeyExpression(CacheableService<?> service) {
|
||||
Object r1 = service.key(5, 1);
|
||||
Object r2 = service.key(5, 2);
|
||||
|
||||
assertThat(r2).isSameAs(r1);
|
||||
|
||||
Object r3 = service.key(1, 5);
|
||||
Object r4 = service.key(2, 5);
|
||||
|
||||
assertThat(r4).isNotSameAs(r3);
|
||||
}
|
||||
|
||||
protected void testVarArgsKey(CacheableService<?> service) {
|
||||
Object r1 = service.varArgsKey(1, 2, 3);
|
||||
Object r2 = service.varArgsKey(1, 2, 3);
|
||||
|
||||
assertThat(r2).isSameAs(r1);
|
||||
|
||||
Object r3 = service.varArgsKey(1, 2, 3);
|
||||
Object r4 = service.varArgsKey(1, 2);
|
||||
|
||||
assertThat(r4).isNotSameAs(r3);
|
||||
}
|
||||
|
||||
protected void testNullValue(CacheableService<?> service) {
|
||||
Object key = new Object();
|
||||
assertThat(service.nullValue(key)).isNull();
|
||||
int nr = service.nullInvocations().intValue();
|
||||
assertThat(service.nullValue(key)).isNull();
|
||||
assertThat(service.nullInvocations().intValue()).isEqualTo(nr);
|
||||
assertThat(service.nullValue(new Object())).isNull();
|
||||
assertThat(service.nullInvocations().intValue()).isEqualTo(nr + 1);
|
||||
}
|
||||
|
||||
protected void testMethodName(CacheableService<?> service, String keyName) {
|
||||
Object key = new Object();
|
||||
Object r1 = service.name(key);
|
||||
assertThat(service.name(key)).isSameAs(r1);
|
||||
Cache cache = this.cm.getCache("testCache");
|
||||
// assert the method name is used
|
||||
assertThat(cache.get(keyName)).isNotNull();
|
||||
}
|
||||
|
||||
protected void testRootVars(CacheableService<?> service) {
|
||||
Object key = new Object();
|
||||
Object r1 = service.rootVars(key);
|
||||
assertThat(service.rootVars(key)).isSameAs(r1);
|
||||
Cache cache = this.cm.getCache("testCache");
|
||||
// assert the method name is used
|
||||
String expectedKey = "rootVarsrootVars" + AopProxyUtils.ultimateTargetClass(service) + service;
|
||||
assertThat(cache.get(expectedKey)).isNotNull();
|
||||
}
|
||||
|
||||
protected void testCheckedThrowable(CacheableService<?> service) {
|
||||
String arg = UUID.randomUUID().toString();
|
||||
assertThatIOException().isThrownBy(() ->
|
||||
service.throwChecked(arg))
|
||||
.withMessage(arg);
|
||||
}
|
||||
|
||||
protected void testUncheckedThrowable(CacheableService<?> service) {
|
||||
assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() ->
|
||||
service.throwUnchecked(1L))
|
||||
.withMessage("1");
|
||||
}
|
||||
|
||||
protected void testCheckedThrowableSync(CacheableService<?> service) {
|
||||
String arg = UUID.randomUUID().toString();
|
||||
assertThatIOException().isThrownBy(() ->
|
||||
service.throwCheckedSync(arg))
|
||||
.withMessage(arg);
|
||||
}
|
||||
|
||||
protected void testUncheckedThrowableSync(CacheableService<?> service) {
|
||||
assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() ->
|
||||
service.throwUncheckedSync(1L))
|
||||
.withMessage("1");
|
||||
}
|
||||
|
||||
protected void testNullArg(CacheableService<?> service) {
|
||||
Object r1 = service.cache(null);
|
||||
assertThat(service.cache(null)).isSameAs(r1);
|
||||
}
|
||||
|
||||
protected void testCacheUpdate(CacheableService<?> service) {
|
||||
Object o = new Object();
|
||||
Cache cache = this.cm.getCache("testCache");
|
||||
assertThat(cache.get(o)).isNull();
|
||||
Object r1 = service.update(o);
|
||||
assertThat(cache.get(o).get()).isSameAs(r1);
|
||||
|
||||
o = new Object();
|
||||
assertThat(cache.get(o)).isNull();
|
||||
Object r2 = service.update(o);
|
||||
assertThat(cache.get(o).get()).isSameAs(r2);
|
||||
}
|
||||
|
||||
protected void testConditionalCacheUpdate(CacheableService<?> service) {
|
||||
Integer one = 1;
|
||||
Integer three = 3;
|
||||
|
||||
Cache cache = this.cm.getCache("testCache");
|
||||
assertThat((int) Integer.valueOf(service.conditionalUpdate(one).toString())).isEqualTo((int) one);
|
||||
assertThat(cache.get(one)).isNull();
|
||||
|
||||
assertThat((int) Integer.valueOf(service.conditionalUpdate(three).toString())).isEqualTo((int) three);
|
||||
assertThat((int) Integer.valueOf(cache.get(three).get().toString())).isEqualTo((int) three);
|
||||
}
|
||||
|
||||
protected void testMultiCache(CacheableService<?> service) {
|
||||
Object o1 = new Object();
|
||||
Object o2 = new Object();
|
||||
|
||||
Cache primary = this.cm.getCache("primary");
|
||||
Cache secondary = this.cm.getCache("secondary");
|
||||
|
||||
assertThat(primary.get(o1)).isNull();
|
||||
assertThat(secondary.get(o1)).isNull();
|
||||
Object r1 = service.multiCache(o1);
|
||||
assertThat(primary.get(o1).get()).isSameAs(r1);
|
||||
assertThat(secondary.get(o1).get()).isSameAs(r1);
|
||||
|
||||
Object r2 = service.multiCache(o1);
|
||||
Object r3 = service.multiCache(o1);
|
||||
|
||||
assertThat(r2).isSameAs(r1);
|
||||
assertThat(r3).isSameAs(r1);
|
||||
|
||||
assertThat(primary.get(o2)).isNull();
|
||||
assertThat(secondary.get(o2)).isNull();
|
||||
Object r4 = service.multiCache(o2);
|
||||
assertThat(primary.get(o2).get()).isSameAs(r4);
|
||||
assertThat(secondary.get(o2).get()).isSameAs(r4);
|
||||
}
|
||||
|
||||
protected void testMultiEvict(CacheableService<?> service) {
|
||||
Object o1 = new Object();
|
||||
Object o2 = o1.toString() + "A";
|
||||
|
||||
|
||||
Object r1 = service.multiCache(o1);
|
||||
Object r2 = service.multiCache(o1);
|
||||
|
||||
Cache primary = this.cm.getCache("primary");
|
||||
Cache secondary = this.cm.getCache("secondary");
|
||||
|
||||
primary.put(o2, o2);
|
||||
assertThat(r2).isSameAs(r1);
|
||||
assertThat(primary.get(o1).get()).isSameAs(r1);
|
||||
assertThat(secondary.get(o1).get()).isSameAs(r1);
|
||||
|
||||
service.multiEvict(o1);
|
||||
assertThat(primary.get(o1)).isNull();
|
||||
assertThat(secondary.get(o1)).isNull();
|
||||
assertThat(primary.get(o2)).isNull();
|
||||
|
||||
Object r3 = service.multiCache(o1);
|
||||
Object r4 = service.multiCache(o1);
|
||||
assertThat(r3).isNotSameAs(r1);
|
||||
assertThat(r4).isSameAs(r3);
|
||||
|
||||
assertThat(primary.get(o1).get()).isSameAs(r3);
|
||||
assertThat(secondary.get(o1).get()).isSameAs(r4);
|
||||
}
|
||||
|
||||
protected void testMultiPut(CacheableService<?> service) {
|
||||
Object o = 1;
|
||||
|
||||
Cache primary = this.cm.getCache("primary");
|
||||
Cache secondary = this.cm.getCache("secondary");
|
||||
|
||||
assertThat(primary.get(o)).isNull();
|
||||
assertThat(secondary.get(o)).isNull();
|
||||
Object r1 = service.multiUpdate(o);
|
||||
assertThat(primary.get(o).get()).isSameAs(r1);
|
||||
assertThat(secondary.get(o).get()).isSameAs(r1);
|
||||
|
||||
o = 2;
|
||||
assertThat(primary.get(o)).isNull();
|
||||
assertThat(secondary.get(o)).isNull();
|
||||
Object r2 = service.multiUpdate(o);
|
||||
assertThat(primary.get(o).get()).isSameAs(r2);
|
||||
assertThat(secondary.get(o).get()).isSameAs(r2);
|
||||
}
|
||||
|
||||
protected void testPutRefersToResult(CacheableService<?> service) {
|
||||
Long id = Long.MIN_VALUE;
|
||||
TestEntity entity = new TestEntity();
|
||||
Cache primary = this.cm.getCache("primary");
|
||||
assertThat(primary.get(id)).isNull();
|
||||
assertThat(entity.getId()).isNull();
|
||||
service.putRefersToResult(entity);
|
||||
assertThat(primary.get(id).get()).isSameAs(entity);
|
||||
}
|
||||
|
||||
protected void testMultiCacheAndEvict(CacheableService<?> service) {
|
||||
String methodName = "multiCacheAndEvict";
|
||||
|
||||
Cache primary = this.cm.getCache("primary");
|
||||
Cache secondary = this.cm.getCache("secondary");
|
||||
Object key = 1;
|
||||
|
||||
secondary.put(key, key);
|
||||
|
||||
assertThat(secondary.get(methodName)).isNull();
|
||||
assertThat(secondary.get(key).get()).isSameAs(key);
|
||||
|
||||
Object r1 = service.multiCacheAndEvict(key);
|
||||
assertThat(service.multiCacheAndEvict(key)).isSameAs(r1);
|
||||
|
||||
// assert the method name is used
|
||||
assertThat(primary.get(methodName).get()).isSameAs(r1);
|
||||
assertThat(secondary.get(methodName)).isNull();
|
||||
assertThat(secondary.get(key)).isNull();
|
||||
}
|
||||
|
||||
protected void testMultiConditionalCacheAndEvict(CacheableService<?> service) {
|
||||
Cache primary = this.cm.getCache("primary");
|
||||
Cache secondary = this.cm.getCache("secondary");
|
||||
Object key = 1;
|
||||
|
||||
secondary.put(key, key);
|
||||
|
||||
assertThat(primary.get(key)).isNull();
|
||||
assertThat(secondary.get(key).get()).isSameAs(key);
|
||||
|
||||
Object r1 = service.multiConditionalCacheAndEvict(key);
|
||||
Object r3 = service.multiConditionalCacheAndEvict(key);
|
||||
|
||||
assertThat(!r1.equals(r3)).isTrue();
|
||||
assertThat(primary.get(key)).isNull();
|
||||
|
||||
Object key2 = 3;
|
||||
Object r2 = service.multiConditionalCacheAndEvict(key2);
|
||||
assertThat(service.multiConditionalCacheAndEvict(key2)).isSameAs(r2);
|
||||
|
||||
// assert the method name is used
|
||||
assertThat(primary.get(key2).get()).isSameAs(r2);
|
||||
assertThat(secondary.get(key2)).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCacheable() {
|
||||
testCacheable(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCacheableNull() {
|
||||
testCacheableNull(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCacheableSync() {
|
||||
testCacheableSync(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCacheableSyncNull() {
|
||||
testCacheableSyncNull(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEvict() {
|
||||
testEvict(this.cs, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEvictEarly() {
|
||||
testEvictEarly(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEvictWithException() {
|
||||
testEvictException(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEvictAll() {
|
||||
testEvictAll(this.cs, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEvictAllEarly() {
|
||||
testEvictAllEarly(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEvictWithKey() {
|
||||
testEvictWithKey(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEvictWithKeyEarly() {
|
||||
testEvictWithKeyEarly(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConditionalExpression() {
|
||||
testConditionalExpression(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConditionalExpressionSync() {
|
||||
testConditionalExpressionSync(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnlessExpression() {
|
||||
testUnlessExpression(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassCacheUnlessExpression() {
|
||||
testUnlessExpression(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testKeyExpression() {
|
||||
testKeyExpression(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVarArgsKey() {
|
||||
testVarArgsKey(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassCacheCacheable() {
|
||||
testCacheable(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassCacheEvict() {
|
||||
testEvict(this.ccs, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassEvictEarly() {
|
||||
testEvictEarly(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassEvictAll() {
|
||||
testEvictAll(this.ccs, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassEvictWithException() {
|
||||
testEvictException(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassCacheEvictWithWKey() {
|
||||
testEvictWithKey(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassEvictWithKeyEarly() {
|
||||
testEvictWithKeyEarly(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNullValue() {
|
||||
testNullValue(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassNullValue() {
|
||||
Object key = new Object();
|
||||
assertThat(this.ccs.nullValue(key)).isNull();
|
||||
int nr = this.ccs.nullInvocations().intValue();
|
||||
assertThat(this.ccs.nullValue(key)).isNull();
|
||||
assertThat(this.ccs.nullInvocations().intValue()).isEqualTo(nr);
|
||||
assertThat(this.ccs.nullValue(new Object())).isNull();
|
||||
// the check method is also cached
|
||||
assertThat(this.ccs.nullInvocations().intValue()).isEqualTo(nr);
|
||||
assertThat(AnnotatedClassCacheableService.nullInvocations.intValue()).isEqualTo(nr + 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMethodName() {
|
||||
testMethodName(this.cs, "name");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassMethodName() {
|
||||
testMethodName(this.ccs, "nametestCache");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRootVars() {
|
||||
testRootVars(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassRootVars() {
|
||||
testRootVars(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCustomKeyGenerator() {
|
||||
Object param = new Object();
|
||||
Object r1 = this.cs.customKeyGenerator(param);
|
||||
assertThat(this.cs.customKeyGenerator(param)).isSameAs(r1);
|
||||
Cache cache = this.cm.getCache("testCache");
|
||||
// Checks that the custom keyGenerator was used
|
||||
Object expectedKey = SomeCustomKeyGenerator.generateKey("customKeyGenerator", param);
|
||||
assertThat(cache.get(expectedKey)).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnknownCustomKeyGenerator() {
|
||||
Object param = new Object();
|
||||
assertThatExceptionOfType(NoSuchBeanDefinitionException.class).isThrownBy(() ->
|
||||
this.cs.unknownCustomKeyGenerator(param));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCustomCacheManager() {
|
||||
CacheManager customCm = this.ctx.getBean("customCacheManager", CacheManager.class);
|
||||
Object key = new Object();
|
||||
Object r1 = this.cs.customCacheManager(key);
|
||||
assertThat(this.cs.customCacheManager(key)).isSameAs(r1);
|
||||
|
||||
Cache cache = customCm.getCache("testCache");
|
||||
assertThat(cache.get(key)).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnknownCustomCacheManager() {
|
||||
Object param = new Object();
|
||||
assertThatExceptionOfType(NoSuchBeanDefinitionException.class).isThrownBy(() ->
|
||||
this.cs.unknownCustomCacheManager(param));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNullArg() {
|
||||
testNullArg(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassNullArg() {
|
||||
testNullArg(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCheckedException() {
|
||||
testCheckedThrowable(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassCheckedException() {
|
||||
testCheckedThrowable(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCheckedExceptionSync() {
|
||||
testCheckedThrowableSync(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassCheckedExceptionSync() {
|
||||
testCheckedThrowableSync(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUncheckedException() {
|
||||
testUncheckedThrowable(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassUncheckedException() {
|
||||
testUncheckedThrowable(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUncheckedExceptionSync() {
|
||||
testUncheckedThrowableSync(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassUncheckedExceptionSync() {
|
||||
testUncheckedThrowableSync(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdate() {
|
||||
testCacheUpdate(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassUpdate() {
|
||||
testCacheUpdate(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConditionalUpdate() {
|
||||
testConditionalCacheUpdate(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassConditionalUpdate() {
|
||||
testConditionalCacheUpdate(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMultiCache() {
|
||||
testMultiCache(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassMultiCache() {
|
||||
testMultiCache(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMultiEvict() {
|
||||
testMultiEvict(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassMultiEvict() {
|
||||
testMultiEvict(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMultiPut() {
|
||||
testMultiPut(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassMultiPut() {
|
||||
testMultiPut(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPutRefersToResult() {
|
||||
testPutRefersToResult(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassPutRefersToResult() {
|
||||
testPutRefersToResult(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMultiCacheAndEvict() {
|
||||
testMultiCacheAndEvict(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassMultiCacheAndEvict() {
|
||||
testMultiCacheAndEvict(this.ccs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMultiConditionalCacheAndEvict() {
|
||||
testMultiConditionalCacheAndEvict(this.cs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassMultiConditionalCacheAndEvict() {
|
||||
testMultiConditionalCacheAndEvict(this.ccs);
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
-1
@@ -19,7 +19,6 @@ package org.springframework.cache.aspectj;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.cache.Cache;
|
||||
import org.springframework.cache.config.AbstractCacheAnnotationTests;
|
||||
import org.springframework.cache.config.CacheableService;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.support.GenericXmlApplicationContext;
|
||||
|
||||
+6
-6
@@ -22,14 +22,8 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.CacheTestUtils;
|
||||
import org.springframework.cache.annotation.CachingConfigurerSupport;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.cache.config.AnnotatedClassCacheableService;
|
||||
import org.springframework.cache.config.CacheableService;
|
||||
import org.springframework.cache.config.DefaultCacheableService;
|
||||
import org.springframework.cache.config.SomeCustomKeyGenerator;
|
||||
import org.springframework.cache.config.SomeKeyGenerator;
|
||||
import org.springframework.cache.interceptor.CacheErrorHandler;
|
||||
import org.springframework.cache.interceptor.CacheResolver;
|
||||
import org.springframework.cache.interceptor.KeyGenerator;
|
||||
@@ -42,6 +36,12 @@ import org.springframework.context.annotation.AdviceMode;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.testfixture.cache.CacheTestUtils;
|
||||
import org.springframework.context.testfixture.cache.SomeCustomKeyGenerator;
|
||||
import org.springframework.context.testfixture.cache.SomeKeyGenerator;
|
||||
import org.springframework.context.testfixture.cache.beans.AnnotatedClassCacheableService;
|
||||
import org.springframework.context.testfixture.cache.beans.CacheableService;
|
||||
import org.springframework.context.testfixture.cache.beans.DefaultCacheableService;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
Vendored
+4
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,15 +17,11 @@
|
||||
package org.springframework.cache.aspectj;
|
||||
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.CacheTestUtils;
|
||||
import org.springframework.cache.annotation.CachingConfigurerSupport;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.cache.config.AbstractCacheAnnotationTests;
|
||||
import org.springframework.cache.config.AnnotatedClassCacheableService;
|
||||
import org.springframework.cache.config.CacheableService;
|
||||
import org.springframework.cache.config.DefaultCacheableService;
|
||||
import org.springframework.cache.config.SomeCustomKeyGenerator;
|
||||
import org.springframework.cache.config.SomeKeyGenerator;
|
||||
import org.springframework.cache.interceptor.CacheErrorHandler;
|
||||
import org.springframework.cache.interceptor.KeyGenerator;
|
||||
import org.springframework.cache.interceptor.SimpleCacheErrorHandler;
|
||||
@@ -34,6 +30,9 @@ import org.springframework.context.annotation.AdviceMode;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.testfixture.cache.CacheTestUtils;
|
||||
import org.springframework.context.testfixture.cache.SomeCustomKeyGenerator;
|
||||
import org.springframework.context.testfixture.cache.SomeKeyGenerator;
|
||||
|
||||
/**
|
||||
* @author Stephane Nicoll
|
||||
|
||||
Vendored
+1
-1
@@ -23,13 +23,13 @@ import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.cache.concurrent.ConcurrentMapCache;
|
||||
import org.springframework.cache.config.AnnotatedJCacheableService;
|
||||
import org.springframework.cache.jcache.config.AbstractJCacheAnnotationTests;
|
||||
import org.springframework.cache.support.SimpleCacheManager;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.AdviceMode;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.contextsupport.testfixture.jcache.AbstractJCacheAnnotationTests;
|
||||
|
||||
/**
|
||||
* @author Stephane Nicoll
|
||||
|
||||
+1
-1
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.cache.aspectj;
|
||||
|
||||
import org.springframework.cache.jcache.config.AbstractJCacheAnnotationTests;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.GenericXmlApplicationContext;
|
||||
import org.springframework.contextsupport.testfixture.jcache.AbstractJCacheAnnotationTests;
|
||||
|
||||
/**
|
||||
* @author Stephane Nicoll
|
||||
|
||||
Vendored
+4
@@ -25,6 +25,10 @@ import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.cache.annotation.Caching;
|
||||
|
||||
/**
|
||||
* Copy of the shared {@code AbstractCacheAnnotationTests}: necessary
|
||||
* due to issues with Gradle test fixtures and AspectJ configuration
|
||||
* in the Gradle build.
|
||||
*
|
||||
* @author Costin Leau
|
||||
* @author Phillip Webb
|
||||
* @author Stephane Nicoll
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user